Routing
Documentation¶
URL Structure
Parameters
Examples
Response structure
URL Structure¶
http://routes.cloudmade.com/YOUR-API-KEY-GOES-HERE/api/0.3/start_point,[transit_point1,...,transit_pointN],end_point/route_type[/route_type_modifier].output_format[?lang=(Two letter ISO 3166-1 code)][&units=(km|miles)]
Parameters¶
Common parameters¶
| start_point | latitude, logitude of the start point of the route separated by the comma (lat,lon) |
|---|---|
| end_point | latitude, logitude of the end point of the route separated by the comma (lat,lon) |
| route_type | type of the route ("car", "foot", "bicycle") |
| output_format | format of the output results ("js", "gpx") |
Optional parameters¶
| transit_points | list of points (lat,lon) that the route must visit (in specified order) before reach end_point. List of transit points should be passed in square brackets, e.g [51.2227,4.4120,51.2,4.41] |
|---|---|
| route_type_modifier | modifier of the route type, for now only valid values are "shortest" & "fastest" for route type "car" |
| lang | iso 2 characters code for language for the route instructions, if missing taken from the Accept-Language header, default is en. Possible values are: de, en, es, fr, hu, it, nl, ro, ru, se, vi, zh. Add new translation: Routing_translation |
| units | measure units for distance calculation (km or miles). Default - km |
| callback | optional parameter for JS response, if specified response will be wrapped into the function call. e.g. if callback=routeLoaded, response will be routeLoaded(JSON_object) |
Examples¶
http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/47.25976,9.58423,47.26117,9.59882/car/shortest.js http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/47.25976,9.58423,47.26117,9.59882/bicycle.gpx http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/51.22545,4.40730,[51.22,4.41,51.2,4.41],51.23,4.42/car.js?lang=de&units=miles
Start Developing
Use our location services for:
- games
- apps with maps
- social apps
- travel
- and other types of apps ...
