{ "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(data=data, style = {'color': 'green', 'opacity':1, 'weight':1.9, 'dashArray':'9', 'fillOpacity':0.1})\n", "m.add_layer(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", "