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.