{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import Map, WKTLayer\n", "\n", "m = Map(center=(42.3152960829043, -71.1031627617667), zoom=17)\n", "\n", "wlayer = WKTLayer(path=\"data/test.wkt\", hover_style={\"fillColor\": \"red\"})\n", "m.add(wlayer)\n", "\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wlayer.style = {\n", " \"color\": \"green\",\n", " \"opacity\": 1,\n", " \"weight\": 1.9,\n", " \"dashArray\": \"9\",\n", " \"fillOpacity\": 0.1,\n", "}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Add WKT layer from WKT string\n", "\n", "m = Map(center=(-25.0927734375, 10.689697265625), zoom=4)\n", "\n", "wlayer2 = WKTLayer(\n", " wkt_string=\"POLYGON((10.689697265625 -25.0927734375, 34.595947265625 -20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 -39.1552734375, 10.689697265625 -25.0927734375))\",\n", " style={\n", " \"color\": \"green\",\n", " \"opacity\": 1,\n", " \"weight\": 1.9,\n", " \"dashArray\": \"9\",\n", " \"fillOpacity\": 0.1,\n", " },\n", ")\n", "m.add(wlayer2)\n", "\n", "m" ] } ], "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.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }