I can’t figure out how to find a CircleMarker in Folium using Python. The Circle Marker contains an iFrame. I put a search field on my Folium map and I am trying to make it so the user can search for a CircleMarker by the content in the iFrame and then make the iFrame popup to show the user where the location is.
For example, if the CircleMarker contains an iFrame that says “Warehouse #1”, I would like for the user to be able to search “Warehouse #1” and have the iFrame popup as if the CircleMarker was clicked on.
Anyone have an idea?
I have tried capturing the markers but they do not have a __popup property to access. I also can’t find the iFrame located in the markers. I am assuming they are separate and accessed separately using some other method?
var markers = document.querySelectorAll('.leaflet-interactive');
markers.forEach(function(marker) {
var popup = marker._popup;
if (popup && popup.getContent().includes('Warehouse #1')) {
console.log('Found CircleMarker with Warehouse #1');
// You can add additional actions here
}
});
nicholasm5581 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1