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
In my app I get the users location off the bat, and store it in a session_state. I also have a button that refreshes the location, but when it's clicked I get error: raise DuplicateWidgetID(
streamlit.errors.DuplicateWidgetID: There are multiple widgets with the same key='getLocation()'.
Init: loc = get_geolocation(key='init') if loc: st.session_state["latitude"] = loc['coords']['latitude'] st.session_state["longitude"] = loc['coords']['longitude']
Refresh: if st.button("Refresh Location"): loc = get_geolocation() if loc: st.session_state["latitude"] = loc['coords']['latitude'] st.session_state["longitude"] = loc['coords']['longitude'] st.rerun
In the docs I see that get_geolocation(component_key=None): I can create a unique key from a datetime object, but this seems roundabout. I just want a return of the current location without creating new widget objects. whatever.
The text was updated successfully, but these errors were encountered:
In my app I get the users location off the bat, and store it in a session_state. I also have a button that refreshes the location, but when it's clicked I get error: raise DuplicateWidgetID(
streamlit.errors.DuplicateWidgetID: There are multiple widgets with the same
key='getLocation()'
.Init:
loc = get_geolocation(key='init') if loc: st.session_state["latitude"] = loc['coords']['latitude'] st.session_state["longitude"] = loc['coords']['longitude']
Refresh:
if st.button("Refresh Location"): loc = get_geolocation() if loc: st.session_state["latitude"] = loc['coords']['latitude'] st.session_state["longitude"] = loc['coords']['longitude'] st.rerun
In the docs I see that get_geolocation(component_key=None): I can create a unique key from a datetime object, but this seems roundabout. I just want a return of the current location without creating new widget objects. whatever.
The text was updated successfully, but these errors were encountered: