-1

I have a Google Map with 3 layers on it.

  • a) Region
  • b) State
  • c) County

They appear when you zoom in the map.

Here is the code - https://jsfiddle.net/djz43usz/

//county level
         if(zoom_level >= 7) {
          clearRegion();
          marker_point = country_center;
          id = c_id;
          area_type="COUNTY";
          mark_center(); 
           layer = new google.maps.FusionTablesLayer({
            query: {
              select: '\'geometry\'',
              from: '1fio1qgy5HkinUDKqYvREIlSoBaHjl2RBe3DLJa38'
            },
            styles: [{
              polygonOptions: {
                fillColor: '#000000',
                fillOpacity: 0.001
              }
            },{
                where: "'GEO_ID2' IN ("+draw_str.toString()+")",
                polygonOptions: {
                  fillOpacity: 0.3
                }
              }]

          });
          layer.setMap(map);

          }
        });

Region and state works well. But for county, fusion layer doesn't work. Is there anyway I can resolve it?

This is how it looks right now:

enter image description here

dang
  • 2,342
  • 5
  • 44
  • 91

1 Answers1

0

If I look at the javascript console, I see: Failed to load resource: the server responded with a status of 413 (). The issue is that the draw_str string is too long (it is 17555 characters long). In this line:

where: "'GEO_ID2' IN ("+draw_str.toString()+")",
polygonOptions: {
  fillOpacity: 0.3
}

You need to reduce the size of that query string (to fit the URL maximum of 2048).

proof of concept fiddle (with layer showing)

Community
  • 1
  • 1
geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • I have dynamic views, i.e. on 1 page, it can be draw_str having 50 geocodes, whereas on another page it can be 1500, so I cannot really reduce the size. Is there a way to overcome this limitation and/or way to filter it on page? – dang Dec 30 '16 at 15:31
  • Same answer I gave the last time you asked this question: [Google Maps Fusion Table layer not working](http://stackoverflow.com/questions/40238551/google-maps-fusion-table-layer-not-working) – geocodezip Dec 30 '16 at 15:35