Category : folium

I am trying this code: import pandas import folium Volcano_data = pandas.read_csv("Data/Volcanoes.txt") Map1 = folium.Map(location=[38.58, -99.09], zoom_start = 4.3, tiles = "Stamen Terrain") ff =folium.FeatureGroup(name = "Volcano in US") lat = list(Volcano_data["LAT"]) lon = list(Volcano_data["LON"]) elev = list(Volcano_data["ELEV"]) def color_producer(elevation): if elevation < 1000: return "green" elif elevation < 3000: return "orange" else: return "red" ..

Read more

I would like to fill in a Folium map with discrete color values. But every shape is returned with the same value (i.e. – the same color) Name Fill_Color Geometry A orange …. B yellow …. C purple …. D red …. m = folium.Map(location=[40.6725, -73.985], zoom_start=14, tiles=’CartoDB positron’) title_html = ”’ <h3 align="center" style="font-size:16px"><b>{}</b></h3> ..

Read more

I have a specific column in my df with 4 unique values. I would like to add a feature group layer control to filter markers based on those four values. My code is: m = folium.Map(location=it_coords, zoom_start=6,tiles=’openstreetmap’, control_scale=True, prefer_canvas=True) mc = MarkerCluster().add_to(m) feature_group = FeatureGroup(name= "Monumenti") for grp_name, df_grp in df.groupby(‘Tipologia personaggio’): print(grp_name) for i ..

Read more

I would like to filter markers on my map by unique values in a specific column. The LayerControl appears, I used a FeatureGroup. However, when trying it out, it doesn’t filter out anything. Here is my code: it_coords = [41.902782 , 12.496366] m = folium.Map(location=it_coords, zoom_start=6,tiles=’openstreetmap’) cluster = folium.plugins.MarkerCluster(name="Monumenti").add_to(m) for i in range(0,len(df)): html=f""" <h2> ..

Read more