packages = [
"folium",
"pandas"
]
import folium
import json
import pandas as pd
import urllib3
from pyodide.http import open_url
from folium.features import DivIcon
from folium.features import CustomIcon
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
url = (
"https://docs.google.com/spreadsheets/d/13wZMciV2Zw8AOR1ZLMD3GgcsYymm3cNtzFGrILvBuQA/export?format=csv&gid=0"
)
url_content = open_url(url)
lists = pd.read_csv(url_content)
m = folium.Map(location=[35.7111326404866, 139.66453528858855], zoom_start=14, tiles="cartodb positron")
geojson_data = urllib3.request("GET","https://raw.githubusercontent.com/RefletsDansLeau/Nakanoku-geojson/master/nakano_ku.json",preload_content=False).json()
folium.GeoJson(geojson_data,name="nakanoku").add_to(m)
for index, row in lists.iterrows():
folium.Marker(
location= [row['緯度'],row['経度']],
icon=folium.features.CustomIcon(icon_image="https://github.com/RefletsDansLeau/RefletsDansLeau.github.io/blob/b50bed32b9b7ef0649e501de8ae7a772cbdd606e/pic_map/"+row['アイコン']+"?raw=true",
icon_size=(20,20)),
icon_anchor=(10,10),
).add_to(m)
folium.Marker(
location= [row['緯度'],row['経度']],
icon=folium.features.DivIcon(icon_size=(50,20),
icon_anchor=(-10,3),
html=row['Capacity'],
),
tooltip=row['Name'],
).add_to(m)
folium.LayerControl().add_to(m)
display(m, target="folium")