[Google Maps API v3] Encoded polylines?

227 views
Skip to first unread message

Hadmut

unread,
May 21, 2010, 6:53:31 AM5/21/10
to Google Maps JavaScript API v3
Hi,

about 3 years ago I wrote a little app making use of Googlemaps,
drawing walking tracks as lines on a map. I used the encoding
algorithm described under http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html
to compress the array of positions.

Now I want to update that app to use the v3 API, but at the moment I
don't see how to how to use that with the new polyline API.

Has that compression method been deprecated?


regards

--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Rossko

unread,
May 21, 2010, 12:51:49 PM5/21/10
to Google Maps JavaScript API v3
> Now I want to update that app to use the v3 API, but at the moment I
> don't see how to how to use that with the new polyline API.

See
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/e83925f34b2b4b76/a150242a14568049
Not so much deprecated as not implemented yet ?
No-one seems to have raised a formal enhancement request that I can
find.

Dave

unread,
May 22, 2010, 10:06:36 PM5/22/10
to Google Maps JavaScript API v3
Unfortunately, that's already marked as "wontfix" which means it won't
be implemented.
http://code.google.com/p/gmaps-api-issues/issues/detail?id=2246

Really unfortunate because the encoding is a nice way to store lines
and transfer via AJAX. You'll have to decode them and create the lines
from lat/long points.

Dave

On May 21, 3:53 am, Hadmut <had...@googlemail.com> wrote:
> Hi,
>
> about 3 years ago I wrote a little app making use of Googlemaps,
> drawing walking tracks as lines on a map. I used the encoding
> algorithm described underhttp://code.google.com/apis/maps/documentation/utilities/polylinealgo...

Chad Killingsworth

unread,
May 22, 2010, 11:18:45 PM5/22/10
to Google Maps JavaScript API v3
Just store and pass the array of points. Personally, I wrote a
function that took an Array of Lat Lng pairs and returned a polyline.
Works just as well via Ajax - and you don't have to deal with the
complexity of encoded polylines.

Chad KIllingsworth

On May 22, 9:06 pm, Dave <dualrud...@gmail.com> wrote:
> Unfortunately, that's already marked as "wontfix" which means it won't
> be implemented.http://code.google.com/p/gmaps-api-issues/issues/detail?id=2246

Esa

unread,
May 24, 2010, 2:42:03 PM5/24/10
to Google Maps JavaScript API v3
You can find the decoder function in the Google Polyline Utility
source code. Search for function decodeLine().

Bratliff posted his decoder on this forum.
http://home.provide.net/~bratliff/polyextract.js
Reply all
Reply to author
Forward
0 new messages