Closed tripler closed 2 years ago
Thank you for reporting this issue. To summarize the replication case:
I agree that this seems like an issue and should be addressed. I'll try to take a look, but PRs are also welcome! Thanks!
This was fixed in v3.1.3
The vector basemap layer can become misaligned with the map when the zoom level is changed or when the basemap layer is first loaded before the map has been interacted with.
The easiest way to see a reproduction is via the "Simple DynamicMapLayer" example: https://esri.github.io/esri-leaflet/examples/simple-dynamic-map-layer.html
Simply zoom out to zoom level 1 or 0 and you will see the base layer "shift" under the overlay. This occurs in all browsers I've tested (Chrome, Edge, Firefox, Safari & Chrome Android).
Interacting with the map and toggling between zoom levels can sometimes "fix" level 1, but level 0 appears to always be misaligned. I'm experiencing this issue with my own use of vectorBasemapLayer as well.
Base layer alignment issues can also be observed via the "Switching basemaps" example: https://esri.github.io/esri-leaflet/examples/switching-basemaps.html
If you zoom out to map zoom level 2 or 3 and swap between base layers the newly loaded layer will be incorrectly aligned until a map interaction takes place, "snapping" it back into the proper place where it should have loaded. Sometimes the misalignment is subtle, other times it is quite dramatic.
These behaviors are also visible on the newer documentation examples: https://developers.arcgis.com/esri-leaflet/samples/simple-feature-layer/ https://developers.arcgis.com/esri-leaflet/maps/change-the-basemap-layer/