{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [ "parameters" ] }, "outputs": [], "source": [ "flex_author = \"built using jupyter-flex\"\n", "flex_source_link = \"https://github.com/danielfrg/jupyter-flex/blob/master/examples/widgets/ipyleaflet.ipynb\"\n", "flex_include_source = True" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Map" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "from ipyleaflet import Map, Marker" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [ "body" ] }, "outputs": [], "source": [ "center = (52.204793, 360.121558)\n", "\n", "Map(center=center, zoom=15)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Ant Paths" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ant paths" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "from ipyleaflet import Map, AntPath" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "m = Map(center=(52, 10), zoom=8)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths = []" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths.append(AntPath(\n", " locations=[[51.5, 8], [52.5, 12.1]],\n", " use = 'polyline'\n", "))\n", "m += ant_paths[-1]" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths.append(AntPath(\n", " locations=[[52, 8], [52.5, 8], [52.3, 9]],\n", " use='polygon',\n", " dash_array=[50, 100],\n", " weight=10,\n", " color='red'\n", "))\n", "m += ant_paths[-1]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths.append(AntPath(\n", " locations=[[51.5, 11], [52, 12]],\n", " use='rectangle',\n", " dash_array=[10, 20],\n", " weight=5,\n", " color='white',\n", " pulse_color='green'\n", "))\n", "m += ant_paths[-1]" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths.append(AntPath(\n", " locations=[51.5, 10],\n", " radius=15000,\n", " use='circle',\n", " dash_array=[5, 10],\n", " weight=5,\n", " color=\"magenta\"\n", "))\n", "m += ant_paths[-1]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "tags": [ "body" ] }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9a2126d030364e05be70971ccf4b3397", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map(center=[52, 10], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_tex…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "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.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }