Opening a popup on clicking a GeoJSON object
See original GitHub issueFrom the documentation on popup, it seems like popups can only be opened interactively with the marker element.
I wonder if it can also be opened via a custom callback function attached to a GeoJSON.on_click
method, adding something like popup.open()
or popup.close()
to the Popup
class.
Seems to be related to #239. Any suggestions on how I should proceed from here?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Show popup on GeoJSON layer data when button is clicked?
Problem in your code is that your are opening popup only the first time layer is added to the map, and not subsequently...
Read more >Leaflet open a popup on marker click from GeoJSON layer
Bind your popup when the feature is created, not when the user clicks on it, Leaflet will handle the click events for you:...
Read more >Display a popup on click | Mapbox GL JS
When a user clicks a symbol, show a popup containing more information. ... add additional images, open the style in Mapbox Studio and...
Read more >Map with polygon and popup from GeoJSON using JavaScript
This video shows how to load GeoJSON with polygon features from an external file with OpenLayers and how to create a popup from...
Read more >Display a popup on click | MapLibre GL JS Docs
When a user clicks a symbol, show a Popup containing more information. ... });. // Add a layer showing the places. ... //...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds like a good idea 😃
If you would like to implement this feature, I guess it will be similar to the
redraw
function theTileLayer
class provides: https://github.com/jupyter-widgets/ipyleaflet/blob/master/ipyleaflet/leaflet.py#L589-L595 It sends a comm message asking for aredraw
, and the front-end handles it here: https://github.com/jupyter-widgets/ipyleaflet/blob/3273696bfe73d051fc7864f6731c8ed2198e6f68/js/src/layers/TileLayer.js#L76-L80 Don’t hesitate to ask for more guidance 😃 Opening the popup in JS will look like the following I guess:Any comments on #914?