Skip to content

Commit db668be

Browse files
authored
Merge pull request #414 from Esri/chun7642/advanced_map_widget_usage_to_fix
fix advanced-map-widget-usage and fix import for carto 2 thanks @CMPeng
2 parents 5e83cff + bb15d6e commit db668be

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

guide/10-mapping-and-visualization/advanced-cartography-part2.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555
"In the example of `map6`, since the two Map Services already carry `renderer` in the service resource, we do not need to further set up this property or so called the `drawingInfo` for them to be displayed. Otherwise, check the example for `map7` to see how you can customize the settings. "
5656
]
5757
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": null,
61+
"metadata": {},
62+
"outputs": [],
63+
"source": [
64+
"from arcgis.features import FeatureLayer"
65+
]
66+
},
5867
{
5968
"cell_type": "code",
6069
"execution_count": 8,

guide/10-mapping-and-visualization/advanced-map-widget-useage.ipynb renamed to guide/10-mapping-and-visualization/advanced-map-widget-usage.ipynb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
"\n",
157157
"You can setup an asyncronous callback using the `on_click()` or `on_draw_end()` to create dynamic, interactive 'apps'. You need to create a callback function like `function_name(map_inst, geometry)`, with `map_inst` being the `MapView` instance, and `geometry` being the geometry instance that the user clicked.\n",
158158
"\n",
159-
"The below example takes a point a user clicks on the map, reverse geocodes from the geometry, and prints out the resultant location."
159+
"The below example takes a point a user clicks on the map, reverse geocodes from the geometry, and prints out the resultant location. Also to note here, you can either create the GIS connection using existing profile, or by simply entering the username and password, e.g. `gis = GIS(\"https://www.arcgis.com\", \"arcgis_python\", \"P@ssword123\")`."
160160
]
161161
},
162162
{
@@ -181,7 +181,7 @@
181181
"source": [
182182
"from arcgis.gis import GIS\n",
183183
"import arcgis.geocoding as geocoding\n",
184-
"gis = GIS()\n",
184+
"gis = GIS(profile = \"your_online_profile\")\n",
185185
"callback_map = gis.map('San Diego convention center, San Diego, CA', 16)\n",
186186
"def find_addr(callback_map, g):\n",
187187
" try:\n",
@@ -495,11 +495,16 @@
495495
"metadata": {},
496496
"outputs": [],
497497
"source": [
498-
"#Use this string unix based file systems\n",
499-
"file_path = \"/Users/username/myHurricaneMap.html\"\n",
500-
"#Use this string for Windows based file systems\n",
501-
"file_path = r\"C:\\Users\\username\\myHurricaneMap.html\"\n",
502-
"visual_var_map.export_to_html(file_path)"
498+
"import os\n",
499+
"\n",
500+
"file_dir = os.path.join(os.getcwd(), 'home')\n",
501+
"if not os.path.isdir(file_dir):\n",
502+
" os.mkdir(file_dir)\n",
503+
" \n",
504+
"file_path = os.path.join(file_dir, 'myHurricaneMap.html')\n",
505+
"\n",
506+
"visual_var_map.export_to_html(file_path)\n",
507+
"print(\"html saved as \" + file_path) # On Windows, path can be 'C:\\Users\\Username\\Documents\\home\\myHurricaneMap.html'"
503508
]
504509
}
505510
],
@@ -519,7 +524,7 @@
519524
"name": "python",
520525
"nbconvert_exporter": "python",
521526
"pygments_lexer": "ipython3",
522-
"version": "3.6.6"
527+
"version": "3.6.8"
523528
}
524529
},
525530
"nbformat": 4,

0 commit comments

Comments
 (0)