giswqs commited on
Commit
58c100e
·
verified ·
1 Parent(s): ee6b081

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -16
app.py CHANGED
@@ -1,13 +1,10 @@
1
- import ee
2
- import geemap
3
  from shiny import reactive
4
  from shiny.express import input, ui
5
  from shinywidgets import output_widget, render_widget
6
  from faicons import icon_svg
7
  import ipyleaflet
8
 
9
- geemap.ee_initialize(service_account=True)
10
-
11
  city_centers = {
12
  "London": (51.5074, 0.1278),
13
  "Paris": (48.8566, 2.3522),
@@ -20,18 +17,6 @@ ui.input_select("center", "Center", choices=list(city_centers.keys()))
20
  def map():
21
  m = ipyleaflet.Map(zoom=4, scroll_wheel_zoom=True)
22
  m.layout.height = "800px"
23
- dem = ee.Image("USGS/SRTMGL1_003")
24
- vis_params = {
25
- "min": 0,
26
- "max": 4000,
27
- "palette": ["006633", "E5FFCC", "662A00", "D8D8D8", "F5F5F5"],
28
- }
29
- tile = geemap.ee_tile_layer(dem, vis_params, "SRTM DEM")
30
- url = tile.url
31
- layer = ipyleaflet.TileLayer(url=url, attribution="Google", name="DEM")
32
- m.add(layer)
33
- m.add(ipyleaflet.FullScreenControl())
34
- m.add(ipyleaflet.LayersControl(position='topright'))
35
  return m
36
 
37
  @reactive.effect
 
1
+ import leafmap
 
2
  from shiny import reactive
3
  from shiny.express import input, ui
4
  from shinywidgets import output_widget, render_widget
5
  from faicons import icon_svg
6
  import ipyleaflet
7
 
 
 
8
  city_centers = {
9
  "London": (51.5074, 0.1278),
10
  "Paris": (48.8566, 2.3522),
 
17
  def map():
18
  m = ipyleaflet.Map(zoom=4, scroll_wheel_zoom=True)
19
  m.layout.height = "800px"
 
 
 
 
 
 
 
 
 
 
 
 
20
  return m
21
 
22
  @reactive.effect