Last active
November 1, 2022 17:35
-
-
Save vladimir-rybalko/65087047f1bebab63ce76fd8573a9842 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"id": "26e21ff6", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Collecting foliumNote: you may need to restart the kernel to use updated packages.\n", | |
"\n", | |
" Using cached folium-0.13.0-py2.py3-none-any.whl (96 kB)\n" | |
] | |
} | |
], | |
"source": [ | |
"%pip install folium" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"id": "f52580ec", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import folium\n", | |
"from folium.plugins import MousePosition" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"id": "e658cc23", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"map = folium.Map(\n", | |
" location = [56.839234, 60.546997], # широта и долгота Екб\n", | |
" zoom_start = 12,\n", | |
" tiles='https://geoapi.ift.datacloud.t1-cloud.ru/tiller/tile/{z}/{x}/{y}.png?apikey=b019d06a-5de8-41d4-be11-c9778bcb916e',\n", | |
" attr='INNOTECH'\n", | |
")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"id": "139afd8d", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<folium.map.Marker at 0x16bed5a62b0>" | |
] | |
}, | |
"execution_count": 24, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"featureGroup = folium.map.FeatureGroup()\n", | |
"\n", | |
"featureGroup.add_child(\n", | |
" folium.features.CircleMarker([56.839234, 60.546997], radius = 5, color = 'red', fill_color = 'Red')\n", | |
")\n", | |
"\n", | |
"map.add_child(featureGroup)\n", | |
"folium.Marker([56.839234, 60.546997], popup = 'Екатеринбург, в разговорной речи - Екб').add_to(map)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 25, | |
"id": "bf7d4de1", | |
"metadata": {}, | |
"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", | |
"<head> \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/[email protected]/dist/leaflet.js"></script>\n", | |
" <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", | |
" <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.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/[email protected]/dist/leaflet.css"/>\n", | |
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", | |
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", | |
" <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.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_aeec77cfb1d33d306cd8688ca7abbc0d {\n", | |
" position: relative;\n", | |
" width: 100.0%;\n", | |
" height: 100.0%;\n", | |
" left: 0.0%;\n", | |
" top: 0.0%;\n", | |
" }\n", | |
" </style>\n", | |
" \n", | |
"</head>\n", | |
"<body> \n", | |
" \n", | |
" <div class="folium-map" id="map_aeec77cfb1d33d306cd8688ca7abbc0d" ></div>\n", | |
" \n", | |
"</body>\n", | |
"<script> \n", | |
" \n", | |
" var map_aeec77cfb1d33d306cd8688ca7abbc0d = L.map(\n", | |
" "map_aeec77cfb1d33d306cd8688ca7abbc0d",\n", | |
" {\n", | |
" center: [56.839234, 60.546997],\n", | |
" crs: L.CRS.EPSG3857,\n", | |
" zoom: 12,\n", | |
" zoomControl: true,\n", | |
" preferCanvas: false,\n", | |
" }\n", | |
" );\n", | |
"\n", | |
" \n", | |
"\n", | |
" \n", | |
" \n", | |
" var tile_layer_13cc12797ffdfb8c09571c3805655155 = L.tileLayer(\n", | |
" "https://geoapi.ift.datacloud.t1-cloud.ru/tiller/tile/{z}/{x}/{y}.png?apikey=b019d06a-5de8-41d4-be11-c9778bcb916e",\n", | |
" {"attribution": "INNOTECH", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", | |
" ).addTo(map_aeec77cfb1d33d306cd8688ca7abbc0d);\n", | |
" \n", | |
" \n", | |
" var feature_group_4d4d77b907533c66932d6234c591059c = L.featureGroup(\n", | |
" {}\n", | |
" ).addTo(map_aeec77cfb1d33d306cd8688ca7abbc0d);\n", | |
" \n", | |
" \n", | |
" var circle_marker_60a0ae59f5f81e55f3991bba29bc32e2 = L.circleMarker(\n", | |
" [56.839234, 60.546997],\n", | |
" {"bubblingMouseEvents": true, "color": "red", "dashArray": null, "dashOffset": null, "fill": true, "fillColor": "Red", "fillOpacity": 0.2, "fillRule": "evenodd", "lineCap": "round", "lineJoin": "round", "opacity": 1.0, "radius": 5, "stroke": true, "weight": 3}\n", | |
" ).addTo(feature_group_4d4d77b907533c66932d6234c591059c);\n", | |
" \n", | |
" \n", | |
" var marker_267c7859597b9a086ebc3dbd785d83dd = L.marker(\n", | |
" [56.839234, 60.546997],\n", | |
" {}\n", | |
" ).addTo(map_aeec77cfb1d33d306cd8688ca7abbc0d);\n", | |
" \n", | |
" \n", | |
" var popup_0c2420ee27bc151a8b08c92e16e9f887 = L.popup({"maxWidth": "100%"});\n", | |
"\n", | |
" \n", | |
" \n", | |
" var html_f5b6846fab5e95c696dfe251d389f303 = $(`<div id="html_f5b6846fab5e95c696dfe251d389f303" style="width: 100.0%; height: 100.0%;">Екатеринбург, в разговорной речи - Екб</div>`)[0];\n", | |
" popup_0c2420ee27bc151a8b08c92e16e9f887.setContent(html_f5b6846fab5e95c696dfe251d389f303);\n", | |
" \n", | |
" \n", | |
"\n", | |
" marker_267c7859597b9a086ebc3dbd785d83dd.bindPopup(popup_0c2420ee27bc151a8b08c92e16e9f887)\n", | |
" ;\n", | |
"\n", | |
" \n", | |
" \n", | |
"</script>\" 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 0x16bed61beb0>" | |
] | |
}, | |
"execution_count": 25, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"map" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "6eaebdba", | |
"metadata": {}, | |
"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.9.7" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment