angular-ui/angular-google-maps

Multiple layer heatmap

ninoyaghoubi opened this issue · 1 comments

Version

2.3.2

Test Case

Not able to make it on jsbin
I would like to have multiple layers of heatmap, each with different object containing their own properties such as gradient.

Steps to reproduce

In HTML

` namespace="visualization" type="HeatmapLayer" options="vm.fireHeatMap.options" show="vm.fireHeatMap.showHeat" onCreated="vm.fireHeatMap.heatLayerCallback"> </ui-gmap-layer> <ui-gmap-layer namespace="visualization" type="HeatmapLayer" options="vm.mmaHeatMap.options" show="vm.mmaHeatMap.showHeat" onCreated="vm.mmaHeatMap.heatLayerCallback">



`

In Javascript

`uiGmapGoogleMapApi.then(function (maps){
vm.fireHeatMap = {
heatLayerCallback: function (layer) {
//set the heat layers backend data
var mockHeatLayerOne = new heatLayerCallbackFire(layer)
},
showHeat: true,
options:{
radius:20,
gradient :[
'rgba(0, 0, 255, 0)',
'rgba(0, 0, 255, 1)',
'rgba(0, 0,255, 1)',
'rgba(0, 0, 255, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 223, 1)',
'rgba(0, 0, 191, 1)',
'rgba(0, 0, 159, 1)',
'rgba(0, 0, 127, 1)',
'rgba(63, 0, 91, 1)',
'rgba(127, 0, 63, 1)',
'rgba(191, 0, 31, 1)',
'rgba(255, 0, 0, 1)'
]
}
};

vm.mmaHeatMap = {
heatLayerCallback: function (layer) {
//set the heat layers backend data
var mockHeatLayerTwo = new heatLayerCallbackMMA(layer)
},
showHeat: true,
options:{
radius:20,
gradient :[
'rgba(0, 100, 255, 0)',
'rgba(50, 150, 255, 1)',
'rgba(50, 200,255, 1)',
'rgba(50, 100, 255, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 223, 1)',
'rgba(0, 0, 191, 1)',
'rgba(0, 0, 159, 1)',
'rgba(0, 0, 127, 1)',
'rgba(63, 0, 91, 1)',
'rgba(127, 0, 63, 1)',
'rgba(191, 0, 31, 1)',
'rgba(255, 0, 0, 1)'
]
}
};
};`

Expected Behavior

To have two diffferent heatmap layers which are generated separetly with seperate gradient colors representing each layer.

Actual Behavior

Each layer is generated seperatly according to the lattitude and longitude assigned to it. however, the layer colors for both of the layers are assigned from whatever the last gradient layer contains in its array.

Unless you feel like making an effort to add this as a plugin or part of this library it is not going to happen. This library is not really being worked on anymore.