-
|
Moving the map view across 180long seems to be prevented. This makes zooming in to areas such as New Zealand unusually difficult. Given that by default MapLibre does allow to move the view across this line, and I remember this being possible in the past, this seems to be intentional. So I would like to ask why. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Thanks for the question. There is only a technical reason for this issue. The map is not one map but actually two maps, displayed at the same time. An upper map showing all the railway related things, and a background map showing the background map tiles (or any other background map that the user has configured). The upper and background map are "synchronized" whenever the upper map is dragged/zoomed/rotated. The reason for having two maps is that configuring vector tiles as a background map, has a full map style which has to be loaded in its own map, instead of raster tiles which can be loaded into a single layer in the existing upper map. A consequence is that the synchronization between the upper and background map fails, when the map is zoomed out enough that the boundaries are larger than a single Earth, crossing the -180 or 180 longitude lines, or when the zoom level is smaller than 0. In that case the background map will stop working. So the solution was adding bounds to both maps, restricting the dragging and zooming to always be within a single Earth bounds, and not crossing the -180 and 180 longitude lines. This is configured in OpenRailwayMap-vector/proxy/js/ui.js Line 1184 in b6ed599 If somebody finds a way to make the background map not crash when zooming out to more than a single Earth in view, I am happy to drop this restriction. |
Beta Was this translation helpful? Give feedback.
As far as I can determine, it depends on the screen size how much the zoom needs to be restricted. So the current easiest solution is restricting the movement of the map to within Earth bounds. But if we find a way to remove that restriction by solving the background map issue in a different way, I am all open to it!