Skip to main content

Posts

Showing posts from January, 2010

Google map API + Encoded polyline

Recently I downloaded  Subgurim's google map interfacing library for asp.net. It's cool library supporting many origin javascript functions of Google API. And the key point is that you can write a code directly inside server code(well mine is C#) , and you don't need to care server-client side integration. My aim was to display very long and complex trajectories in map. First I drew lines with Subgurim's AddPolyLine function, but it's quite slow , while zooming it takes 3-4 seconds to redraw lines. So by surfing net I found Encoded polylines which is very optimal way to display polylines. Encoded polyline is like a hashed key which stores lines with their different zoom level. Unfortunately Subgurim's library did not include encoded polyline functionality. So I added some manual code: private void AddEncodedPolyline(string polyLineID, List tracks, string color, string weight) { PolylineEncoder enc = new PolylineEncoder(); EncodedPolyl