I had a map in HTML format using the leaflets package which is in iframe and I wanted to capture the clickable data from the iframe component in map HTML to the Python-dash application.
I would recommend replacing the map in the iframe with a dash leaflet map component; then you’ll be able to listen to click events from that component.
Thanks for the reply. Our map is bit a complex 4 layers have been included in the map. And we are unable to capture the hover data which was needed in the python dash application.
I am assuming the js project that you created this with has some sort of way to pull the data, you just need to wrangle this data into a dcc.Store and then have Dash sync it.
You can add an event listener to the click data of the projects maps, place the data into a session/local storage object depending upon how you set it up, then have a message that the frame can send to the parent to trigger a clientside callback to update the dcc.Store appropriately:
Hi Emil, as per your suggestion we have created the map using the dash leaflet component and now we are trying to display the data when a user clicks on the map.
From the code, you can observe that I have written a callback function to capture the data. I was able to get latitude, and longitude but the feature is getting as null. Can you suggest the best way to capture the data when the user clicks on the map? Whereas the feature is a property in the JSON file.