I'm using Python only and would like to adjust the heatmap's maximum opacity. As you can see in the image below, the base map is quite invisible. I want to see more of the base map. How do I adjust the parameters in the HeatMap
so that I can increase the opacity of the heatmap layer using only Python?
it's quite the same problem in here, but it uses leaflet.js and the solution is using CSS, not Python. Anyway, here's my code I used to produce the map.
import folium
from folium import plugins
from folium.plugins import HeatMap
import pandas as pd
df = pd.read_csv("the_data.csv") # the data contains lat and long columns, I can't share the data...
coords = [(lat, lng) for lat, lng in zip(restaurants[0].lat.to_list(), restaurants[0].lon.to_list())]
m = folium.Map([-6.204725,106.847009], tiles="CartoDB dark_matter", zoom_start=14)
HeatMap(coords,
min_opacity=0.4,
max_val = 0.5,
gradient={.2: '#482d61', .5:"#5aa7d6", 1: '#fffaad'}).add_to(folium.FeatureGroup(name='Heat Map').add_to(m))
folium.LayerControl().add_to(m)
m.save("heatmap.html")