I have been playing around with the WPF Mapsui control and everything seems to work great overall when using a tile layer, such as OpenStreetMaps.
However, when I do not add the tile layer and try to work with 2 individual layers I get strange behavior with the zooming and panning. Having gone through all the documentation I can find, I gathered that the control does not explicitly have a coordinate system, but instead uses whatever is added as the default. This works great when OSM is loaded because it uses the Mercator projection, however when the tiles are not loaded and two separate layers are loaded, it seems to only use the first layer for zooming/panning limits. This causes panning to be limited to the bounds of the first layer.
Is there any way to have the control update to use all added layers for determining the pan extents and zoom limits? Alternatively, is there a simple way to just use the full Mercator schema for zooming and panning, even though the OSM layer is not loaded?
You could assign the Map.Navigator.OverrideResolutions
with the resolutions used in OpenStreetMap tile layer.
To get a list of those resolutions you can use the GlobalSphericalMercator
tile schema like this:
map.Navigator.OverrideResolutions = new GlobalSphericalMercator().Resolutions.Select(r => r.Value.UnitsPerPixel).ToList();
You may also want to assign the OverridePanBounds and the OverrideZoomBounds.