|
import streamlit as st |
|
import pydeck as pdk |
|
|
|
|
|
geojson_data = { |
|
"type": "FeatureCollection", |
|
"features": [ |
|
{ |
|
"type": "Feature", |
|
"geometry": { |
|
"type": "Point", |
|
"coordinates": [15.8277, -0.2280] |
|
}, |
|
"properties": { |
|
"name": "Republic of Congo" |
|
} |
|
} |
|
] |
|
} |
|
|
|
|
|
layer = pdk.Layer( |
|
"GeoJsonLayer", |
|
data=geojson_data, |
|
get_position="geometry.coordinates", |
|
get_radius=100000, |
|
get_fill_color=[255, 0, 0], |
|
pickable=True |
|
) |
|
|
|
|
|
view_state = pdk.ViewState( |
|
latitude=geojson_data['features'][0]['geometry']['coordinates'][1], |
|
longitude=geojson_data['features'][0]['geometry']['coordinates'][0], |
|
zoom=6 |
|
) |
|
|
|
|
|
deck = pdk.Deck( |
|
layers=[layer], |
|
initial_view_state=view_state, |
|
map_style="mapbox://styles/mapbox/light-v9", |
|
mapbox_key='pk.eyJ1IjoiYWFyb253YWNrZXIiLCJhIjoiY2xlOGV2enN3MGV0YzN2bzZjMm96eXhyOSJ9.SqZugs5uIpIBvMM_Hioyvg' |
|
) |
|
|
|
|
|
st.pydeck_chart(deck) |