user3669516
user3669516

Reputation: 17

How to draw A LOT of polygons on google maps api v3

I'm trying to create a map that highlights over 2 dozen regions on a google map via coordinates. It seems i'm hitting the query string limit.

Any suggestions as to a work around?

Thanks in advance for all/any recommendations.


Thank you for the comments. I lost track of this post and didn't get a chance to test out your solutions.

The image attached below is what I was trying to fill out.

My polygons are region groupings and i'm trying to color code them.

{
    where: "Members in("+arrGrpOne+")",
        polygonOptions:{
            fillColor: '#FF0000',
            fillOpacity : .5
        }
},{
    where: "Members in ("+arrGrpTwo+")",
        polygonOptions:{
            fillColor: '#FF00FF',
            fillOpacity : .5
}

If i add more where clause i get the following error : Failed to load resource: the server responded with a status of 400 (Bad Request) https://mts0.googleapis.com/mapslt/ft?hl=en-US&lyrs=ft%3A115hPQ0BVPioObq47a…vwwtvt,twtuuwvwwtvv&z=12&src=apiv3&xc=1&callback=xdc._d9mcoj&token=25665

Upvotes: 0

Views: 618

Answers (1)

Rick
Rick

Reputation: 1573

Depending on how complex your polygons are you may be able to use encoded polylines:

https://developers.google.com/maps/documentation/staticmaps/?csw=1#EncodedPolylines

Try and recreate your polygon with the interactive encoder.

GitHub should have several libraries available depending on your application.

Upvotes: 1

Related Questions