Skip to content

Commit 3a4e877

Browse files
committed
updates for rendering 3d symbols
1 parent 513fd01 commit 3a4e877

File tree

1 file changed

+136
-50
lines changed

1 file changed

+136
-50
lines changed

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

Lines changed: 136 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,26 @@
6060
},
6161
{
6262
"cell_type": "code",
63-
"execution_count": null,
63+
"execution_count": 1,
6464
"metadata": {},
65-
"outputs": [],
65+
"outputs": [
66+
{
67+
"name": "stdout",
68+
"output_type": "stream",
69+
"text": [
70+
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n",
71+
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n"
72+
]
73+
},
74+
{
75+
"name": "stderr",
76+
"output_type": "stream",
77+
"text": [
78+
"/Users/john3092/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/dask/dataframe/_pyarrow_compat.py:23: UserWarning: You are using pyarrow version 11.0.0 which is known to be insecure. See https://www.cve.org/CVERecord?id=CVE-2023-47248 for further details. Please upgrade to pyarrow>=14.0.1 or install pyarrow-hotfix to patch your current version.\n",
79+
" warnings.warn(\n"
80+
]
81+
}
82+
],
6683
"source": [
6784
"from arcgis.gis import GIS"
6885
]
@@ -374,34 +391,17 @@
374391
},
375392
{
376393
"cell_type": "code",
377-
"execution_count": 1,
394+
"execution_count": 2,
378395
"metadata": {},
379-
"outputs": [
380-
{
381-
"name": "stdout",
382-
"output_type": "stream",
383-
"text": [
384-
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n",
385-
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n"
386-
]
387-
},
388-
{
389-
"name": "stderr",
390-
"output_type": "stream",
391-
"text": [
392-
"/Users/john3092/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/dask/dataframe/_pyarrow_compat.py:23: UserWarning: You are using pyarrow version 11.0.0 which is known to be insecure. See https://www.cve.org/CVERecord?id=CVE-2023-47248 for further details. Please upgrade to pyarrow>=14.0.1 or install pyarrow-hotfix to patch your current version.\n",
393-
" warnings.warn(\n"
394-
]
395-
}
396-
],
396+
"outputs": [],
397397
"source": [
398398
"from arcgis.gis import GIS\n",
399-
"from arcgis.features import FeatureLayer"
399+
"from arcgis.layers import Service"
400400
]
401401
},
402402
{
403403
"cell_type": "code",
404-
"execution_count": 2,
404+
"execution_count": 3,
405405
"metadata": {},
406406
"outputs": [],
407407
"source": [
@@ -410,17 +410,18 @@
410410
},
411411
{
412412
"cell_type": "code",
413-
"execution_count": 3,
413+
"execution_count": 45,
414414
"metadata": {},
415415
"outputs": [],
416416
"source": [
417-
"hurricane_layer = FeatureLayer(\n",
418-
" url=\"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/0\")"
417+
"hurricane_layer = Service(\n",
418+
" url_or_item=\"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/0\"\n",
419+
")"
419420
]
420421
},
421422
{
422423
"cell_type": "code",
423-
"execution_count": 4,
424+
"execution_count": 46,
424425
"metadata": {},
425426
"outputs": [],
426427
"source": [
@@ -429,21 +430,21 @@
429430
},
430431
{
431432
"cell_type": "code",
432-
"execution_count": 5,
433+
"execution_count": 47,
433434
"metadata": {},
434435
"outputs": [
435436
{
436437
"data": {
437438
"application/vnd.jupyter.widget-view+json": {
438-
"model_id": "df34faa68f024e72895a693f94d04f51",
439+
"model_id": "814ae58630a447f2bc1d7a99ede4674c",
439440
"version_major": 2,
440441
"version_minor": 1
441442
},
442443
"text/plain": [
443444
"Map(center=[3716583.6647425774, -4155920.0458218013], extent={'xmin': -8511072.484127043, 'ymin': -835007.2772…"
444445
]
445446
},
446-
"execution_count": 5,
447+
"execution_count": 47,
447448
"metadata": {},
448449
"output_type": "execute_result"
449450
}
@@ -455,7 +456,7 @@
455456
},
456457
{
457458
"cell_type": "code",
458-
"execution_count": 6,
459+
"execution_count": 48,
459460
"metadata": {},
460461
"outputs": [],
461462
"source": [
@@ -471,7 +472,7 @@
471472
},
472473
{
473474
"cell_type": "code",
474-
"execution_count": 7,
475+
"execution_count": 9,
475476
"metadata": {},
476477
"outputs": [],
477478
"source": [
@@ -480,7 +481,7 @@
480481
},
481482
{
482483
"cell_type": "code",
483-
"execution_count": 8,
484+
"execution_count": 10,
484485
"metadata": {},
485486
"outputs": [],
486487
"source": [
@@ -489,7 +490,7 @@
489490
},
490491
{
491492
"cell_type": "code",
492-
"execution_count": 10,
493+
"execution_count": 11,
493494
"metadata": {},
494495
"outputs": [],
495496
"source": [
@@ -498,32 +499,82 @@
498499
},
499500
{
500501
"cell_type": "code",
501-
"execution_count": 11,
502+
"execution_count": 59,
502503
"metadata": {},
503504
"outputs": [],
504505
"source": [
505-
"renderer = renderers.SimpleRenderer(\n",
506-
" symbol=symbols.SimpleMarkerSymbolEsriSMS(\n",
507-
" style=\"esriSMSCircle\", color=[255, 0, 0, 1], size=20\n",
508-
" )\n",
506+
"os3d_layer = symbols.ObjectSymbol3DLayer(\n",
507+
" resource=symbols.ObjectSymbol3DLayerResource(primitive=symbols.Primitive.sphere),\n",
508+
" material=symbols.Material(color=[255,0,0]),\n",
509+
" type=\"Object\",\n",
510+
" width=100\n",
509511
")"
510512
]
511513
},
512514
{
513515
"cell_type": "code",
514-
"execution_count": 13,
516+
"execution_count": 62,
517+
"metadata": {},
518+
"outputs": [],
519+
"source": [
520+
"pt3d_symbol = symbols.PointSymbol3D(\n",
521+
" symbol_layers = [os3d_layer]\n",
522+
")"
523+
]
524+
},
525+
{
526+
"cell_type": "code",
527+
"execution_count": 64,
528+
"metadata": {},
529+
"outputs": [
530+
{
531+
"ename": "ValidationError",
532+
"evalue": "1 validation error for PointSymbol3D\nsymbolLayers\n Field required [type=missing, input_value={'symbol': PointSymbol3D(...'type': 'PointSymbol3D'}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.5/v/missing",
533+
"output_type": "error",
534+
"traceback": [
535+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
536+
"\u001b[0;31mValidationError\u001b[0m Traceback (most recent call last)",
537+
"Cell \u001b[0;32mIn[64], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m pt3d_renderer \u001b[38;5;241m=\u001b[39m renderers\u001b[38;5;241m.\u001b[39mPointSymbol3D(\n\u001b[1;32m 2\u001b[0m symbol\u001b[38;5;241m=\u001b[39mpt3d_symbol,\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mtype\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPointSymbol3D\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 4\u001b[0m )\n",
538+
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/pydantic/main.py:164\u001b[0m, in \u001b[0;36mBaseModel.__init__\u001b[0;34m(__pydantic_self__, **data)\u001b[0m\n\u001b[1;32m 162\u001b[0m \u001b[38;5;66;03m# `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\u001b[39;00m\n\u001b[1;32m 163\u001b[0m __tracebackhide__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m--> 164\u001b[0m __pydantic_self__\u001b[38;5;241m.\u001b[39m__pydantic_validator__\u001b[38;5;241m.\u001b[39mvalidate_python(data, self_instance\u001b[38;5;241m=\u001b[39m__pydantic_self__)\n",
539+
"\u001b[0;31mValidationError\u001b[0m: 1 validation error for PointSymbol3D\nsymbolLayers\n Field required [type=missing, input_value={'symbol': PointSymbol3D(...'type': 'PointSymbol3D'}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.5/v/missing"
540+
]
541+
}
542+
],
543+
"source": [
544+
"pt3d_renderer = renderers.PointSymbol3D(\n",
545+
" symbol=pt3d_symbol,\n",
546+
" type=\"PointSymbol3D\"\n",
547+
")"
548+
]
549+
},
550+
{
551+
"cell_type": "code",
552+
"execution_count": 51,
515553
"metadata": {},
516554
"outputs": [
555+
{
556+
"name": "stderr",
557+
"output_type": "stream",
558+
"text": [
559+
"ERROR:root:Renderer of type PointSymbol3D could not be created. Error: 2 validation errors for SimpleRenderer\n",
560+
"symbol\n",
561+
" Field required [type=missing, input_value={'symbolLayers': [{'ancho...'type': 'PointSymbol3D'}, input_type=dict]\n",
562+
" For further information visit https://errors.pydantic.dev/2.5/v/missing\n",
563+
"type\n",
564+
" Input should be 'simple' [type=literal_error, input_value='PointSymbol3D', input_type=str]\n",
565+
" For further information visit https://errors.pydantic.dev/2.5/v/literal_error\n"
566+
]
567+
},
517568
{
518569
"ename": "ValidationError",
519570
"evalue": "1 validation error for FeatureLayerArcGISFeatureLayer\nlayerDefinition.timeInfo.timeIntervalUnits\n Input should be 'esriTimeUnitsCenturies', 'esriTimeUnitsDays', 'esriTimeUnitsDecades', 'esriTimeUnitsHours', 'esriTimeUnitsMilliseconds', 'esriTimeUnitsMinutes', 'esriTimeUnitsMonths', 'esriTimeUnitsSeconds', 'esriTimeUnitsUnknown', 'esriTimeUnitsWeeks' or 'esriTimeUnitsYears' [type=enum, input_value=<TimeIntervalUnits.esri_t...ys: 'esriTimeUnitsDays'>, input_type=TimeIntervalUnits]",
520571
"output_type": "error",
521572
"traceback": [
522573
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
523574
"\u001b[0;31mValidationError\u001b[0m Traceback (most recent call last)",
524-
"Cell \u001b[0;32mIn[13], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m hurricane_map_3D\u001b[38;5;241m.\u001b[39mcontent\u001b[38;5;241m.\u001b[39madd(\n\u001b[1;32m 2\u001b[0m item\u001b[38;5;241m=\u001b[39mhurricane_layer,\n\u001b[1;32m 3\u001b[0m drawing_info \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 4\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrenderer\u001b[39m\u001b[38;5;124m\"\u001b[39m: renderer\n\u001b[1;32m 5\u001b[0m }\n\u001b[1;32m 6\u001b[0m )\n",
525-
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/arcgis/map/scene_widget.py:1327\u001b[0m, in \u001b[0;36mSceneContent.add\u001b[0;34m(self, item, drawing_info, popup_info, index)\u001b[0m\n\u001b[1;32m 1324\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 1325\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1326\u001b[0m \u001b[38;5;66;03m# Only one layer, create the layer and add\u001b[39;00m\n\u001b[0;32m-> 1327\u001b[0m layer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_helper\u001b[38;5;241m.\u001b[39m_create_layer_from_item(item, drawing_info, popup_info)\n\u001b[1;32m 1328\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlayers\u001b[38;5;241m.\u001b[39minsert(index, item)\n\u001b[1;32m 1330\u001b[0m \u001b[38;5;66;03m# Check that layer is not None at this point\u001b[39;00m\n",
526-
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/arcgis/map/_utils.py:1048\u001b[0m, in \u001b[0;36m_HelperMethods._create_layer_from_item\u001b[0;34m(self, layer, drawing_info, popup_info)\u001b[0m\n\u001b[1;32m 1046\u001b[0m ld \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1047\u001b[0m popup \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_popup_dataclass(layer, popup_info)\n\u001b[0;32m-> 1048\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mspec\u001b[38;5;241m.\u001b[39mFeatureLayerArcGISFeatureLayer(\n\u001b[1;32m 1049\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mproperties,\n\u001b[1;32m 1050\u001b[0m url\u001b[38;5;241m=\u001b[39mlayer\u001b[38;5;241m.\u001b[39m_url,\n\u001b[1;32m 1051\u001b[0m layerDefinition\u001b[38;5;241m=\u001b[39mld,\n\u001b[1;32m 1052\u001b[0m popupInfo\u001b[38;5;241m=\u001b[39mpopup,\n\u001b[1;32m 1053\u001b[0m itemId\u001b[38;5;241m=\u001b[39mitem_id,\n\u001b[1;32m 1054\u001b[0m title\u001b[38;5;241m=\u001b[39mproperties[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 1055\u001b[0m )\n\u001b[1;32m 1056\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(layer, arcgis_layers\u001b[38;5;241m.\u001b[39mVectorTileLayer):\n\u001b[1;32m 1057\u001b[0m style_url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mlayer\u001b[38;5;241m.\u001b[39m_url\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/resources/styles/root.json\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
575+
"Cell \u001b[0;32mIn[51], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m hurricane_map_3D\u001b[38;5;241m.\u001b[39mcontent\u001b[38;5;241m.\u001b[39madd(\n\u001b[1;32m 2\u001b[0m item\u001b[38;5;241m=\u001b[39mhurricane_layer,\n\u001b[1;32m 3\u001b[0m drawing_info\u001b[38;5;241m=\u001b[39m{\n\u001b[1;32m 4\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrenderer\u001b[39m\u001b[38;5;124m\"\u001b[39m: pt3d_renderer\n\u001b[1;32m 5\u001b[0m }\n\u001b[1;32m 6\u001b[0m )\n",
576+
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/arcgis/map/scene_widget.py:920\u001b[0m, in \u001b[0;36mSceneContent.add\u001b[0;34m(self, item, drawing_info, popup_info, index)\u001b[0m\n\u001b[1;32m 917\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 918\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 919\u001b[0m \u001b[38;5;66;03m# Only one layer, create the layer and add\u001b[39;00m\n\u001b[0;32m--> 920\u001b[0m layer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_helper\u001b[38;5;241m.\u001b[39m_create_layer_from_item(item, drawing_info, popup_info)\n\u001b[1;32m 921\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlayers\u001b[38;5;241m.\u001b[39minsert(index, item)\n\u001b[1;32m 923\u001b[0m \u001b[38;5;66;03m# Check that layer is not None at this point\u001b[39;00m\n",
577+
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/arcgis/map/_utils.py:1053\u001b[0m, in \u001b[0;36m_HelperMethods._create_layer_from_item\u001b[0;34m(self, layer, drawing_info, popup_info)\u001b[0m\n\u001b[1;32m 1051\u001b[0m ld \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1052\u001b[0m popup \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_popup_dataclass(layer, popup_info)\n\u001b[0;32m-> 1053\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mspec\u001b[38;5;241m.\u001b[39mFeatureLayerArcGISFeatureLayer(\n\u001b[1;32m 1054\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mproperties,\n\u001b[1;32m 1055\u001b[0m url\u001b[38;5;241m=\u001b[39mlayer\u001b[38;5;241m.\u001b[39m_url,\n\u001b[1;32m 1056\u001b[0m layerDefinition\u001b[38;5;241m=\u001b[39mld,\n\u001b[1;32m 1057\u001b[0m popupInfo\u001b[38;5;241m=\u001b[39mpopup,\n\u001b[1;32m 1058\u001b[0m itemId\u001b[38;5;241m=\u001b[39mitem_id,\n\u001b[1;32m 1059\u001b[0m title\u001b[38;5;241m=\u001b[39mproperties[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 1060\u001b[0m )\n\u001b[1;32m 1061\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(layer, arcgis_layers\u001b[38;5;241m.\u001b[39mVectorTileLayer):\n\u001b[1;32m 1062\u001b[0m style_url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mlayer\u001b[38;5;241m.\u001b[39m_url\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/resources/styles/root.json\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
527578
"File \u001b[0;32m~/opt/anaconda3/envs/geosaurus_dev_env/lib/python3.11/site-packages/pydantic/main.py:164\u001b[0m, in \u001b[0;36mBaseModel.__init__\u001b[0;34m(__pydantic_self__, **data)\u001b[0m\n\u001b[1;32m 162\u001b[0m \u001b[38;5;66;03m# `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\u001b[39;00m\n\u001b[1;32m 163\u001b[0m __tracebackhide__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m--> 164\u001b[0m __pydantic_self__\u001b[38;5;241m.\u001b[39m__pydantic_validator__\u001b[38;5;241m.\u001b[39mvalidate_python(data, self_instance\u001b[38;5;241m=\u001b[39m__pydantic_self__)\n",
528579
"\u001b[0;31mValidationError\u001b[0m: 1 validation error for FeatureLayerArcGISFeatureLayer\nlayerDefinition.timeInfo.timeIntervalUnits\n Input should be 'esriTimeUnitsCenturies', 'esriTimeUnitsDays', 'esriTimeUnitsDecades', 'esriTimeUnitsHours', 'esriTimeUnitsMilliseconds', 'esriTimeUnitsMinutes', 'esriTimeUnitsMonths', 'esriTimeUnitsSeconds', 'esriTimeUnitsUnknown', 'esriTimeUnitsWeeks' or 'esriTimeUnitsYears' [type=enum, input_value=<TimeIntervalUnits.esri_t...ys: 'esriTimeUnitsDays'>, input_type=TimeIntervalUnits]"
529580
]
@@ -532,12 +583,37 @@
532583
"source": [
533584
"hurricane_map_3D.content.add(\n",
534585
" item=hurricane_layer,\n",
535-
" drawing_info = {\n",
536-
" \"renderer\": renderer\n",
586+
" drawing_info={\n",
587+
" \"renderer\": pt3d_renderer\n",
537588
" }\n",
538589
")"
539590
]
540591
},
592+
{
593+
"cell_type": "code",
594+
"execution_count": 52,
595+
"metadata": {},
596+
"outputs": [
597+
{
598+
"data": {
599+
"application/vnd.jupyter.widget-view+json": {
600+
"model_id": "81ec8d571d1443c19a7a73503d3d98e4",
601+
"version_major": 2,
602+
"version_minor": 1
603+
},
604+
"text/plain": [
605+
"Scene(camera={'heading': 0.0, 'position': {'spatialReference': {'latestWkid': 3857, 'wkid': 102100}, 'x': -415…"
606+
]
607+
},
608+
"execution_count": 52,
609+
"metadata": {},
610+
"output_type": "execute_result"
611+
}
612+
],
613+
"source": [
614+
"hurricane_map_3D"
615+
]
616+
},
541617
{
542618
"cell_type": "markdown",
543619
"metadata": {},
@@ -603,7 +679,7 @@
603679
"cell_type": "markdown",
604680
"metadata": {},
605681
"source": [
606-
"Another new feature in 1.5.0 is the ability to export the current widget as a standalone HTML file. This added functionality provides a new workflow for creating standalone HTML maps that can be shared with anyone: all they need is a web browser!\n",
682+
"You als have the ability to export the current widget as a standalone HTML file. This added functionality provides a workflow for creating standalone HTML maps that can be shared with anyone: all they need is a web browser!\n",
607683
"\n",
608684
"The below cell will write the current widget to the file specified by a string path. Run the cell, find the file on your disk, and open it in your favorite web browser.\n",
609685
"\n",
@@ -612,19 +688,29 @@
612688
},
613689
{
614690
"cell_type": "code",
615-
"execution_count": null,
691+
"execution_count": 66,
616692
"metadata": {},
617-
"outputs": [],
693+
"outputs": [
694+
{
695+
"name": "stdout",
696+
"output_type": "stream",
697+
"text": [
698+
"html saved as /Users/john3092/Job/data_formats/html_pages/myHurricaneMap.html\n"
699+
]
700+
}
701+
],
618702
"source": [
619703
"import os\n",
620704
"\n",
621-
"file_dir = os.path.join(os.getcwd(), 'home')\n",
705+
"file_dir = r\"/Users/john3092/Job/data_formats/html_pages\"\n",
622706
"if not os.path.isdir(file_dir):\n",
623707
" os.mkdir(file_dir)\n",
624708
" \n",
625709
"file_path = os.path.join(file_dir, 'myHurricaneMap.html')\n",
626710
"\n",
627-
"visual_var_map.export_to_html(file_path)\n",
711+
"hurricane_map.export_to_html(\n",
712+
" path_to_file=file_path\n",
713+
")\n",
628714
"print(\"html saved as \" + file_path) # On Windows, path can be 'C:\\Users\\Username\\Documents\\home\\myHurricaneMap.html'"
629715
]
630716
}

0 commit comments

Comments
 (0)