ybendou commited on
Commit
cae56d6
1 Parent(s): b7ee608

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -6
app.py CHANGED
@@ -239,19 +239,33 @@ m = leafmap.Map(
239
  )
240
 
241
  # Add a search bar to the map
242
- m.add_control(leafmap.GeocoderControl(position="topright", placeholder="Search | البحث"))
 
 
 
 
243
 
244
  # Add Fullscreen button to the map
245
- m.add_control(leafmap.FullscreenControl())
 
 
 
 
 
246
 
247
  #Satellite View from Mapbox
248
  tileurl = 'https://api.mapbox.com/styles/v1/phd2020/clmer2mra01d001pbgjkictpt/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoicGhkMjAyMCIsImEiOiJja29lZzFwZmUwNHkzMm5wMjZnYjVvcGltIn0.tE0ritrelQOyLdKUH6hgOw'
249
 
250
- # Add the Satellite View layer
251
- m.add_tile_layer(tileurl, name="Satellite View | عرض القمر الصناعي", attribution="Satellite View")
 
 
 
 
 
252
 
253
- # Add Layer Control (This is added by default in leafmap, but if you need to customize you can add it manually)
254
- m.add_control(leafmap.LayerControl(position="topright"))
255
 
256
  if show_interventions:
257
  for index, row in interventions_df.iterrows():
 
239
  )
240
 
241
  # Add a search bar to the map
242
+ plugins.Geocoder(
243
+ collapsed=False,
244
+ position="topright",
245
+ placeholder="Search | البحث",
246
+ ).add_to(m)
247
 
248
  # Add Fullscreen button to the map
249
+ plugins.Fullscreen(
250
+ position='topright',
251
+ title='Expand me | تكبير الخريطة',
252
+ title_cancel='Exit me | تصغير الخريطة',
253
+ force_separate_button=True
254
+ ).add_to(m)
255
 
256
  #Satellite View from Mapbox
257
  tileurl = 'https://api.mapbox.com/styles/v1/phd2020/clmer2mra01d001pbgjkictpt/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoicGhkMjAyMCIsImEiOiJja29lZzFwZmUwNHkzMm5wMjZnYjVvcGltIn0.tE0ritrelQOyLdKUH6hgOw'
258
 
259
+ folium.TileLayer(
260
+ tiles = tileurl,
261
+ attr = 'Satellite View',
262
+ name = 'Satellite View | عرض القمر الصناعي',
263
+ overlay = False,
264
+ control = True
265
+ ).add_to(m)
266
 
267
+ # Add a LayerControl to the map to toggle between layers (Satellite View and Default One)
268
+ folium.LayerControl().add_to(m)
269
 
270
  if show_interventions:
271
  for index, row in interventions_df.iterrows():