Spaces:
Sleeping
Sleeping
Update pages/MipMAP.py
Browse files- pages/MipMAP.py +44 -3
pages/MipMAP.py
CHANGED
|
@@ -210,8 +210,6 @@ class AdvancedMapControl(MacroElement):
|
|
| 210 |
{% endmacro %}
|
| 211 |
""")
|
| 212 |
|
| 213 |
-
# Le reste du code Python reste inchangé
|
| 214 |
-
|
| 215 |
def main():
|
| 216 |
st.title("SwissScape Advanced")
|
| 217 |
|
|
@@ -225,7 +223,50 @@ def main():
|
|
| 225 |
4. Utilisez "Exporter GeoJSON" pour télécharger les données de la bbox et des blocs.
|
| 226 |
""")
|
| 227 |
|
| 228 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
|
| 230 |
if __name__ == "__main__":
|
| 231 |
main()
|
|
|
|
| 210 |
{% endmacro %}
|
| 211 |
""")
|
| 212 |
|
|
|
|
|
|
|
| 213 |
def main():
|
| 214 |
st.title("SwissScape Advanced")
|
| 215 |
|
|
|
|
| 223 |
4. Utilisez "Exporter GeoJSON" pour télécharger les données de la bbox et des blocs.
|
| 224 |
""")
|
| 225 |
|
| 226 |
+
# Création de la carte Folium
|
| 227 |
+
m = folium.Map(location=[46.8182, 8.2275], zoom_start=8)
|
| 228 |
+
|
| 229 |
+
# Ajout du fond de carte swisstopo
|
| 230 |
+
folium.TileLayer(
|
| 231 |
+
tiles="https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg",
|
| 232 |
+
attr="© swisstopo",
|
| 233 |
+
name="swisstopo",
|
| 234 |
+
overlay=False,
|
| 235 |
+
control=True
|
| 236 |
+
).add_to(m)
|
| 237 |
+
|
| 238 |
+
# Ajout du contrôle de dessin
|
| 239 |
+
draw = Draw(
|
| 240 |
+
draw_options={
|
| 241 |
+
'polyline': False,
|
| 242 |
+
'polygon': False,
|
| 243 |
+
'circle': False,
|
| 244 |
+
'marker': False,
|
| 245 |
+
'circlemarker': False,
|
| 246 |
+
'rectangle': True,
|
| 247 |
+
},
|
| 248 |
+
edit_options={'edit': False}
|
| 249 |
+
)
|
| 250 |
+
m.add_child(draw)
|
| 251 |
+
|
| 252 |
+
# Ajout du contrôle de carte avancé
|
| 253 |
+
m.add_child(AdvancedMapControl())
|
| 254 |
+
|
| 255 |
+
# Ajout des coordonnées de la souris
|
| 256 |
+
formatter = "function(num) {return L.Util.formatNum(num, 5);};"
|
| 257 |
+
MousePosition(
|
| 258 |
+
position="bottomleft",
|
| 259 |
+
separator=" | ",
|
| 260 |
+
empty_string="",
|
| 261 |
+
lng_first=True,
|
| 262 |
+
num_digits=20,
|
| 263 |
+
prefix="Coordonnées:",
|
| 264 |
+
lat_formatter=formatter,
|
| 265 |
+
lng_formatter=formatter,
|
| 266 |
+
).add_to(m)
|
| 267 |
+
|
| 268 |
+
# Affichage de la carte
|
| 269 |
+
folium_static(m, width=1000, height=600)
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
| 272 |
main()
|