Esri / esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. :rocket:
https://developers.arcgis.com/esri-leaflet/
Apache License 2.0
1.61k stars 799 forks source link

TiledMapLayer no longer removes itself #1264

Closed CalebPourchot closed 3 years ago

CalebPourchot commented 3 years ago

Add a TiledMapLayer Call layer.remove or map.removeLayer() on the TiledMapLayer The pane isn't removed from the map.

Looks like it is related to this change #1248 for removing attribution. OnRemove() was added to TiledMapLayer, but the base leaflet version of the function isn't called, so the layer is never removed. At least I think that's what is happening.

esri-leaflet version 2.5.3 leaflet ##1.7.1

gavinr commented 3 years ago

Thanks for the report! Are you able to create a simplified replication case (using JSBin or similar) for this?

CalebPourchot commented 3 years ago

Sure, I can. But, i think the code speaks for itself - it never calls the remove code in the layer prototype.

I'll throw something together.

Thanks, Caleb

On Fri, Mar 19, 2021 at 2:31 PM Gavin Rehkemper @.***> wrote:

Thanks for the report! Are you able to create a simplified replication case (using JSBin or similar) for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Esri/esri-leaflet/issues/1264#issuecomment-803064723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHB5X3VQFZQZWYB3H3SGH53TEORBRANCNFSM4ZPLJACQ .

-- Caleb Pourchot Principal

landconservationsoftware.com | Find me on Facebook https://facebook.com/landscapesoftware | Follow me on Twitter https://twitter.com/landscapesoft

LANDSCAPE is a product of: Dendroyka LLC | 2426 E Johnson Street | Madison, WI | 53704

CalebPourchot commented 3 years ago

Here's a fiddle: https://jsfiddle.net/juLgmhrk/

notice the attribution gets removed, but the layer doesn't.

Thanks

jwasilgeo commented 3 years ago

Related to PR #1258 perhaps? If so, then it was fixed and available on esri-leaflet 3.0.1.

https://github.com/Esri/esri-leaflet/pull/1258

CalebPourchot commented 3 years ago

That looks like it exactly. Sorry I didn't find it when searching. Just gotta update.

Thanks!

jwasilgeo commented 3 years ago

No problem. This is the best kind of fix! 🎉