Multiple FusionTableLayer and Styling

35 views Asked by At

I need to aplly a style for each FusionTableLayer, but map display always the first layer style. What's wrong?

     var layer1 = new google.maps.FusionTablesLayer({
                     query: {
                         select: 'geometry',
                         from: 'Table1'
                     },
                     styles: [{
                         polygonOptions: {
                             strokeColor: "#FFFF00",
                             strokeOpacity: "0.7",
                             strokeWeight: "1",
                             fillColor: "#FF0000",
                             fillOpacity: "0.3"
                         }
                     }],
                     map: map
                 });
      
            
               var layer2 = new google.maps.FusionTablesLayer({
                 query: {
                     select: 'county',
                     from: 'Table2'
                 },
                 styles:[{polygonOptions: {
                     strokeColor: "#FF0000",
                     strokeOpacity: "0.7",
                     strokeWeight: "1",
                     fillColor: "#000000",
                     fillOpacity: "0.0"
                 }}],
                 map: map
             });     

I tried several ejemple but same result.

1

There are 1 answers

0
geocodezip On

Per the documentation styles can only be applied to a single FusionTables layer per map:

Fusion Table Styles


Note: Styles can only be applied to a single Fusion Tables layer per map. You may apply up to five styles to that layer.