776 lines
34 KiB
Plaintext
776 lines
34 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "737a2a07-5247-42d5-b06a-ff6a3bf21306",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import folium"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "dc86d298-4a92-41e2-8e9a-bcb2dd36d80f",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"[LatLon](https://www.latlong.net/)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"id": "dbed7e42-d95e-4b25-91b8-248cd95f22ea",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n",
|
|
"<html>\n",
|
|
"<head>\n",
|
|
" \n",
|
|
" <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n",
|
|
" \n",
|
|
" <script>\n",
|
|
" L_NO_TOUCH = false;\n",
|
|
" L_DISABLE_3D = false;\n",
|
|
" </script>\n",
|
|
" \n",
|
|
" <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n",
|
|
" <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n",
|
|
" <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n",
|
|
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
|
" \n",
|
|
" <meta name="viewport" content="width=device-width,\n",
|
|
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
|
" <style>\n",
|
|
" #map_a13b829e83c68c3c32513de721380294 {\n",
|
|
" position: relative;\n",
|
|
" width: 100.0%;\n",
|
|
" height: 100.0%;\n",
|
|
" left: 0.0%;\n",
|
|
" top: 0.0%;\n",
|
|
" }\n",
|
|
" .leaflet-container { font-size: 1rem; }\n",
|
|
" </style>\n",
|
|
" \n",
|
|
"</head>\n",
|
|
"<body>\n",
|
|
" \n",
|
|
" \n",
|
|
" <div class="folium-map" id="map_a13b829e83c68c3c32513de721380294" ></div>\n",
|
|
" \n",
|
|
"</body>\n",
|
|
"<script>\n",
|
|
" \n",
|
|
" \n",
|
|
" var map_a13b829e83c68c3c32513de721380294 = L.map(\n",
|
|
" "map_a13b829e83c68c3c32513de721380294",\n",
|
|
" {\n",
|
|
" center: [52.26415, 10.52642],\n",
|
|
" crs: L.CRS.EPSG3857,\n",
|
|
" zoom: 13,\n",
|
|
" zoomControl: true,\n",
|
|
" preferCanvas: false,\n",
|
|
" }\n",
|
|
" );\n",
|
|
"\n",
|
|
" \n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var tile_layer_02355d3480b09e865d3b0170663f84be = L.tileLayer(\n",
|
|
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
|
" {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n",
|
|
" );\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
"</script>\n",
|
|
"</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
|
|
],
|
|
"text/plain": [
|
|
"<folium.folium.Map at 0x7f1b09d27800>"
|
|
]
|
|
},
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"m = folium.Map(\n",
|
|
" location=(52.264150, 10.526420),\n",
|
|
" tiles='OpenStreetMap',\n",
|
|
" #iles='Stamen Toner',\n",
|
|
" zoom_start=13,\n",
|
|
" prefer_canvas=False\n",
|
|
" )\n",
|
|
"\n",
|
|
"m"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"id": "2b08e2f2-cf81-439b-b47f-733e123d72d3",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n",
|
|
"<html>\n",
|
|
"<head>\n",
|
|
" \n",
|
|
" <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n",
|
|
" \n",
|
|
" <script>\n",
|
|
" L_NO_TOUCH = false;\n",
|
|
" L_DISABLE_3D = false;\n",
|
|
" </script>\n",
|
|
" \n",
|
|
" <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n",
|
|
" <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n",
|
|
" <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n",
|
|
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
|
" \n",
|
|
" <meta name="viewport" content="width=device-width,\n",
|
|
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
|
" <style>\n",
|
|
" #map_a13b829e83c68c3c32513de721380294 {\n",
|
|
" position: relative;\n",
|
|
" width: 100.0%;\n",
|
|
" height: 100.0%;\n",
|
|
" left: 0.0%;\n",
|
|
" top: 0.0%;\n",
|
|
" }\n",
|
|
" .leaflet-container { font-size: 1rem; }\n",
|
|
" </style>\n",
|
|
" \n",
|
|
"</head>\n",
|
|
"<body>\n",
|
|
" \n",
|
|
" \n",
|
|
" <div class="folium-map" id="map_a13b829e83c68c3c32513de721380294" ></div>\n",
|
|
" \n",
|
|
"</body>\n",
|
|
"<script>\n",
|
|
" \n",
|
|
" \n",
|
|
" var map_a13b829e83c68c3c32513de721380294 = L.map(\n",
|
|
" "map_a13b829e83c68c3c32513de721380294",\n",
|
|
" {\n",
|
|
" center: [52.26415, 10.52642],\n",
|
|
" crs: L.CRS.EPSG3857,\n",
|
|
" zoom: 13,\n",
|
|
" zoomControl: true,\n",
|
|
" preferCanvas: false,\n",
|
|
" }\n",
|
|
" );\n",
|
|
"\n",
|
|
" \n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var tile_layer_02355d3480b09e865d3b0170663f84be = L.tileLayer(\n",
|
|
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
|
" {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n",
|
|
" );\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_bb3c68b9bebcd1b6a40283e5539c4a65 = L.marker(\n",
|
|
" [52.25802230834961, 10.503097534179688],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
"</script>\n",
|
|
"</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
|
|
],
|
|
"text/plain": [
|
|
"<folium.folium.Map at 0x7f1b09d27800>"
|
|
]
|
|
},
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"my_marker = folium.Marker(\n",
|
|
" location=(52.25802230834961, 10.503097534179688)\n",
|
|
" )\n",
|
|
"\n",
|
|
"my_marker.add_to(m)\n",
|
|
"\n",
|
|
"m"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"id": "71dbf9b1-2217-40d5-bfa1-c38b2bbc6362",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n",
|
|
"<html>\n",
|
|
"<head>\n",
|
|
" \n",
|
|
" <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n",
|
|
" \n",
|
|
" <script>\n",
|
|
" L_NO_TOUCH = false;\n",
|
|
" L_DISABLE_3D = false;\n",
|
|
" </script>\n",
|
|
" \n",
|
|
" <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n",
|
|
" <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n",
|
|
" <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n",
|
|
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
|
" \n",
|
|
" <meta name="viewport" content="width=device-width,\n",
|
|
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
|
" <style>\n",
|
|
" #map_a13b829e83c68c3c32513de721380294 {\n",
|
|
" position: relative;\n",
|
|
" width: 100.0%;\n",
|
|
" height: 100.0%;\n",
|
|
" left: 0.0%;\n",
|
|
" top: 0.0%;\n",
|
|
" }\n",
|
|
" .leaflet-container { font-size: 1rem; }\n",
|
|
" </style>\n",
|
|
" \n",
|
|
"</head>\n",
|
|
"<body>\n",
|
|
" \n",
|
|
" \n",
|
|
" <div class="folium-map" id="map_a13b829e83c68c3c32513de721380294" ></div>\n",
|
|
" \n",
|
|
"</body>\n",
|
|
"<script>\n",
|
|
" \n",
|
|
" \n",
|
|
" var map_a13b829e83c68c3c32513de721380294 = L.map(\n",
|
|
" "map_a13b829e83c68c3c32513de721380294",\n",
|
|
" {\n",
|
|
" center: [52.26415, 10.52642],\n",
|
|
" crs: L.CRS.EPSG3857,\n",
|
|
" zoom: 13,\n",
|
|
" zoomControl: true,\n",
|
|
" preferCanvas: false,\n",
|
|
" }\n",
|
|
" );\n",
|
|
"\n",
|
|
" \n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var tile_layer_02355d3480b09e865d3b0170663f84be = L.tileLayer(\n",
|
|
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
|
" {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n",
|
|
" );\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_bb3c68b9bebcd1b6a40283e5539c4a65 = L.marker(\n",
|
|
" [52.25802230834961, 10.503097534179688],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_000f18e3236d0891346fe69072792733 = L.marker(\n",
|
|
" [52.2643, 10.529],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var popup_5b808f3e85452abf52b15eb63a9ae438 = L.popup({"maxWidth": "100%"});\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var html_88b86a507c4a59c87877cd9741f3d564 = $(`<div id="html_88b86a507c4a59c87877cd9741f3d564" style="width: 100.0%; height: 100.0%;">Ritterbrunnen 1, 38100 Braunschweig</div>`)[0];\n",
|
|
" popup_5b808f3e85452abf52b15eb63a9ae438.setContent(html_88b86a507c4a59c87877cd9741f3d564);\n",
|
|
" \n",
|
|
" \n",
|
|
"\n",
|
|
" marker_000f18e3236d0891346fe69072792733.bindPopup(popup_5b808f3e85452abf52b15eb63a9ae438)\n",
|
|
" ;\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" \n",
|
|
" marker_000f18e3236d0891346fe69072792733.bindTooltip(\n",
|
|
" `<div>\n",
|
|
" More about the castle\n",
|
|
" </div>`,\n",
|
|
" {"sticky": true}\n",
|
|
" );\n",
|
|
" \n",
|
|
"</script>\n",
|
|
"</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
|
|
],
|
|
"text/plain": [
|
|
"<folium.folium.Map at 0x7f1b09d27800>"
|
|
]
|
|
},
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"castle_popup = \"Ritterbrunnen 1, 38100 Braunschweig\"\n",
|
|
"castle_tooltip = \"More about the castle\"\n",
|
|
"\n",
|
|
"\n",
|
|
"castle_marker = folium.Marker(\n",
|
|
" location=(52.2643, 10.529),\n",
|
|
" popup=castle_popup,\n",
|
|
" tooltip=castle_tooltip\n",
|
|
" )\n",
|
|
"castle_marker.add_to(m)\n",
|
|
"\n",
|
|
"m"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"id": "60c6bc4b-c339-4cd5-806d-66c879807b6e",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"hbk_popup_html = folium.Popup(\n",
|
|
" '''\n",
|
|
" <p>\n",
|
|
" <img \n",
|
|
" src=\"https://www.hbk-bs.de/fileadmin/_processed_/5/1/csm_HBK_Logo_9f3f898a2b.png\"\n",
|
|
" alt=\"HBK BS Logo\">\n",
|
|
" </p>\n",
|
|
" <p><strong>Johannes-Selenka-Platz 1</strong></p>\n",
|
|
" <p><em>38118 Braunschweig</em></p>\n",
|
|
" <p><small>Germany, DE</small></p>\n",
|
|
" <p>Visit: <a href=\"https://www.hbk-bs.de/\">hbk-bs.de</a> </p>\n",
|
|
" ''',\n",
|
|
" show=False\n",
|
|
" )\n",
|
|
"\n",
|
|
"hbk_tooltip = \"More about the university\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"id": "19123dd9-c88d-4713-ab84-4cc692e3f663",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"hbk_icon = folium.Icon(\n",
|
|
" color='black',\n",
|
|
" icon_color='#deddda',\n",
|
|
" prefix='glyphicon',\n",
|
|
" icon='glyphicon-home',\n",
|
|
" angle=0\n",
|
|
" )"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"id": "7f496828-e49a-4253-98e3-aaa59d0cdc1c",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n",
|
|
"<html>\n",
|
|
"<head>\n",
|
|
" \n",
|
|
" <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n",
|
|
" \n",
|
|
" <script>\n",
|
|
" L_NO_TOUCH = false;\n",
|
|
" L_DISABLE_3D = false;\n",
|
|
" </script>\n",
|
|
" \n",
|
|
" <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n",
|
|
" <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>\n",
|
|
" <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>\n",
|
|
" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>\n",
|
|
" <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n",
|
|
" <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n",
|
|
" \n",
|
|
" <meta name="viewport" content="width=device-width,\n",
|
|
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n",
|
|
" <style>\n",
|
|
" #map_a13b829e83c68c3c32513de721380294 {\n",
|
|
" position: relative;\n",
|
|
" width: 100.0%;\n",
|
|
" height: 100.0%;\n",
|
|
" left: 0.0%;\n",
|
|
" top: 0.0%;\n",
|
|
" }\n",
|
|
" .leaflet-container { font-size: 1rem; }\n",
|
|
" </style>\n",
|
|
" \n",
|
|
"</head>\n",
|
|
"<body>\n",
|
|
" \n",
|
|
" \n",
|
|
" <div class="folium-map" id="map_a13b829e83c68c3c32513de721380294" ></div>\n",
|
|
" \n",
|
|
"</body>\n",
|
|
"<script>\n",
|
|
" \n",
|
|
" \n",
|
|
" var map_a13b829e83c68c3c32513de721380294 = L.map(\n",
|
|
" "map_a13b829e83c68c3c32513de721380294",\n",
|
|
" {\n",
|
|
" center: [52.26415, 10.52642],\n",
|
|
" crs: L.CRS.EPSG3857,\n",
|
|
" zoom: 13,\n",
|
|
" zoomControl: true,\n",
|
|
" preferCanvas: false,\n",
|
|
" }\n",
|
|
" );\n",
|
|
"\n",
|
|
" \n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var tile_layer_02355d3480b09e865d3b0170663f84be = L.tileLayer(\n",
|
|
" "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n",
|
|
" {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n",
|
|
" );\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_bb3c68b9bebcd1b6a40283e5539c4a65 = L.marker(\n",
|
|
" [52.25802230834961, 10.503097534179688],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_000f18e3236d0891346fe69072792733 = L.marker(\n",
|
|
" [52.2643, 10.529],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var popup_5b808f3e85452abf52b15eb63a9ae438 = L.popup({"maxWidth": "100%"});\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var html_88b86a507c4a59c87877cd9741f3d564 = $(`<div id="html_88b86a507c4a59c87877cd9741f3d564" style="width: 100.0%; height: 100.0%;">Ritterbrunnen 1, 38100 Braunschweig</div>`)[0];\n",
|
|
" popup_5b808f3e85452abf52b15eb63a9ae438.setContent(html_88b86a507c4a59c87877cd9741f3d564);\n",
|
|
" \n",
|
|
" \n",
|
|
"\n",
|
|
" marker_000f18e3236d0891346fe69072792733.bindPopup(popup_5b808f3e85452abf52b15eb63a9ae438)\n",
|
|
" ;\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" \n",
|
|
" marker_000f18e3236d0891346fe69072792733.bindTooltip(\n",
|
|
" `<div>\n",
|
|
" More about the castle\n",
|
|
" </div>`,\n",
|
|
" {"sticky": true}\n",
|
|
" );\n",
|
|
" \n",
|
|
" \n",
|
|
" tile_layer_02355d3480b09e865d3b0170663f84be.addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var marker_a8b222361d202932809a9a63aa4dc6c1 = L.marker(\n",
|
|
" [52.25777, 10.50249],\n",
|
|
" {}\n",
|
|
" ).addTo(map_a13b829e83c68c3c32513de721380294);\n",
|
|
" \n",
|
|
" \n",
|
|
" var icon_9de6d38942261270b6653d55d0af4ff4 = L.AwesomeMarkers.icon(\n",
|
|
" {"extraClasses": "fa-rotate-0", "icon": "glyphicon-home", "iconColor": "#deddda", "markerColor": "black", "prefix": "glyphicon"}\n",
|
|
" );\n",
|
|
" marker_a8b222361d202932809a9a63aa4dc6c1.setIcon(icon_9de6d38942261270b6653d55d0af4ff4);\n",
|
|
" \n",
|
|
" \n",
|
|
" var popup_734be6037b9474a701add342210fde1a = L.popup({"maxWidth": "100%"});\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" var html_40eb75648f537056aa40a352e1de522e = $(`<div id="html_40eb75648f537056aa40a352e1de522e" style="width: 100.0%; height: 100.0%;"> <p> <img src="https://www.hbk-bs.de/fileadmin/_processed_/5/1/csm_HBK_Logo_9f3f898a2b.png" alt="HBK BS Logo"> </p> <p><strong>Johannes-Selenka-Platz 1</strong></p> <p><em>38118 Braunschweig</em></p> <p><small>Germany, DE</small></p> <p>Visit: <a href="https://www.hbk-bs.de/">hbk-bs.de</a> </p> </div>`)[0];\n",
|
|
" popup_734be6037b9474a701add342210fde1a.setContent(html_40eb75648f537056aa40a352e1de522e);\n",
|
|
" \n",
|
|
" \n",
|
|
"\n",
|
|
" marker_a8b222361d202932809a9a63aa4dc6c1.bindPopup(popup_734be6037b9474a701add342210fde1a)\n",
|
|
" ;\n",
|
|
"\n",
|
|
" \n",
|
|
" \n",
|
|
" \n",
|
|
" marker_a8b222361d202932809a9a63aa4dc6c1.bindTooltip(\n",
|
|
" `<div>\n",
|
|
" More about the university\n",
|
|
" </div>`,\n",
|
|
" {"sticky": true}\n",
|
|
" );\n",
|
|
" \n",
|
|
"</script>\n",
|
|
"</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
|
|
],
|
|
"text/plain": [
|
|
"<folium.folium.Map at 0x7f1b09d27800>"
|
|
]
|
|
},
|
|
"execution_count": 17,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"hbk_marker = folium.Marker(\n",
|
|
" location=(52.257770, 10.502490),\n",
|
|
" popup=hbk_popup_html,\n",
|
|
" tooltip=hbk_tooltip,\n",
|
|
" icon=hbk_icon\n",
|
|
" )\n",
|
|
"\n",
|
|
"hbk_marker.add_to(m)\n",
|
|
"\n",
|
|
"m"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "78002786-20fb-4b92-be9a-b92b678f50ff",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"source": [
|
|
"<p>\n",
|
|
" <img \n",
|
|
" src=\"https://www.hbk-bs.de/fileadmin/_processed_/5/1/csm_HBK_Logo_9f3f898a2b.png\"\n",
|
|
" alt=\"HBK BS Logo\">\n",
|
|
" <p><strong>Johannes-Selenka-Platz 1</strong></p>\n",
|
|
" <p><em>38118 Braunschweig</em></p>\n",
|
|
" <p><small>Germany, DE</small></p>\n",
|
|
" <p>Visit: <a href=\"https://www.hbk-bs.de/\">hbk-bs.de</a>\n",
|
|
"</p>"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 18,
|
|
"id": "0547528b-b97f-4e94-aab4-d1d069be020c",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"def popup_factory(adr: str, zipc: str, country: str, pic: str):\n",
|
|
" html = '''\n",
|
|
" <p><img src=\"{}\" width=\"300px\" height=\"auto\"></p>\n",
|
|
" <p><strong>{}</strong></p>\n",
|
|
" <p><em>{}</em></p>\n",
|
|
" <p><small>{}</small></p>\n",
|
|
" '''.format(pic, adr, zipc, country)\n",
|
|
" return folium.Popup(html)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 19,
|
|
"id": "2ec42850-9c12-4fb4-8b94-024bca9ad9b1",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"def icon_factory(is_public=True):\n",
|
|
" icon = folium.Icon(\n",
|
|
" color='black' if is_public else 'white',\n",
|
|
" icon_color = 'white' if is_public else 'black',\n",
|
|
" icon='glyphicon-home'\n",
|
|
" )\n",
|
|
" return icon"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 20,
|
|
"id": "b3d3d3c8-0039-4f80-9f08-5de61172b588",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"def marker_factory(loc, popup, is_public=True):\n",
|
|
" std_tooltip = 'Click for more information'\n",
|
|
" std_icon = icon_factory(is_public)\n",
|
|
" return folium.Marker(loc, popup=popup, icon=std_icon, tooltip=std_tooltip)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "18701dc2-4409-486d-ad7d-7bde6fc3273e",
|
|
"metadata": {
|
|
"editable": true,
|
|
"slideshow": {
|
|
"slide_type": ""
|
|
},
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"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.12.7"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|