-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap2.py
More file actions
24 lines (19 loc) · 708 Bytes
/
map2.py
File metadata and controls
24 lines (19 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import folium
import pandas
data = pandas.read_csv("Volcanoes.txt")
lat = list(data["LAT"])
lon = list(data["LON"])
elev = list(data["ELEV"])
name = list(data["NAME"])
html = """
Volcano name:<br>
<a href="https://www.google.com/search?q=%%22%s%%22" target="_blank">%s</a><br>
Height: %s m
"""
map = folium.Map(location=[38.58, -99.09], zoom_start=5, tiles="Mapbox Bright")
fg = folium.FeatureGroup(name = "My Map")
for lt, ln, el, name in zip(lat, lon, elev, name):
iframe = folium.IFrame(html=html % (name, name, el), width=200, height=100)
fg.add_child(folium.Marker(location=[lt, ln], popup=folium.Popup(iframe), icon = folium.Icon(color = "green")))
map.add_child(fg)
map.save("Map2.html")