allenhwkim / angularjs-google-maps

The Simplest AngularJS Google Maps V3 Directive
http://ngmap.github.io
MIT License
1.52k stars 517 forks source link

Heatmap dynamic point data #806

Closed kvrting closed 7 years ago

kvrting commented 7 years ago

Greetings!

From: <heatmap-layer id="foo" data="mapData"></heatmap-layer>

How do you make mapData dynamically changeable so the heatmap points update without refreshing the page?

Changing the value of $scope.mapData the controller doesn't seem to work.

Only work around for this is not to use id="foo": heatmap = new google.maps.visualization.HeatmapLayer({data: $scope.mapData, radius: 20});

By doing so, the default <heatmap-layer> parameters are lost (radius, gradient, opacity, etc)

Any help will be greatly appreciated. Also what parameter values are being used by the default <heatmap-layer> (radius, maxIntensity, opacity, etc) Thanks!

allenhwkim commented 7 years ago

Please try this. Google heatmap is designed differently from marker. https://stackoverflow.com/questions/13479514/updating-heatmap-data-simple-google-heatmap

kvrting commented 7 years ago

Thank you for the fast response. Changed all my operations to push() and pop() instead of instantiation/assignment and everything worked fine. Cheers!