#!/usr/bin/env python # coding: utf-8 # In[ ]: from ipyleaflet import Map, Heatmap from random import uniform import time # In[ ]: def create_random_data(length): "Return a list of some random lat/lon/value triples." return [[uniform(-80, 80), uniform(-180, 180), uniform(0, 1000)] for i in range(length)] # In[ ]: m = Map(center=[0, 0], zoom=2) m # In[ ]: heat = Heatmap(locations=create_random_data(1000), radius=20, blur=10) m.add_layer(heat) # In[ ]: for i in range(100): heat.locations = create_random_data(1000) time.sleep(0.1) # In[ ]: heat.radius = 30 # In[ ]: heat.blur = 50 # In[ ]: heat.max = 0.5 # In[ ]: heat.gradient = {0.4: 'red', 0.6: 'yellow', 0.7: 'lime', 0.8: 'cyan', 1.0: 'blue'} # In[ ]: heat.locations = [[uniform(-80, 80), uniform(-180, 180), uniform(0, 1000)] for i in range(1000)]