There are several discussions regarding this topic in the group. Here a just a couple:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/c03a8115e2baf980/39cc9ebf23cbc500 http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/8b994d53c9decc14/fef6f1c7e61ce840 Basically it summarized down to encoded polylines don't really save you much except for transmission speed. If you have a HUGE number of points in your polys, you might want to look at Berry Ratliff's classes as they offer some pretty impressive performance for complex polys. I store mine as LatLng pairs and convert them to LatLng objects on the client. Chad Killingsworth On Oct 4, 1:00 am, spoco2 <[email protected]> wrote: > Hi all, > > I am at a loss as to how to neatly define a complex path polygon/ > polyline (think a postcode boundary) in V3 of the API compared to V2. > > We have an app that currently uses the V2 API to draw about 50 complex > polygons at a time on a map. This we do using encoded polygons. So one > complex polygon could be represented as: > > "d{xefubzsz`bquxn{hlzu`...@jfcuro@c...@jn@b...@prbo@y| > @l[ygi...@zat@mnq^diqiblzas...@}erf}eaho@kUrAdH" > > for example. That's a lot of points in a nice, concise string. > > Now, in V3 I see there is no such GPolygon.fromEncoded() method, and > instead we are supposed to define polygons via code like: > var coords= [ > new google.maps.LatLng(25.774252, -80.190262), > new google.maps.LatLng(18.466465, -66.118292), > new google.maps.LatLng(32.321384, -64.75737), > new google.maps.LatLng(25.774252, -80.190262) > ]; > > Which, for that very example above turns out like as a few pages of > this editbox full of 'new google.maps.LatLng' definitions. This seems > horrendously inefficient. > > I know I can send them as purely an array of points and then on the > client step over that doing the same, but that seems just as bad. > > Surely there is a more effiecient way of defining a complex polygon > now? -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
