I have 3 layers on a Google Maps map. The first is a set of polygons. The second is a set of markers. The third is a heatmap.
I'm using the following script libraries
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=visualization"></script>
<script src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['intensitymap']}]}"></script>
I start with a Map object.
var MAP = new google.maps.Map(document.getElementById('map-canvas'),
{
zoom : 5,
center : new google.maps.LatLng(-25.610111, 134.354806),
mapTypeId : google.maps.MapTypeId.ROADMAP
});
followed by the polygons
var polygons = new google.maps.FusionTablesLayer({
query : {
select : 'Polygons',
from : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
},
map : MAP,
suppressInfoWindows : true});
followed by the Markers, one of which is
var marker = new google.maps.Marker({
position: new google.maps.LatLng(-28.8, 152.5),
map: MAP,
icon: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
title: "Tabulam"});
followed by the heatmap (abbreviated)
var heatmapLayer = new google.maps.visualization.HeatmapLayer();
var heatData = [
{location: new google.maps.LatLng(-30.3, 153.1), weight: 102}]
heatmapLayer.setData(heatData);
heatmapLayer.setOptions({opacity:1, radius:50});
heatmapLayer.setMap(MAP);
All that wrapped in a function and called with
google.maps.event.addDomListener(window, 'load', initialize);
The problem that I have is that the heatmap is obscured behind the polygons. How do I bring it forward? Alternatively, how do I push the polygons right to the back?