-1

Is there a method for setting the default style on a multi layer fusion table map, currently the API just uses the default style which is a Red Fill and Black Border line which is quite annoying. The code I currently have for single layer is working fine but it doesn't work for a multi-layer map.

Below the code I am using:

for multiple: layer = new google.maps.FusionTablesLayer(table, { 
  // suppressInfoWindows: true, 
  query: "select " + "*" + " from " + table, 
  styles: [{ 
    polylineOptions: { 
      strokeColor: "#rrggbb", 
      strokeWeight: "1" ,
      fillOpacity: 1 
    }, 
    polygonOptions: { 
      fillColor: "#rrggbb",
      fillOpacity: 1, 
      strokeColor: "#rrggbb", 
      strokeWeight: "1" 
    } 
  }]

Thank you.

geocodezip
  • 158,664
  • 13
  • 220
  • 245
Zack
  • 11
  • 3
  • 1
    possible duplicate of [fusion table can not show two layers if we add different styles to the two layers](http://stackoverflow.com/questions/12119207/fusion-table-can-not-show-two-layers-if-we-add-different-styles-to-the-two-layer/).. You can only dynamically style **one** FusionTableLayer on a map. – geocodezip Jan 13 '16 at 07:12

1 Answers1

0

You can style the FusionTable with the FusionTables User Interface, then use the styleId (example from the documentation) to change between differently configured maps.

var layer = new google.maps.FusionTablesLayer({
    query: {
      select: 'Address',
      from: 297050
    },
    map: map,
    styleId: 1
 });
geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • Tried that but when I applied the styleid the default google fusion layerstyle apply not defined style.. – Zack Jan 13 '16 at 11:30