I have a dash leaflet map.
I’m creating the markers by building a dataframe (dfGeo) with columns like latitude, longitude, popup, tooltip, and icon.
Then, I create the geoJSON like this:
geoJSON['props']['data'] = dfGeo.__geo_interface__
And in the GeoJSON object definition, I point to the javascript in dashLeafletFunctions.js:
dl.GeoJSON(
id="gisSandbox-geojson",
options=dict(pointToLayer=ns("draw_marker")),
),
draw_marker looks like this:
window.dashExtensions = Object.assign({}, window.dashExtensions, {
dashExtensionssub: {
draw_marker: function(feature, latlng) {
var marker = feature.properties.marker_color;
return L.marker(latlng, {
icon: L.icon({
iconUrl: feature.properties.icon,
iconSize: [45, 45],
})
});
}
}
});
This works as expected.
However, under certain circumstances, I want to always show the tooltip - not just on hover.
How can I accomplish this using the pattern I’m using?
Thanks!