title: style multiple GeoJson files with the Google Maps Javascript API v3 data layer
body: <p>I have a site that uses google api v3 for showing polygons from json files.</p>
  
  <p>the site has multiple json polygons,  I need to style each polygon with a different color and create a handle to the shape. </p>
  
  <p>The only examples that I can find refer to pure polygons and not json files, there is one example that changes the json file (i cant do this as the json files are static.</p>
  
  <p>sample code:</p>
  
  <pre><code>var map;
  
  function initMap() {
      map = new google.maps.Map(document.getElementById('map'), {
          zoom: 4,
          center: { lat: 45, lng: -90 }
      });
  
  
  //1st Json file
  map.data.loadGeoJson(
          'https://storage.googleapis.com/mapsdevsite/json/google.json');
  
  //2nd json file  (same as #1 for illustration purpose)
  map.data.loadGeoJson(
          'https://storage.googleapis.com/mapsdevsite/json/google.json');
  
      // I want to style each Json file independently
      map.data.setStyle({
          fillColor: 'green',
          strokeWeight: 1
      });
  
     // map1.setMap(map);
  
  
  }
  </code></pre>
  
  <p>I managed to get the layer added to the map using,</p>
  
  <pre><code>  data_layer.loadGeoJson('https://storage.googleapis.com/mapsdevsite/json/google.json');
  
  
      // Construct the polygon.
      var nLayer = new google.maps.JSON({
          paths: data_layer,
          strokeColor: 'green',
          strokeOpacity: 0.5,
          strokeWeight: 1,
          fillColor: 'green',
          fillOpacity: 0.8
      });
  
      nLayer.setMap(map);
  </code></pre>
  
  <p>I cannot get the style to apply to the map. any ideas ?</p>