1

Fabulous for Xamarin.Forms (Using Maps, full Elmish) の例を変更します: " https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/views-maps.html ". しかし、結果は私が期待したものと同じではありません。地図が表示されませんでした。問題の解決方法を教えてください。ありがとうございました。

// Copyright 2018-2019 Fabulous contributors. See LICENSE.md for license.
namespace SqueakyApp

open System.Diagnostics
open Fabulous
open Fabulous.XamarinForms
open Fabulous.XamarinForms.LiveUpdate
open Fabulous.XamarinForms.MapsExtension
open Xamarin.Forms
open Xamarin.Forms.Maps

module App =
    // Declaration
    type Model =
        { Count : int
          Step : int
          Pressed : bool }

    type Msg =
        | Increment
        | Decrement
        | UserLocation

    // Functions

    // Lifecycle
    let initModel =
        { Count = 0
          Step = 0
          Pressed = false }

    let init() = initModel, Cmd.none

    let update msg model =
        match msg with
        | Increment -> { model with Count = model.Count + model.Step }, Cmd.none
        | Decrement -> { model with Count = model.Count - model.Step }, Cmd.none
        | Reset -> init()

    let view (model : Model) dispatch =

        let paris = Position(48.8566, 2.3522)
        let london = Position(51.5074, -0.1278)
        let calais = Position(50.9513, 1.8587)
        let timbuktu = Position(16.7666, -3.0026)

        let map =
            View.Map
                (hasZoomEnabled = true, hasScrollEnabled = true,
                 pins = [ View.Pin(paris, label = "Paris", pinType = PinType.Place)
                          View.Pin(london, label = "London", pinType = PinType.Place) ],
                 requestedRegion = MapSpan.FromCenterAndRadius(calais, Distance.FromKilometers(300.0)))
        // View
        View.ContentPage(content = map)

    // Note, this declaration is needed if you enable LiveUpdate
    let program = Program.mkProgram init update view

type App() as app =
    inherit Application()

    let runner =
        App.program
        |> Program.withConsoleTrace
        |> XamarinFormsProgram.run app

スクリーンショット

ここに画像の説明を入力

4

1 に答える 1