Skip to content

Instantly share code, notes, and snippets.

@bertcarremans
Created November 21, 2018 15:33
Show Gist options
  • Save bertcarremans/5545167489189c32e26a415cf305b2ea to your computer and use it in GitHub Desktop.
Save bertcarremans/5545167489189c32e26a415cf305b2ea to your computer and use it in GitHub Desktop.
# snippet to create circles on map
coords_belgium=[50.5039, 4.4699]
pollution_map = folium.Map(location=coords_belgium, control_scale=True, zoom_start=8)
for i in range(0,len(loc_df)):
folium.Circle(location=[loc_df.iloc[i]['Latitude'], loc_df.iloc[i]['Longitude']]
, popup=loc_df.iloc[i]['SamplingPoint']
, radius=500
, color='blue'
, fill=True
, fill_color='blue'
).add_to(pollution_map)
pollution_map.save('../output/pollution_map_circles.html')
pollution_map
# snippet to create colored icon on map
for i in range(0,len(loc_df)):
folium.Marker([loc_df.iloc[i]['Latitude'], loc_df.iloc[i]['Longitude']]
, popup=loc_df.iloc[i]['SamplingPoint']
, icon=folium.Icon(color='orange')).add_to(pollution_map)
pollution_map.save('../output/pollution_map_markers.html')
pollution_map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment