Skip to content

Commit

Permalink
Redesigned the eefolium module
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Mar 18, 2020
1 parent 85cde0b commit a418a77
Show file tree
Hide file tree
Showing 7 changed files with 701 additions and 520 deletions.
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ Launch an interactive notebook with **mybinder.org** or **binder.pangeo.io**. No
import ee
import geemap
import ipyleaflet
try:
ee.Initialize()
Expand All @@ -168,8 +167,7 @@ Launch an interactive notebook with **mybinder.org** or **binder.pangeo.io**. No
ee.Initialize()
# Create an interactive map
Map = ipyleaflet.Map(center=(40, -100), zoom=4, scroll_wheel_zoom=True)
Map.setOptions('HYBRID') # Add Google Satellite basemap
Map = geemap.Map(center=(40, -100), zoom=4)
Map
# Add Earth Engine dataset
Expand All @@ -188,7 +186,7 @@ Launch an interactive notebook with **mybinder.org** or **binder.pangeo.io**. No
print('Mount Everest elevation (m):', elev)
# Add Earth Engine layers to Map
Map.addLayer(image, vis_params, 'STRM DEM', True, 0.5)
Map.addLayer(image, vis_params, 'SRTM DEM', True, 0.5)
Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')
# Set center of the map
Expand Down
2 changes: 1 addition & 1 deletion examples/geemap_and_earthengine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"print('Mount Everest elevation (m):', elev)\n",
"\n",
"# Add Earth Engine layers to Map\n",
"Map.addLayer(image, vis_params, 'STRM DEM', True, 0.5)\n",
"Map.addLayer(image, vis_params, 'SRTM DEM', True, 0.5)\n",
"Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')"
]
},
Expand Down
277 changes: 277 additions & 0 deletions examples/geemap_and_folium.ipynb

Large diffs are not rendered by default.

210 changes: 26 additions & 184 deletions examples/template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -61,24 +61,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d432f861e997427d88b6dc8e011d2e05",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"Map = geemap.Map(center=(40, -100), zoom=4)\n",
"Map.add_minimap()\n",
Expand All @@ -94,17 +79,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mount Everest elevation (m): 8729\n"
]
}
],
"outputs": [],
"source": [
"# Add Earth Engine dataset\n",
"image = ee.Image('USGS/SRTMGL1_003')\n",
Expand All @@ -121,7 +98,7 @@
"print('Mount Everest elevation (m):', elev)\n",
"\n",
"# Add Earth Eninge layers to Map\n",
"Map.addLayer(image, vis_params, 'STRM DEM', True, 0.5)\n",
"Map.addLayer(image, vis_params, 'SRTM DEM', True, 0.5)\n",
"Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')"
]
},
Expand All @@ -134,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -143,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -159,7 +136,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -178,7 +155,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -188,7 +165,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -205,38 +182,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "41bb8104f8e54487b10eb1e567019d02",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='')"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2e17ff03895d40a78777e9045aa611e8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"import geemap\n",
"from ipywidgets import Label\n",
Expand Down Expand Up @@ -264,17 +212,9 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[]\n"
]
}
],
"outputs": [],
"source": [
"print(coordinates)"
]
Expand All @@ -288,52 +228,9 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4703c3eaf07d4321863203f4a49156a4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='')"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "be49558f54a54fc3b5340517a6f443ba",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='')"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "55a4c8dee7704a1587fd3f8b03b80124",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"import geemap\n",
"from ipywidgets import Label\n",
Expand Down Expand Up @@ -383,24 +280,9 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c08fbe8cbe654f80836ea8f443b5067c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"import geemap\n",
"Map = geemap.Map(center=(40, -100), zoom=4)\n",
Expand All @@ -410,44 +292,19 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[32.64978208022306, -102.29463024938005]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Get the last mouse clicked coordinates\n",
"Map.last_click"
]
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[36.35743955276214, -94.69986946975129],\n",
" [41.600040006763805, -113.72263657849396],\n",
" [48.18897902934712, -100.80019865249591],\n",
" [32.64978208022306, -102.29463024938005]]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Get all the mouse clicked coordinates\n",
"Map.all_clicks"
Expand All @@ -462,24 +319,9 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cb0cc5381a5d492084653524386491c4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[47.5, -101], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"from ipyleaflet import *\n",
"\n",
Expand Down

0 comments on commit a418a77

Please sign in to comment.