{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import Map, GeoJSON\n", "import json\n", "import os\n", "import requests\n", "\n", "if not os.path.exists(\"europe_110.geo.json\"):\n", " url = \"https://github.com/jupyter-widgets/ipyleaflet/raw/master/examples/europe_110.geo.json\"\n", " r = requests.get(url)\n", " with open(\"europe_110.geo.json\", \"w\") as f:\n", " f.write(r.content.decode(\"utf-8\"))\n", "\n", "with open(\"europe_110.geo.json\", \"r\") as f:\n", " data = json.load(f)\n", "\n", "m = Map(center=(50.6252978589571, 0.34580993652344), zoom=3)\n", "geo_json = GeoJSON(\n", " data=data,\n", " style={\n", " \"color\": \"green\",\n", " \"opacity\": 1,\n", " \"weight\": 1.9,\n", " \"dashArray\": \"9\",\n", " \"fillOpacity\": 0.1,\n", " },\n", ")\n", "m.add(geo_json)\n", "\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import Text, HTML\n", "from ipyleaflet import WidgetControl, GeoJSON\n", "\n", "html1 = HTML(\n", " \"\"\"\n", "