Try the Compute Routes demo
Stay organized with collections
Save and categorize content based on your preferences.
The Routes API Compute Routes demo lets you
specify an origin and destination as a latitude/longitude coordinates pair or
as a place ID. To copy the latitude/longitude coordinates, find and click a
location on the map, and then paste the location into the form.
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.
After you select Get route, the demo displays the response from the
computeRoutes method as a route on
the map.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-26 UTC.
[null,null,["Last updated 2025-08-26 UTC."],[],[],null,["# Try the Compute Routes demo\n\nThe Routes API Compute Routes demo lets you\nspecify an origin and destination as a latitude/longitude coordinates pair or\nas a place ID. To copy the latitude/longitude coordinates, find and click a\nlocation on the map, and then paste the location into the form.\n\nIf you have an encoded polyline or a GeoJSON linestring, and you'd like to\nview the polyline on map, go to\n[Interactive polyline decoder utility](/maps/documentation/routes/polylinedecoder).\n\nAfter you select **Get route** , the demo displays the response from the\n[computeRoutes](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes) method as a route on\nthe map. \nerror\n[×](#) \n\nInput locations\n---------------\n\nOrigin\\* \nHeading \nStopover Side of Road\n\n*** ** * ** ***\n\nDestination\\* \nHeading \nStopover Side of Road\n\nTravel Mode\n-----------\n\nDrive Walk Bicycle Two Wheeler (two-wheeled motorized vehicle) Transit \n\n### Transit Modes\n\n- [x] Bus\n- [x] Subway\n- [x] Train\n- [x] Light rail\n- [x] Rail \n\n### Transit Routing Preference\n\nNo preference Less walking Fewer transfers\n\nDeparture Time (Your local time)\n--------------------------------\n\nChoose your **local time** . The selected time will be converted to **UTC format time**.\n\nIf you set the departure time, the routing preference has to be either TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL. TRAFFIC_AWARE_OPTIMAL calculates best routes by factoring in real-time road conditions, including closures. \n\n\u003cbr /\u003e\n\nRoute Options\n-------------\n\n### Polyline Quality\n\nHigh quality Overview \n\n### Traffic Awareness\n\nTraffic unaware Traffic aware Traffic aware optimal (best routes with accurate ETA) \n\n### Traffic Aware Polyline\n\n### Route Modifiers (Optional)\n\n- [ ] Avoid tolls\n- [ ] Avoid highways\n- [ ] Avoid ferries\n- [ ] Avoid indoor\n\nReference routes\n----------------\n\n### Alternative Routes\n\n*** ** * ** ***\n\n### Eco-friendly Routes\n\n### Emission Type\n\nGasoline Electric Hybrid Diesel [Get route](#) \nLat/Lng are copied to clipboard"]]