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

Map not updating when adding a new layer #15

Closed
bonnojold opened this issue Oct 13, 2014 · 4 comments
Closed

Map not updating when adding a new layer #15

bonnojold opened this issue Oct 13, 2014 · 4 comments

Comments

@bonnojold
Copy link

Using mapsui with Xamarin for Android/iOS I came across the problem that the map does not update when adding/removing layers, nor do I seem to find a solution to update it manually.

I'm having a custom class which inherits from the ITileSource interface, the layer is not shown until I zoom/pan the map.

@pauldendulk
Copy link
Member

Do you use the latest source or the NuGet package?
In the latest source there are two map control for both Android and iOS. On Android MapControl is new and MapView is old. On iOS MapControl is new and MapControlUIKit is old (the MapControl in the nuget package was later renamed to MapControlUIKit).

@bonnojold
Copy link
Author

Using NuGet package 0.2.27 which seems to be the latest

In android I use Mapsui.UI.Android.MapView
In iOS I use Mapsui.UI.iOS.MapControl

Should I update to source?

@pauldendulk
Copy link
Member

That will not solve the problem. This needs to be fixed by calling ViewChanged in Map.LayersLayerAdded.

A workaround is to call MapControl(or MapView).Map.ViewChanged(true) after you add the layer. I think the nuget version still needs an extra extent and resolution parameter. You could use the Map.Viewport's extent and resolution for that.

@bonnojold
Copy link
Author

I was convinced I already tried the ViewChanged method so I kept looking for other solutions. Easy fix, thanks!

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

2 participants