{"cells":[{"cell_type":"code","execution_count":43,"metadata":{},"outputs":[],"source":["from arcgis.gis import GIS\n","from arcgis.geometry import Point, Polyline, Polygon\n"]},{"cell_type":"code","execution_count":44,"metadata":{},"outputs":[],"source":["portal = GIS() # anonymously\n","\n","point = Point({\"x\": -118.8066, \"y\": 34.0006, \"z\": 100})\n","\n","point_attributes = {\"name\": \"Point\", \"description\": \"I am a point\"}\n","\n","simple_marker_symbol = {\n"," \"type\": \"esriSMS\",\n"," \"style\": \"esriSMSCircle\",\n"," \"color\": [0, 0, 0],\n"," \"outline\": {\"color\": [255, 255, 255], \"width\": 1},\n","}"]},{"cell_type":"code","execution_count":45,"metadata":{},"outputs":[],"source":["polyline = Polyline(\n"," {\n"," \"paths\": [\n"," [-118.821527826096, 34.0139576938577],\n"," [-118.814893761649, 34.0080602407843],\n"," [-118.808878330345, 34.0016642996246],\n"," ]\n"," }\n",")\n","\n","polyline_attributes = {\"name\": \"Polyline\", \"description\": \"I am a Polyline\"}\n","\n","simple_line_symbol = {\n"," \"type\": \"esriSLS\",\n"," \"style\": \"esriSLSolid\",\n"," \"color\": [255, 155, 128],\n"," \"width\": 2,\n","}\n","\n","\n","simple_fill_symbol = {\n"," \"type\": \"esriSFS\",\n"," \"color\": [50, 100, 200, 125],\n"," \"outline\": {\"color\": [255, 255, 255], \"width\": 1},\n","}"]},{"cell_type":"code","execution_count":46,"metadata":{},"outputs":[],"source":["\n","polygon = Polygon(\n"," {\n"," \"rings\": [\n"," [\n"," [-118.818984489994, 34.0137559967283],\n"," [-118.806796597377, 34.0215816298725],\n"," [-118.791432890735, 34.0163883241613],\n"," [-118.79596686535, 34.008564864635],\n"," [-118.808558110679, 34.0035027131376],\n"," ]\n"," ]\n"," }\n",")\n","\n","polygon_attributes = {\"name\": \"Polygon\", \"description\": \"I am a Polygon\"}\n","\n","simple_fill_symbol = {\n"," \"type\": \"esriSFS\",\n"," \"color\": [50, 100, 200, 125],\n"," \"outline\": {\"color\": [255, 255, 255], \"width\": 1},\n","}"]},{"cell_type":"code","execution_count":47,"metadata":{},"outputs":[{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"a8b3ffec9a3f46ddbef3679dbb102db0","version_major":2,"version_minor":0},"text/plain":["MapView(layout=Layout(height='400px', width='100%'))"]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
"],"text/plain":[""]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
"],"text/plain":[""]},"metadata":{},"output_type":"display_data"}],"source":["map = portal.map()\n","map"]},{"cell_type":"code","execution_count":49,"metadata":{},"outputs":[],"source":["map.draw(\n"," shape=polyline,\n"," symbol=simple_line_symbol,\n"," attributes=polyline_attributes,\n"," popup={\n"," \"title\": polyline_attributes[\"name\"],\n"," \"content\": polyline_attributes[\"description\"],\n"," },\n",")"]},{"cell_type":"code","execution_count":50,"metadata":{},"outputs":[],"source":["map.draw(\n"," shape=polygon,\n"," symbol=simple_fill_symbol,\n"," attributes=polygon_attributes,\n"," popup={\n"," \"title\": polygon_attributes[\"name\"],\n"," \"content\": polygon_attributes[\"description\"],\n"," },\n",")\n"]},{"cell_type":"code","execution_count":51,"metadata":{},"outputs":[],"source":["map.center = [34.0110, -118.8047]\n","map.zoom = 14\n"]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.11"}},"nbformat":4,"nbformat_minor":2}