Updating heatmap data, simple google HeatMap

后端 未结 1 502
长发绾君心
长发绾君心 2021-02-06 06:39

I\'ve built this android app to collect longitude,latitude, and phone signals for my class project. My objective is to port this info to a simple heatmap webpage. My question is

1条回答
  •  长情又很酷
    2021-02-06 07:19

    Google maps makes this very straightforward. You might notice later on in this example, taxiData is loaded into a specific google array here -

     pointArray = new google.maps.MVCArray(taxiData);
    

    And then this is put into the map as a heatmap here:

    heatmap = new google.maps.visualization.HeatmapLayer({
        data: pointArray
    });
    heatmap.setMap(map);
    

    The MVCArray can be updated, and the map will automatically update. So, if you need to add a new LatLng to your heatmap, simply put:

    pointArray.push(new LatLng());
    

    And the map will update.

    0 讨论(0)
提交回复
热议问题