Skip to content

Commit

Permalink
Fix folium split map bug (gee-community#2079)
Browse files Browse the repository at this point in the history
* Fix folium split map bug

* Fix typos in the SatMOC workshop notebook
  • Loading branch information
giswqs authored Jul 17, 2024
1 parent 388d98c commit 5a534a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions docs/workshops/SatMOC_2024.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,9 @@
"outputs": [],
"source": [
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"pdsi_col = ee.ImageCollection(\"USGS/NLCD_RELEASES/2019_REL/NLCD\").select(\"landcover\")\n",
"collection = ee.ImageCollection(\"USGS/NLCD_RELEASES/2019_REL/NLCD\").select(\"landcover\")\n",
"vis_params = {\"bands\": [\"landcover\"]}\n",
"years = pdsi_col.aggregate_array(\"system:index\").getInfo()\n",
"years = collection.aggregate_array(\"system:index\").getInfo()\n",
"years"
]
},
Expand All @@ -1133,8 +1133,8 @@
"outputs": [],
"source": [
"m.ts_inspector(\n",
" left_ts=pdsi_col,\n",
" right_ts=pdsi_col,\n",
" left_ts=collection,\n",
" right_ts=collection,\n",
" left_names=years,\n",
" right_names=years,\n",
" left_vis=vis_params,\n",
Expand Down Expand Up @@ -1232,15 +1232,15 @@
"source": [
"m = geemap.Map(center=[37.75, -122.45], zoom=12)\n",
"\n",
"pdsi_col = (\n",
"collection = (\n",
" ee.ImageCollection(\"COPERNICUS/S2_SR\")\n",
" .filterBounds(ee.Geometry.Point([-122.45, 37.75]))\n",
" .filterMetadata(\"CLOUDY_PIXEL_PERCENTAGE\", \"less_than\", 10)\n",
")\n",
"\n",
"vis_params = {\"min\": 0, \"max\": 4000, \"bands\": [\"B8\", \"B4\", \"B3\"]}\n",
"\n",
"m.add_time_slider(pdsi_col, vis_params)\n",
"m.add_time_slider(collection, vis_params)\n",
"m"
]
},
Expand Down
4 changes: 3 additions & 1 deletion geemap/foliumap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,9 @@ def split_map(
f"right_layer must be one of the following: {', '.join(basemaps.keys())} or a string url to a tif file."
)

control = SideBySideLayers(layer_left=left_layer, layer_right=right_layer)
control = folium.plugins.SideBySideLayers(
layer_left=left_layer, layer_right=right_layer
)
left_layer.add_to(self)
right_layer.add_to(self)
control.add_to(self)
Expand Down

0 comments on commit 5a534a7

Please sign in to comment.