{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import Map, AntPath" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m = Map(center=(52, 10), zoom=8)\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ant_paths = []" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "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": {}, "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": {}, "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": {}, "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": {}, "outputs": [], "source": [ "for ant_path in ant_paths:\n", " ant_path.reverse = True" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for ant_path in ant_paths:\n", " ant_path.paused = True" ] } ], "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.8.1" } }, "nbformat": 4, "nbformat_minor": 4 }