Esri / esri-leaflet-vector

Display ArcGIS Online vector basemaps w/ Esri Leaflet
Apache License 2.0
56 stars 57 forks source link

Vector Base Maps out of Sync with other layers #52

Closed kjones09 closed 3 years ago

kjones09 commented 5 years ago

Sometimes my base map will not be in sync with the other layers on it. A combination of zooming in, and clicking on an icon's popup then clicking a home button to get back to the Continental US will make it out of sync. If I click and move the map slightly it snaps back to the correct location. I have put in some JavaScript to move the map a fraction of a latitude and that doesn't fix it, only a slight map move with an input device works (finger or mouse). I have attached an image with an example. What would cause this and/or what would resolve it? Thanks

(In the image the basemap is off not the shading.) vector_align

jgravois commented 5 years ago

hey @kjones09 :wave:

unfortunately, i don't know. our upstream dependency mapbox-gl-leaflet is just a (brittle) attempt to keep a WebGL context in sync with the canvas/svg leaflet map.

the code you'd want to look closest at the most closely is here: https://github.com/mapbox/mapbox-gl-leaflet/blob/7382e9ce9bc05a9385b96f1e9cd55d27f47412ff/leaflet-mapbox-gl.js#L142-L182

jwasilgeo commented 3 years ago

@kjones09 can you try this out again and let us know if you're seeing these visual errors with the new v3 release of this library?

Depending on how your layers were wired up originally, you would have to re-write them to use one of these 2 flavors:

https://github.com/Esri/esri-leaflet-vector#api-reference

jwasilgeo commented 3 years ago

@kjones09, we just refreshed the docs pages and changelogs to reflect what's new at esri-leaflet and esri-leaflet-vector v3. I'll close this with the hope that it won't be an issue anymore with the latest library versions, but do let us know if there are still problems for you.

Live examples and API docs:

Related repo changelogs:

And check out the ArcGIS for Developers pages focusing on esri-leaflet: