1

I am following the quickstart at https://mapsui.com/documentation/getting-started-xamarin-forms.html and wonder if I need to obtain the location by myself (with e.g Xamarin.Essentials' Location routines) or the Mapsui will obtain one by itself. I've marked the location priviledges in AndroidManifest, allowed the access but still the blue circle points at 0,0 coordinates.

EDIT: here's the code

    public MainPage()
    {
        InitializeComponent();

        map = new Mapsui.Map
        {
            CRS = "EPSG:3857",
            Transformation = new MinimalTransformation(),
        };

        var tileLayer = OpenStreetMap.CreateTileLayer();

        map.Layers.Add(tileLayer);
        map.Widgets.Add(new Mapsui.Widgets.ScaleBar.ScaleBarWidget(map) { 
            TextAlignment = Mapsui.Widgets.Alignment.Center, 
            HorizontalAlignment = Mapsui.Widgets.HorizontalAlignment.Left, 
            VerticalAlignment = Mapsui.Widgets.VerticalAlignment.Bottom });

        mapView.MyLocationEnabled = true;
        mapView.PanLock = true;
        mapView.Map = map;
    }

Unfortunately, none of MyLocationEnabled and PanLock make any effect on the map - the blue circle is stil in 0,0 and the map isn't pan-locked.

eltomek
  • 233
  • 1
  • 10
  • 1
    according to the API docs, the MapView control has several properties for "MyLocaton" - http://mapsui.com/api/Mapsui.UI.Forms.MapView.html – Jason Dec 29 '20 at 15:16
  • That's interesting as none of those properties seem to work: `mapView.MyLocationEnabled = true; mapView.PanLock = true;` don't make the map obtain the location nor is pan-locked – eltomek Dec 29 '20 at 15:24

0 Answers0