question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generic approach for popup.update() if content is still loading?

See original GitHub issue

Hi 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:closed
  • Created 9 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghybscommented, Aug 3, 2018

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.

0reactions
cmwright93commented, Dec 17, 2018

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:

Hi @cmwright93 https://github.com/cmwright93,

Have you tried the solution on the link https://stackoverflow.com/questions/51732698/leaflet-popup-update-resizing-solution-recreating-a-popup-everytime-unable/51749619#51749619 posted in #5484 (comment) https://github.com/Leaflet/Leaflet/issues/5484#issuecomment-299949921?

Should you need further help, please use Stack Overflow https://stackoverflow.com/questions/tagged/leaflet or GIS Stack Exchange https://gis.stackexchange.com/questions/tagged/leaflet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet/issues/2739#issuecomment-447472486, or mute the thread https://github.com/notifications/unsubscribe-auth/AqPvHPm5v9UUNMUIeNS42LNOtANUjwtCks5u5AwFgaJpZM4CE4Dr .

Caroline Wright

Read more comments on GitHub >

github_iconTop Results From Across the Web

Popups: 10 Problematic Trends and Alternatives
A popup can be classified according to two dimensions: 1. Whether the user can interact with the rest of the page:
Read more >
How to Handle Alerts/Popups in Selenium WebDriver
1) void dismiss() – The dismiss() method clicks on the “Cancel” button as soon as the pop up window appears. 2) void accept()...
Read more >
Leaflet popup.update() Resizing Solution - Stack Overflow
update() resets the Popup content using the HTML string, hence re-creates the <img> element, which emits a new "load" event, even if now...
Read more >
Page: DOMContentLoaded, load, beforeunload, unload
DOMContentLoaded – the browser fully loaded HTML, and the DOM tree is built, but external resources like pictures <img> and stylesheets may not...
Read more >
Xamarin Community Toolkit Popup - Microsoft Learn
We can further enhance a Popup to return a result. This example involves adding a button that will invoke the Dismiss method and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found