Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/walking?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origin": {
- "lng": -4.66529,
- "lat": 54.216608
- },
- "destination": {
- "lng": -4.66552,
- "lat": 54.2166
- }
- }
Response:
- {
- "routes": [
- {
- "paths": [
- {
- "duration": 12,
- "durationInTraffic": 0,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "steps": [
- {
- "duration": 0,
- "orientation": 1,
- "distance": 0,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "action": "straight",
- "endLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "polyline": [
- {
- "lng": -4.66529,
- "lat": 54.216608
- },
- {
- "lng": -4.665291,
- "lat": 54.216608
- }
- ],
- "roadName": "Poortown Road"
- },
- {
- "duration": 12,
- "orientation": 1,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "action": "unknown",
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- },
- "polyline": [
- {
- "lng": -4.665291,
- "lat": 54.216608
- },
- {
- "lng": -4.665405,
- "lat": 54.21665
- },
- {
- "lng": -4.665446,
- "lat": 54.216666
- }
- ],
- "roadName": "Poortown Road"
- }
- ],
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- }
- }
- ],
- "bounds": {
- "southwest": {
- "lng": -4.6655219444444445,
- "lat": 54.21584277777778
- },
- "northeast": {
- "lng": -4.662165833333333,
- "lat": 54.21669555555555
- }
- }
- }
- ],
- "returnCode": "0",
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/walking?key=API KEY
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origin | M | Coordinate | Longitude and latitude of the departure place. |
| destination | M | Coordinate | Longitude and latitude of the destination. |
| language | O | String(<=6) | Language of the distance and journey time descriptions in the returned result. Currently, only zh_CN and en are supported. |
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to "Result Codes". |
| returnDesc | O | String | Result description. |
| routes | O | Route[] | Planned routes from the departure place to the destination. For details, please refer to "Parameters". |
Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/bicycling?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origin": {
- "lng": -4.66529,
- "lat": 54.216608
- },
- "destination": {
- "lng": -4.66552,
- "lat": 54.2166
- }
- }
Response:
- {
- "routes": [
- {
- "paths": [
- {
- "duration": 3,
- "durationInTraffic": 0,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "steps": [
- {
- "duration": 0,
- "orientation": 1,
- "distance": 0,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "action": "straight",
- "endLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "polyline": [
- {
- "lng": -4.66529,
- "lat": 54.216608
- },
- {
- "lng": -4.665291,
- "lat": 54.216608
- }
- ],
- "roadName": "Poortown Road"
- },
- {
- "duration": 12,
- "orientation": 1,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "action": "unknown",
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- },
- "polyline": [
- {
- "lng": -4.665291,
- "lat": 54.216608
- },
- {
- "lng": -4.665405,
- "lat": 54.21665
- },
- {
- "lng": -4.665446,
- "lat": 54.216666
- }
- ],
- "roadName": "Poortown Road"
- }
- ],
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- }
- }
- ],
- "bounds": {
- "southwest": {
- "lng": -4.6655219444444445,
- "lat": 54.21584277777778
- },
- "northeast": {
- "lng": -4.662165833333333,
- "lat": 54.21669555555555
- }
- }
- }
- ],
- "returnCode": "0",
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/bicycling?key=API KEY
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origin | M | Coordinate | Longitude and latitude of the departure place. |
| destination | M | Coordinate | Longitude and latitude of the destination. |
| language | O | String(<=6) | Language of the distance and journey time descriptions in the returned result. Currently, only zh_CN and en are supported. |
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to "Result Codes". |
| returnDesc | O | String | Result description. |
| routes | O | Route[] | Planned routes from the departure place to the destination. For details, please refer to "Parameters". |
Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/driving?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origin": {
- "lng": -4.66529,
- "lat": 54.216608
- },
- "destination": {
- "lng": -4.66552,
- "lat": 54.2166
- }
- }
Response:
- {
- "routes": [
- {
- "paths": [
- {
- "duration": 1,
- "durationInTraffic": 0,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "steps": [
- {
- "duration": 0,
- "orientation": 1,
- "distance": 0,
- "startLocation": {
- "lng": -4.665290197110473,
- "lat": 54.21660781838372
- },
- "action": "straight",
- "endLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "polyline": [
- {
- "lng": -4.66529,
- "lat": 54.216608
- },
- {
- "lng": -4.665291,
- "lat": 54.216608
- }
- ],
- "roadName": "Poortown Road"
- },
- {
- "duration": 1,
- "orientation": 1,
- "distance": 12,
- "startLocation": {
- "lng": -4.665290833333334,
- "lat": 54.216608055555554
- },
- "action": "unknown",
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- },
- "polyline": [
- {
- "lng": -4.665291,
- "lat": 54.216608
- },
- {
- "lng": -4.665405,
- "lat": 54.21665
- },
- {
- "lng": -4.665446,
- "lat": 54.216666
- }
- ],
- "roadName": "Poortown Road"
- }
- ],
- "endLocation": {
- "lng": -4.6654460345493955,
- "lat": 54.21666592137546
- }
- }
- ],
- "bounds": {
- "southwest": {
- "lng": -4.6655219444444445,
- "lat": 54.21584277777778
- },
- "northeast": {
- "lng": -4.662165833333333,
- "lat": 54.21669555555555
- }
- }
- }
- ],
- "returnCode": "0",
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/driving?key=API KEY
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origin | M | Coordinate | Longitude and latitude of the departure place. |
| destination | M | Coordinate | Longitude and latitude of the destination. |
| waypoints | O | Coordinate[] | Waypoints. You can specify up to 5 waypoints. |
| viaType | O | boolean | Waypoint type. The options are as follows:
|
| optimize | O | boolean | Indicates whether to optimize the waypoint.
|
| alternatives | O | boolean | Indicates whether to return multiple planned routes. The options are as follows:
Note: This parameter is unavailable when waypoints are set. |
| avoid | O | int[] | Indicates the specified type of roads to be avoided. The options are as follows:
If this parameter is not included in the request, the route taking the least time will be returned by default. |
| departAt | O | long | Estimated departure time, in seconds since 00:00 on January 1, 1970 (UTC). The value must be the current time or a future time. |
| trafficMode | O | int | Time estimation mode. The options are as follows:
|
| language | O | String(<=6) | Language of the distance and journey time descriptions in the returned result. Currently, only zh_CN and en are supported. |
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to "Result Codes". |
| returnDesc | O | String | Result description. |
| routes | O | Route[] | Planned routes from the departure place to the destination. For details, please refer to "Parameters". |