-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Maplibre-gl-leaflet layer is mis-aligned with map when panning the map off screen #29
Comments
Thanks for taking the time to open this issue @gavinr |
This comment was marked as outdated.
This comment was marked as outdated.
Is there a way to limit the map movement maybe? |
@wipfli yes Leaflet supports a https://jsbin.com/yofobup/1/edit?html,output var map = L.map('map', {
maxBounds:[[-90,-180], [90,180]] // limit to the defined world bounds
}).setView([0,0 ], 2);
L.marker([179, 0])
.bindPopup("Hello <b>Leaflet GL</b>!<br>Whoa, it works!")
.addTo(map)
.openPopup();
var gl = L.maplibreGL({
// get your own MapTiler token at https://cloud.maptiler.com/ or use MapBox style
style: 'https://api.maptiler.com/maps/topo/style.json?key=gbetYLSD5vR8MdtZ88AQ'
}).addTo(map); I guess the question is do we try to just limit the north/south panning/zooming behavior in |
Since it is a north/south problem, I would like to avoid limiting also east/west movement, so |
@wipfli I can give it a shot but it probably won't be soon. |
* Fix #29 * add changelog entry * Update CHANGELOG.md Co-authored-by: Oliver Wipfli <oliver.wipfli@leichteralsluft.ch>
If you drag the map out of the window, the maplibre-gl-leaflet layer gets stuck in view while other leaflet layers (like markers) continue to get pulled, causing the two layers not to be aligned correctly.
Replication case
https://jsbin.com/vepuyeqoyo/3/edit?html,output
chrome_t6InO6UcHH.mp4
The text was updated successfully, but these errors were encountered: