Using google maps javascript api, I want to create two heatmap overlays with different color gradients for each overlay. So far I have been able to create the two overlays, but when I try to apply a different gradient to each one there is no output.
Here is the code:
var map, heatmap, heatmap2;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: {lat: 47.608013, lng: -122.335167},
mapTypeId:'hybrid'
});
heatmap = new google.maps.visualization.HeatmapLayer({
data: getPoints(),
map: map
gradient: getGrad()
});
heatmap2 = new google.maps.visualization.HeatmapLayer({
data: getPoints1(),
map: map
gradient: getGrad1()
});
}
function getGrad () {
return [
rgba(255,0,0,0),
// more values here
];
}
function getGrad1 () {
return [
rgba(0,255,255,0),
//more values here
];
}
To clarify, whenever the gradient properties get commented out everything works with the default gradient. The code above produces no output. Any ideas?