How to show openstreetmap using Mapsui?

514 Views Asked by At

I'm trying to use openstreetmap in my xamarin.forms app using mapsui;

Tried this tutorial https://mapsui.com/documentation/getting-started-xamarin-forms.html

But the Android displays a Application Not Responding dialog . I don't know why ,but when I remove the code in MainPage.xaml.cs the program works but doesn't show the map, all it shows is: image Link

if there is any other tutorial please let me know

the code that i removed :

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

var tileLayer = OpenStreetMap.CreateTileLayer();

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

mapView.Map = map;

0

There are 0 best solutions below