{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "parameters" ] }, "outputs": [], "source": [ "flex_subtitle = \"built using jupyter-flex\"\n", "flex_external_link = \"https://github.com/danielfrg/jupyter-flex/blob/master/examples/widgets/ipyleaflet.ipynb\"\n", "\n", "flex_show_source = True" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Map" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "from ipyleaflet import Map, Marker" ] }, { "cell_type": "code", "execution_count": null, "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": null, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "from ipyleaflet import Map, AntPath" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "m = Map(center=(52, 10), zoom=8)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "source" ] }, "outputs": [], "source": [ "ant_paths = []" ] }, { "cell_type": "code", "execution_count": null, "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": null, "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": null, "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": null, "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": null, "metadata": { "tags": [ "body" ] }, "outputs": [], "source": [ "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }