encoding and decoding of paths are handled by the static methods
decodePath in the
See the Encoded Polyline Algorithm
Format for information about the encoding scheme.
Polylines in Google Maps are formed as a set of latitude/longitude pairs. In addition, for each vertex (location) in an encoded polyline, a level can be specified indicating that the location should appear on that level and any level higher (i.e. any decrease in zoom.). If a location does not appear on a given level, then the line will go from the last visible location to the next visible location. Note that the first and last locations must be Level 3 points, otherwise the polyline won't display on all levels.
You can use this interactive utility to compute the encoding for a polyline.
1. Click on the map to place the first location of your polyline. You may drag the
marker to adjust the location of the location.
2. If necessary, specify the appropriate level for the location in the "Min zoom level" field.
3. Click the "Add Location" button to add it to the Locations List.
4. Repeat for each location of your polyline.
5. The polyline encoding will appear in the Encoded Polyline and Encoded Levels fields below. Use these values for
levels when you