Google Maps makes this very easy. In this example, you may notice that taxiData is loading into a specific google array here -
pointArray = new google.maps.MVCArray(taxiData);
And here it is placed on the map in the form of a heat map here:
heatmap = new google.maps.visualization.HeatmapLayer({ data: pointArray }); heatmap.setMap(map);
MVCArray can be updated and the map will be automatically updated. So, if you need to add a new LatLng to your heatmap, just put:
pointArray.push(new LatLng(<coordinates>));
And the map will be updated.
Bubbles
source share