I was wondering if anyone has had any luck with being able to change map view styles with a selectbox?
mapstyle = st.sidebar.selectbox(‘Choose Map Style:’, options=[‘Light’, ‘Dark’, ‘Satellite’, ‘Road’])
if (mapstyle == ‘Light’):
pp = pdk.Deck(initial_view_state=view_state, map_provider=‘mapbox’, map_style=pdk.map_styles.CARTO_LIGHT, layers=[slayer, layert1, olayer], tooltip=tooltip)
elif (mapstyle == ‘Dark’):
pp = pdk.Deck(initial_view_state=view_state, map_provider=‘mapbox’, map_style=pdk.map_styles.CARTO_DARK, layers=[slayer, layert1, olayer], tooltip=tooltip)
elif (mapstyle == ‘Satellite’):
pp = pdk.Deck(initial_view_state=view_state, map_provider=‘mapbox’, map_style=pdk.map_styles.SATELLITE, layers=[slayer, layert1, olayer], tooltip=tooltip)
else: (mapstyle == ‘Road’)
pp = pdk.Deck(initial_view_state=view_state, map_provider=‘mapbox’, map_style=pdk.map_styles.CARTO_ROAD, layers=[slayer, layert1, olayer], tooltip=tooltip)
Just curious if anyone has had any luck doing this?
Thanks in advance!
-Justin