Interactive Polyline Encoder Utility

This utility uses the Maps JavaScript API. Specifically, encoding and decoding of paths are handled by the static methods encodePath() and decodePath in the google.maps.geometry.encoding namespace. See the Encoded Polyline Algorithm Format for information about the encoding scheme.

Google Maps generates a simple polyline from two or more latitude/longitude coordinates. Learn more about simple polylines and complex polylines in the JavaScript API documentation.

If you have an encoded polyline or a GeoJSON linestring, and you'd like to view the polyline on map, go to Interactive polyline decoder utility.

Click this interactive map to add polyline coordinates. Use the results to obtain an encoded polyline for use in your application.

  1. Click on the map to place the first location of your polyline. You can drag the marker to adjust the location.
  2. Click the Add Location button to add the location to the Locations list.
  3. Repeat for each location on your polyline.
  4. The polyline encoding appears in the Encoded Polyline
  5. Click the Delete All Locations button to clear the Locations list before decoding a new polyline.