{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m = Map(center=(43.0327, 6.0232), zoom=9, basemap=basemaps.Hydda.Full)\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "measure = MeasureControl(\n", " position='bottomleft', \n", " active_color = 'orange', \n", " primary_length_unit = 'kilometers'\n", ")\n", "m.add_control(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", "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.6.4" } }, "nbformat": 4, "nbformat_minor": 2 }