Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -211,11 +211,13 @@ from streamlit_bokeh_events import streamlit_bokeh_events
|
|
211 |
|
212 |
loc_button = Button(label="Get Location")
|
213 |
loc_button.js_on_event("button_click", CustomJS(code="""
|
214 |
-
navigator.geolocation.getCurrentPosition(
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
219 |
"""))
|
220 |
current_localisation = streamlit_bokeh_events(
|
221 |
loc_button,
|
|
|
211 |
|
212 |
loc_button = Button(label="Get Location")
|
213 |
loc_button.js_on_event("button_click", CustomJS(code="""
|
214 |
+
navigator.geolocation.getCurrentPosition(function (position) {
|
215 |
+
localStorage.setItem('localisation', JSON.stringify({latitude: position.coords.latitude, longitude: position.coords.longitude}))
|
216 |
+
|
217 |
+
}, function () {
|
218 |
+
localStorage.setItem('localisation', JSON.stringify({latitude: null, longitude: null}))
|
219 |
+
|
220 |
+
});
|
221 |
"""))
|
222 |
current_localisation = streamlit_bokeh_events(
|
223 |
loc_button,
|