Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapsUi 2.0.3 map OSM freezes when trying to move in iOS #14

Open
luisrr1590 opened this issue Dec 2, 2020 · 0 comments
Open

MapsUi 2.0.3 map OSM freezes when trying to move in iOS #14

luisrr1590 opened this issue Dec 2, 2020 · 0 comments

Comments

@luisrr1590
Copy link

Hello I've been having this issue but only in iOS the map works fine in Android...tested in physical iPhone XR with iOS 14.2.

here is the code:

MyMap mapConfig = getMapFromServer.Result;
var map = new Map
{
CRS = "EPSG:3857",
Transformation = new MinimalTransformation()
};

map.Layers.Add(OpenStreetMap.CreateTileLayer());
map.Widgets.Add(new ScaleBarWidget(map) { TextAlignment = Mapsui.Widgets.Alignment.Center, HorizontalAlignment = Mapsui.Widgets.HorizontalAlignment.Center, VerticalAlignment = Mapsui.Widgets.VerticalAlignment.Top });
map.Widgets.Add(new Mapsui.Widgets.Zoom.ZoomInOutWidget { MarginX = 20, MarginY = 40 });

var position = new Point(-102, 22);

if (mapConfig.mapLat != 0 && mapConfig.mapLng != 0)
{
position = new Point(mapConfig.mapLng, mapConfig.mapLat);
}

var sphericalMercatorCoordinate = SphericalMercator.FromLonLat(position.X, position.Y);
if (mapConfig.mapZoom != 0)
map.Home = n => n.NavigateTo(sphericalMercatorCoordinate, map.Resolutions[mapConfig.mapZoom]);
else
map.Home = n => n.NavigateTo(sphericalMercatorCoordinate, map.Resolutions[5]);
mapView.Map = map;

if (mapConfig.pins.Count > 0)
{
foreach (MyPin pin in mapConfig.pins)
{
mapView.Pins.Add(new Pin()
{
Position = new Position(pin.pinLat, pin.pinLng),
Type = PinType.Pin,
Label = pin.pinName
});
}
}
I load certain parameters from my server (like position in map and pins) and then initialize the map with the pins....the problem doesn freeze the entire app just the map zone.

If I click the pins everything works fine but when I try to move the map it freezes and then the pins no longer work.
another thing is that it doesnt un-freeze until app restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant