You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to using the Pydeck module.
At the moment I am trying to make a tooltip work, but could not get it to work after looking through the documentation.
I attached part of my code as an image.
I am trying to pass values from the properties values in the GeoJSON file. However, at the moment it will only display it as plain text instead of being a value.
Would someone be able to help me out?
Kind regards,
Chris
The text was updated successfully, but these errors were encountered:
Currently not supported in pydeck but it's a reasonable feature request.
As a workaround, you can load the GeoJSON into a Pandas DataFrame and make all these properties top-level. Alternately you could load the data with GeoPandas and it will extract the properties.
importpydeckaspdkimportgeopandasasgpdDATA_URL='https://raw.githubusercontent.com/MinnPost/simple-map-d3/master/example-data/world-population.geo.json'world=gpd.read_file(DATA_URL)
display(world.head())
layers= [
pdk.Layer(
"GeoJsonLayer",
data=world,
pickable=True,
auto_highlight=True,
get_fill_color=[255, 255, 140]),
]
pdk.Deck(
layers,
map_provider=None,
tooltip={'text': '{NAME}, with a population of {POP2005}'},
).to_html("json-example.html", css_background_color="cornflowerblue")
ajduberstein
changed the title
Use properties values in JSON data to display a tooltip
pydeck: Use properties values in JSON data to display a tooltip
Aug 29, 2020
Im sorry for the late answer, I have been occupied with a lot of other things, but thanks to your replay I was able to make it work! Thanks for helping!
Hello everyone,
I am new to using the Pydeck module.
At the moment I am trying to make a tooltip work, but could not get it to work after looking through the documentation.
I attached part of my code as an image.
I am trying to pass values from the properties values in the GeoJSON file. However, at the moment it will only display it as plain text instead of being a value.
Would someone be able to help me out?
Kind regards,
Chris
The text was updated successfully, but these errors were encountered: