Closed giswqs closed 5 months ago
I do not know what's the usecase for this, but I can add it if needed as Map.add_popup2
:-)
It works now with this. Not sure why it didn't work earlier.
url = "https://github.com/opengeos/datasets/releases/download/world/world_cities.geojson"
geojson = requests.get(url).json()
source = {
"type": "geojson",
"data": geojson
}
layer = {
"id": "cities",
"type": "symbol",
"source": "point",
"layout": {
"icon-image": "marker_15",
"icon-size": 1,
},
}
m.add_source("point", source)
m.add_layer(layer)
m.add_popup("cities")
The MapLibre JS does not seem to have the
addPopup
method. Ideally, theadd_popup()
method should accept lon/lat coordinates and HTML string to be displayed on the popup, similar to the JS functionality.https://maplibre.org/maplibre-gl-js/docs/examples/popup/