Is it possible to plot heatmap on top of marker in folium?

Viewed 31

I was adding a set of circle markers to the heatmap, however, I found that the markers are on top of the heatmap and cover some of the heat, so I wonder is it possible to let the heatmap on top of the marker instead?

Here's my code and the map: enter image description here

# heat map
hm = folium.Map(location=[32.8801,-117.2340], zoom_start=10)

# add bus stops/stations
for i,r in bus_stops.iterrows():
    folium.CircleMarker([r['Y'], r['X']],
                        #Make color/style changes here
                        radius = 1,
                        color = 'gray',
                        opacity = 0.6
          ).add_to(hm)
    
HeatMap(
    list(zip(geo_df.lat.values, geo_df.lon.values)),
    min_opacity=0.2,
    radius=17, 
    blur=15, 
    max_zoom=1,
).add_to(hm)

for i in range(0,len(encamp_df)):
    folium.Marker([encamp_df['lat'][i], encamp_df['lon'][i]]).add_to(hm)

hm
0 Answers
Related