{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ade868b12827419cbca15d69f1d557fe", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map(center=[43.0327, 6.0232], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoo…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m = Map(center=(43.0327, 6.0232), zoom=9, basemap=basemaps.OpenStreetMap.Mapnik)\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "measure = MeasureControl(\n", " position=\"bottomleft\", active_color=\"orange\", primary_length_unit=\"kilometers\"\n", ")\n", "m.add(measure)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "measure.completed_color = \"red\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "measure.add_length_unit(\"yards\", 1.09361, 4)\n", "measure.secondary_length_unit = \"yards\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "measure.add_area_unit(\"sqyards\", 1.19599, 4)\n", "measure.secondary_area_unit = \"sqyards\"" ] } ], "metadata": { "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.10.5" } }, "nbformat": 4, "nbformat_minor": 4 }