Thursday, 27 November 2008

C# Google Maps Polyline encoder

I've started the csharp-polyline-encoder project to encode polylines using C# after reading this post. It is just a direct translation of the Java version of the original polyline encoder.

One thing to watch out for - the main class escapes backslashes in the encoding for when the data is output to javascript. If you are using something like Json.NET to write out the encoded polylines, it will escape the backslashes again causing the line to be plotted incorrectly. I'll take out the escaping code at some point...

0 comments: