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.

Open Marker Popup programmatically?

See original GitHub issue

I cannot find any way to call marker.openPopup() when the LMarker object is being handled by this lib.

Is there any, are there workarounds such as emitting a click event on the marker? How would I get a hold of the L.Marker instance?

PS: I’m sorry for not using StackOverflow to ask this question. I figured that GitHub issues is the first place devs would look for solutions as per convention - furthermore SO is empty and I don’t know if you even would get notified.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
DonNicoJscommented, Jul 20, 2018

You can place a ref on the l-popup element ie: myPopup then you can do: this.$refs.myPopup.mapObject.openPopup() you can also use the click event on the maker for that you can check this code: https://github.com/pulilab/vue-people/blob/master/frontend/components/MapMarker.vue

7reactions
eg9ycommented, Aug 6, 2018

What worked for me is calling openPopup on the marker ref, instead of the popup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cant open popup programmatically - leaflet - Stack Overflow
Save this question. Show activity on this post. I have a map on which im loading the markers with geoJSON.
Read more >
React Leaflet: Opening Popups Programmatically - Max Schmitt
In this post, I'll show you how to reveal a marker with its popup on a Map rendered by React Leaflet. Starting Point:...
Read more >
Leaflet marker popup link from outside of map dynamically
I am using Leaflet JavaScript library to show some earthquake informations. You can able to see few red circles on map. When you...
Read more >
Show leaflet marker popup from outside of map dynamically
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >
Work with markers in Mapbox.js | Help
You can customize the content of each popup with the L.bindPopup method. In this example, an image key is added to each feature's...
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