Spaces:
Runtime error
Runtime error
Commit
·
af37579
1
Parent(s):
99b0a9f
add location
Browse files- src/utils.py +8 -0
src/utils.py
CHANGED
|
@@ -139,6 +139,14 @@ def init_map():
|
|
| 139 |
# Add a LayerControl to the map to toggle between layers (Satellite View and Default One)
|
| 140 |
folium.LayerControl().add_to(m)
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
# Macro to add legend
|
| 143 |
m.get_root().add_child(legend_macro)
|
| 144 |
return m
|
|
|
|
| 139 |
# Add a LayerControl to the map to toggle between layers (Satellite View and Default One)
|
| 140 |
folium.LayerControl().add_to(m)
|
| 141 |
|
| 142 |
+
# Add detect location button
|
| 143 |
+
plugins.LocateControl(
|
| 144 |
+
position="topleft",
|
| 145 |
+
drawCircle=False,
|
| 146 |
+
flyTo=True,
|
| 147 |
+
strings={"title": "My location | موقعي", "popup": "My location | موقعي"},
|
| 148 |
+
).add_to(m)
|
| 149 |
+
|
| 150 |
# Macro to add legend
|
| 151 |
m.get_root().add_child(legend_macro)
|
| 152 |
return m
|