Skip to content

Instantly share code, notes, and snippets.

@Nyahua
Created May 4, 2017 14:13
Show Gist options
  • Save Nyahua/7d4cdbf9b721a87d68d71a0d9ee8454e to your computer and use it in GitHub Desktop.
Save Nyahua/7d4cdbf9b721a87d68d71a0d9ee8454e to your computer and use it in GitHub Desktop.
add html ref to popup marker
import folium
ref_html = r'<a href="http://www.shenyang.gov.cn/" target="_blank"> I am here </a>'
pop_html = folium.Popup(folium.Html(ref_html, script=True))
map_1 = folium.Map(location=[41.8057, 123.4315], zoom_start=12,
tiles='Stamen Terrain')
folium.Marker(
location = [41.8057, 123.4315],
popup = pop_html).add_to(map_1)
# map_1.save('marker_html.html')
map_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment