if not os.path.exists("europe_110.geo.json"):
url = "https://github.com/jupyter-widgets/ipyleaflet/raw/master/examples/europe_110.geo.json"
r = requests.get(url)
with open("europe_110.geo.json", "w") as f:
f.write(r.content.decode("utf-8"))
with open("europe_110.geo.json", "r") as f:
data = json.load(f)
data["features"] = [
data["features"][0]
] # Trim to one country so printing layers is readable
m = Map(
center=(40.9964, 19.9851),
zoom=6,
panes={"heatmap_down": {"zIndex": 350}, "heatmap_top": {"zIndex": 650}},
)
geo_json = GeoJSON(
data=data,
style={
"opacity": 1,
"dashArray": "9",
"fillOpacity": 0.9,
"weight": 1,
"fillColor": "white",
},
)
heatmap = Heatmap(
locations=[[41.327, 19.819], [40.73, 19.562]],
radius=5,
blur=1,
min_opacity=1,
)
m.add_layer(heatmap)
m.add_layer(geo_json)