Closed kevinkdarling closed 2 years ago
Interesting.
Do you have any working codesandboxes that demonstrate the problem that you could show me?
I'll take a look when I can.
Any update on this? Things are busy, so without an example to go off of, if or you're saying this is a problem that happens with vanilla esri-leaflet, I may just close this.
No response on this and no working example, closing.
This is not a problem per se with your code, but your code could possibly solve the bug in other code. (Or if you wish, I could take this to the esri-leaflet people.)
What happens is that each time you call identify, esri-leaflet creates a new jsonp callback script element. This continues ad infinitum. A quick solution is to capture the returned script id and immediately remove the element, as shown below. (This is okay, as the initial script include has already fired off the request. Another method is to remove it in your own callback.)
This way, the DOM does not get filled up with old identify scripts. Another possiblity might be to somehow capture this method in your code and do the deletion for the user (??).
In any case, your users should be made aware of this, possibly by including a note or code in your examples.
Thanks again! Kev