Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -211,13 +211,11 @@ 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 |
-
});
|
| 221 |
"""))
|
| 222 |
current_location = streamlit_bokeh_events(
|
| 223 |
loc_button,
|
|
|
|
| 211 |
|
| 212 |
loc_button = Button(label="Get Location")
|
| 213 |
loc_button.js_on_event("button_click", CustomJS(code="""
|
| 214 |
+
navigator.geolocation.getCurrentPosition(
|
| 215 |
+
(loc) => {
|
| 216 |
+
document.dispatchEvent(new CustomEvent("GET_LOCATION", {detail: {lat: loc.coords.latitude, lon: loc.coords.longitude}}))
|
| 217 |
+
}
|
| 218 |
+
)
|
|
|
|
|
|
|
| 219 |
"""))
|
| 220 |
current_location = streamlit_bokeh_events(
|
| 221 |
loc_button,
|