Generic approach for popup.update() if content is still loading?
See original GitHub issueHi Mourner,
this is a follow up ticket to https://github.com/Leaflet/Leaflet/issues/1959 and https://github.com/Leaflet/Leaflet/issues/2079 in which you refer to the popup.update()-function for reloading the popup in order to make autopanning work even if content is still loading.
I am having more and more users of my plugin pointing to that issue, e.g. http://www.davidkneale.com/wc2/destinations/borneo/ - unfortunately I did not find a generic solution for that issue yet.
To be more precise, I do not know how and when to execute that update()-function, as it should only be fired when content is still loading right?
I though about adding
marker.on('popupopen', function(e) { popup.update(); });
but that will not take into account if the content is still loading right? I thought in order for this to work, there needs to be an event which fires when popup content has been loaded, so that I can use this one for updating the popup content and fix autopanning. So I was looking for something like
marker.on('popup-loading-finished', function(e) { popup.update(); });
Unfortunately I couldnt find a similar event on your reference page. Could you please give me some hint on how this could be achieved?
Thx,
Robert
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
Hi @schmidtster,
It sounds to me that you would be interested in the solution described in https://github.com/Leaflet/Leaflet/issues/5484#issuecomment-299949921 If still needed, please feel free to submit a PR for
minHeight.Hi ghybs
Thanks for getting back to me. I have tried that solution, the break ( popup._updated = true) does help with the solution’s infinite loop issue but unfortunately makes the overall function no longer work for its intended use.
On Fri, Dec 14, 2018 at 3:37 PM ghybs notifications@github.com wrote:
–
Caroline Wright