Closed getcake closed 3 years ago
A heatmap layer can be enabled by asserting heatmap_layer = True within the Map object.
heatmap_layer = True
Map
In order to build the heatmap, it requires its own list of coordinates, containing a dictionary with lat and lng values exclusively.
lat
lng
Below is a small example of one way this could be done.
@app.route("/") def heatmap(): data = [ { "lat": 37.782551, "lng": -122.445368, }, { "lat": 37.782745, "lng": -122.444586, }, { "lat": 37.782842, "lng": -122.443688, }, { "lat": 37.782919, "lng": -122.442815, }, ] heatmap_example = Map( identifier="heatmap_example", lat=37.775, lng=-122.434, heatmap_layer=True, heatmap_data=[(d) for d in data], ) return render_template("example.html", heatmap_example=heatmap_example)
Which will look something like this
147 requests the ability to add a heatmap layer as seen here
A heatmap layer can be enabled by asserting
heatmap_layer = True
within theMap
object.In order to build the heatmap, it requires its own list of coordinates, containing a dictionary with
lat
andlng
values exclusively.Below is a small example of one way this could be done.
Which will look something like this