JS
var map;
var layer_1;
var layer_2;
var layer_3;
var layer_4;
function initialize() {
map = new google.maps.Map(document.getElementById('map-canvas'), {
scaleControl: true,
center: new google.maps.LatLng(-21.450924824, -50.053680947),
zoom: 11
});
var style = [
{
featureType: 'all',
elementType: 'all',
stylers: [
{ saturation: 40 }
]
},
{
featureType: 'poi',
elementType: 'all',
stylers: [
{ visibility: 'off' }
]
}
];
var styledMapType = new google.maps.StyledMapType(style, {
map: map,
name: 'Styled Map'
});
map.mapTypes.set('map-style', styledMapType);
map.setMapTypeId('map-style');
layer_1 = new google.maps.FusionTablesLayer({
query: {
select: "col7",
from: "1CM8eBU_gtCiCZwkF5G3A7bzc4fqlKrfEye0rMVE-"
},
map: map,
styleId: 2,
templateId: 2
});
layer_2 = new google.maps.FusionTablesLayer({
query: {
select: "col7",
from: "1R07xjdfQUdcoRnq0E-TWp5aRxDkc_0szfrwgQCYL"
},
map: map,
styleId: 2,
templateId: 2
});
layer_3 = new google.maps.FusionTablesLayer({
query: {
select: "col2\x3e\x3e0",
from: "1h1oCB9eh7vc1dwhH5pC_uLqwio5xprCg2SCOYATF",
},
map: map,
styleId: 2,
templateId: 2
});
layer_4 = new google.maps.FusionTablesLayer({
query: {
select: "col1",
from: "1DCIBimKUgBiZqtMNP59682IdrH5vL3cOWWZSDwBf",
},
map: map,
styleId: 2,
templateId: 2
});
}
function changeMap(layerNum) {
if (layerNum == 1) {
update(layer_1);
}
if (layerNum == 2) {
update(layer_2);
}
if (layerNum == 3) {
update(layer_3);
}
if (layerNum == 4) {
update(layer_4);
}
}
function update(layer) {
var layerMap = layer.getMap();
if (layerMap) {
layer.setMap(null);
} else {
layer.setMap(map);
}
}
google.maps.event.addDomListener(window, 'load', initialize);