1
votes

I wasn't able to find an answer to my question in the knowledge base so I am posting my question.

Why am I unable to display the following 3 layers at a given time on my google map.

My code is as follows:

 layer1 = new google.maps.FusionTablesLayer({
     query: {
        select: 'geometry',
        from: '1j0sMtIvduL_g4v49iVtliQxMuoejc181SE5E3Js'
    },
    styles:
        [{
            polygonOptions:{
                fillColor: "#ffffff",
                strokeColor: "#ff0000",
                strokeWeight: 2,
                fillOpacity: 0.0
            }
        }],
    map:map,
    suppressInfoWindows: true
});
layer1.setMap(map);



layer2 = new google.maps.FusionTablesLayer({
     query: {
        select: 'geometry',
        from: '1ChsolycFiapOMGv4tarRE0Dl-aGNm6GY6-qe6_o'
    },
    styles:
        [{
            polygonOptions:{
                fillColor: "#0000ff",
                 strokeColor: "#000000",
                strokeWeight: 2,
                fillOpacity: 1.0
            }
        }],
    map:map,
    suppressInfoWindows: true
});
layer2.setMap(map);


 layer3 = new google.maps.FusionTablesLayer({
     query: {
        select: 'geometry',
        from: tableID
    },
    map:map,
    suppressInfoWindows: true
});
layer3.setMap(map);

For some reason, I am only able to display two layers at a given time e.g. layer 1&3 and 2&3. Any suggestions greatly appreciated.

Thanks,

1

1 Answers

2
votes

This is correct, you ran into a limitation of Google Fusion Tables. You may only define 5 layers (you have 3, so no problem here), but only one of those 5 can be styled (you currently have 2, hence only one is displayed).

In your example layer1 and layer2 both have the styles-option set. This is currently not possible.