Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/walkingMatrix?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origins": [
- {"lng": 2.359782, "lat": 48.862544},
- {"lng": 2.358537, "lat": 48.861443}
- ],
- "destinations": [
- {"lng": 2.361702, "lat": 48.860420}
- ],
- "language": "en"
- }
Response:
- {
- "originAddresses": [
- "3e Arrondissement, Paris, Ile-de-France, France",
- "3e Arrondissement, Paris, Ile-de-France, France"
- ],
- "returnCode": "0",
- "destinationAddresses": [
- "3e Arrondissement, Paris, Ile-de-France, France"
- ],
- "rows": [
- {
- "cells": [
- {
- "duration": 268,
- "durationText": "4min",
- "distance": 353,
- "distanceText": "353m",
- "status": 0
- }
- ]
- },
- {
- "cells": [
- {
- "duration": 256,
- "durationText": "4min",
- "distance": 352,
- "distanceText": "352m",
- "status": 0
- }
- ]
- }
- ],
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/walkingMatrix?key=API KEY
The following table describes the request parameters contained in the JSON body. For details about the parameters, please refer to Parameters.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origins | M | Coordinate[] | Longitudes and latitudes of the departure places. |
| destinations | M | Coordinate[] | Longitudes and latitudes of the destinations. A maximum of 5 destinations are allowed. |
| language | O | String(<=6) | Language of the distance and journey time descriptions in the returned result. Currently, only zh_CN and en are supported. |
Note: The linear distance between the departure place and destination cannot exceed 100 km.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to Result Codes. |
| returnDesc | O | String | Result description. |
| originAddresses | O | String[] | Departure place details. |
| destinationAddresses | O | String[] | Destination details. |
| rows | O | Row[] | Distances and journey time of routes between departure places and destinations. For details, please refer to Parameters. |
Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/bicyclingMatrix?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origins": [
- {"lng": 2.359782, "lat": 48.862544}
- ],
- "destinations": [
- {"lng": 2.361702, "lat": 48.860420}
- ],
- "language": "en"
- }
Response:
- {
- "originAddresses": [
- "3e Arrondissement, Paris, Ile-de-France, France"
- ],
- "returnCode": "0",
- "destinationAddresses": [
- "3e Arrondissement, Paris, Ile-de-France, France"
- ],
- "rows": [
- {
- "cells": [
- {
- "duration": 137,
- "durationText": "2min",
- "distance": 353,
- "distanceText": "353m",
- "status": 0
- }
- ]
- }
- ],
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/bicyclingMatrix?key=API KEY
The following table describes the request parameters contained in the JSON body. For details about the parameters, please refer to Parameters.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origins | M | Coordinate[] | Longitudes and latitudes of the departure places. A maximum of 5 departure places are allowed. |
| destinations | M | Coordinate[] | Longitudes and latitudes of the destinations. A maximum of 5 destinations are allowed. |
| language | O | String(<=6) | Language of the distance and journey time descriptions in the returned result. Currently, only zh_CN and en are supported. |
Note: The linear distance between the departure place and destination cannot exceed 100 km.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to Result Codes. |
| returnDesc | O | String | Result description. |
| originAddresses | O | String[] | Departure place details. |
| destinationAddresses | O | String[] | Destination details. |
| rows | O | Row[] | Distances and journey time of routes between departure places and destinations. For details, please refer to Parameters. |
Request:
- POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/drivingMatrix?key=API KEY HTTP/1.1
- Content-Type: application/json
- Accept: application/json
- {
- "origins": [
- {"lng": -1.894679, "lat": 54.974887},
- {"lng": -2.882682, "lat": 54.857616}
- ],
- "destinations": [
- {"lng": -1.744955, "lat": 54.775040}
- ],
- "avoid": [1,2],
- "departAt":1678435530,
- "trafficMode":2,
- "language": "en"
- }
Response:
- {
- "originAddresses": [
- "Ovington, Northumberland, England, United Kingdom",
- "Saint Cuthbert Without, Carlisle, Cumbria, England, United Kingdom"
- ],
- "returnCode": "0",
- "destinationAddresses": [
- "Hedleyhope, Durham, England, United Kingdom"
- ],
- "rows": [
- {
- "cells": [
- {
- "duration": 2183,
- "durationText": "36min",
- "distance": 36129,
- "distanceText": "36.1km",
- "status": 0
- }
- ]
- },
- {
- "cells": [
- {
- "duration": 4888,
- "durationText": "1h21min",
- "distance": 104703,
- "distanceText": "104.7km",
- "status": 0
- }
- ]
- }
- ],
- "returnDesc": "OK"
- }
HTTP request:
POST https://mapapi.cloud.huawei.com/mapApi/v1/routeService/drivingMatrix?key=API KEY
The following table describes the request parameters contained in the JSON body. For details about the parameters, please refer to Parameters.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| origins | M | Coordinate[] | Longitudes and latitudes of the departure places. A maximum of 5 departure places are allowed. |
| destinations | M | Coordinate[] | Longitudes and latitudes of the destinations. A maximum of 5 destinations are allowed. |
| avoid | 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. |
Note: The linear distance between the departure place and destination cannot exceed 100 km.
| Parameter | Mandatory (M)/Optional (O) | Type | Description |
| returnCode | M | String | Result code. For details, please refer to Result Codes. |
| returnDesc | O | String | Result description. |
| originAddresses | O | String[] | Departure place details. |
| destinationAddresses | O | String[] | Destination details. |
| rows | O | Row[] | Distances and journey time of routes between departure places and destinations. For details, please refer to Parameters. |