Skip to content

Instantly share code, notes, and snippets.

@wagamama
Last active November 1, 2015 04:27
Show Gist options
  • Save wagamama/87832da3e7e34055abbc to your computer and use it in GitHub Desktop.
Save wagamama/87832da3e7e34055abbc to your computer and use it in GitHub Desktop.
import folium
import xmltodict
TPE_COORDINATES = (25.0375167, 121.5637)
map_tpe = folium.Map(location=TPE_COORDINATES, zoom_start=12)
with open('freeWifi.xml') as fd:
wifi = xmltodict.parse(fd.read())
for each in wifi['NewDataSet']['hotspot']:
lat, lon = each['LAT'], each['LNG']
text = ', '.join((each['AREA'], each['HOTSPOT_NAME'], each['ADDRESS']))
map_tpe.simple_marker(location=(lat, lon), popup=text, clustered_marker=True)
map_tpe.create_map('wifi.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment