If one is dealing with hundreds of polylines, would there be a big performance benefit to encoding the polylines using https://developers.google.com/maps/documentation/utilities/polylinealgorithm?hl=sv-SE
It seems that this is mostly used with API v2 and v3 handles large amounts of polylines on its own fairly well?
I can’t seem to find any benchmark comparisons.
There is a substantial gain when using
google.maps.geometry.encoding.decodePath()to decode encoded paths when adding a polyling/polygon to a google map. I have a couple of paths with over a thousand points, and instead of looping through each point and creating a LatLng to be added to a Polygon, a simple decode loads visually quicker.Additionally as Salman pointed out, there can be a substantial gain by reducing network traffic for passing paths via Ajax. Take google’s example:
With only 3 points we’ve reduced the the size of the points by 33%.