loubnabnl HF staff badr12a commited on
Commit
391cfe9
1 Parent(s): ea7434c

Epicenter Marker + Danger Distances Information (#11)

Browse files

- Epicenter Marker + Danger Distances Information (32d691843dd682c4d6d459e85cc2211bc312a406)


Co-authored-by: badr <badr12a@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +68 -0
app.py CHANGED
@@ -265,6 +265,74 @@ folium.TileLayer(
265
  control = True
266
  ).add_to(m)
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  # Add a LayerControl to the map to toggle between layers (Satellite View and Default One)
269
  folium.LayerControl().add_to(m)
270
 
 
265
  control = True
266
  ).add_to(m)
267
 
268
+ # Marker for the epicentre
269
+ icon_epicentre = folium.plugins.BeautifyIcon(
270
+ icon='spinner',
271
+ spin='true',
272
+ border_color='#b3334f',
273
+ background_color = '#b3334f',
274
+ text_color = 'white'
275
+ )
276
+ folium.Marker(location=[31.12210171476489, -8.42945837915193], popup="Epicenter زلزال المغرب 2023 (مركز الزلزال)", icon=icon_epicentre).add_to(m)
277
+
278
+ # Danger Distances Feature
279
+ Danger_Distances_group = folium.FeatureGroup(name='Danger distances - earthquake magnitude 7 | مسافات الخطر - قوة الزلازل 7').add_to(m)
280
+
281
+ radius = 100000 # in meters
282
+ folium.Circle(
283
+ location=[31.12210171476489, -8.42945837915193],
284
+ radius=radius,
285
+ color="black",
286
+ weight=1,
287
+ fill_opacity=0.1,
288
+ opacity=0.1,
289
+ fill_color="yellow",
290
+ tooltip="50 to 100 km -Moderate risk area | منطقة خطر معتدلة",
291
+ ).add_to(Danger_Distances_group)
292
+
293
+
294
+ radius = 50000 # in meters
295
+ folium.Circle(
296
+ location=[31.12210171476489, -8.42945837915193],
297
+ radius=radius,
298
+ color="black",
299
+ weight=1,
300
+ fill_opacity=0.1,
301
+ opacity=0.1,
302
+ fill_color="orange",
303
+
304
+
305
+ tooltip="30 to 50 km - High risk zone | منطقة عالية المخاطر",
306
+ ).add_to(Danger_Distances_group)
307
+
308
+
309
+ radius = 30000 # in meters
310
+ folium.Circle(
311
+ location=[31.12210171476489, -8.42945837915193],
312
+ radius=radius,
313
+ color="black",
314
+ weight=1,
315
+ fill_opacity=0.2,
316
+ opacity=0.2,
317
+ fill_color="#FF0000",
318
+
319
+ tooltip="10 to 30 km - Very high risk zone | منطقة شديدة الخطورة ",
320
+ ).add_to(Danger_Distances_group)
321
+
322
+ radius = 10000 # in meters
323
+ folium.Circle(
324
+ location=[31.12210171476489, -8.42945837915193],
325
+ radius=radius,
326
+ color="black",
327
+ weight=0.2,
328
+ fill_opacity=0.2,
329
+ opacity=0.2,
330
+ fill_color="#8B0000",
331
+
332
+ tooltip="0 to 10km - direct impact zone | منطقة التأثير المباشر",
333
+ ).add_to(Danger_Distances_group)
334
+
335
+
336
  # Add a LayerControl to the map to toggle between layers (Satellite View and Default One)
337
  folium.LayerControl().add_to(m)
338