Skip to content

Commit b511355

Browse files
authored
Merge pull request #2132 from Esri/NA/guides_12
Sample Overwrite FL
2 parents af4c7e7 + 33cb659 commit b511355

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

samples/05_content_publishers/overwriting_feature_layers.ipynb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@
329329
],
330330
"source": [
331331
"# add the csv as an item\n",
332-
"item_prop = {'title':'USA Capitals spreadsheet_' + str(now)}\n",
333-
"csv_item = gis.content.add(item_properties=item_prop, data=my_csv)\n",
332+
"item_prop = {'title':'USA Capitals spreadsheet_' + str(now), \"type\": \"CSV\"}\n",
333+
"root_folder = gis.content.folders.get()\n",
334+
"csv_item = root_folder.add(item_properties=item_prop, file=my_csv).result()\n",
334335
"csv_item"
335336
]
336337
},
@@ -474,7 +475,7 @@
474475
"metadata": {},
475476
"outputs": [],
476477
"source": [
477-
"map1.add_layer(cities_item)"
478+
"map1.content.add(cities_item)"
478479
]
479480
},
480481
{
@@ -905,7 +906,10 @@
905906
{
906907
"cell_type": "markdown",
907908
"metadata": {
908-
"collapsed": true
909+
"collapsed": true,
910+
"jupyter": {
911+
"outputs_hidden": true
912+
}
909913
},
910914
"source": [
911915
"### Access the overwritten feature layer\n",
@@ -978,7 +982,7 @@
978982
"metadata": {},
979983
"outputs": [],
980984
"source": [
981-
"map2.add_layer(cities_item)"
985+
"map2.content.add(cities_item)"
982986
]
983987
},
984988
{
@@ -1018,7 +1022,7 @@
10181022
"name": "python",
10191023
"nbconvert_exporter": "python",
10201024
"pygments_lexer": "ipython3",
1021-
"version": "3.9.18"
1025+
"version": "3.11.0"
10221026
},
10231027
"toc": {
10241028
"base_numbering": 1,
@@ -1035,5 +1039,5 @@
10351039
}
10361040
},
10371041
"nbformat": 4,
1038-
"nbformat_minor": 1
1042+
"nbformat_minor": 4
10391043
}

0 commit comments

Comments
 (0)