Я получаю информацию о маршруте из HERE Maps Routing API, используя этот вызов REST:
"https://route.api.here.com/routing/7.2/calculateroute.json?" +
"waypoint0=34.045535,-118.222708&waypoint1=34.045142,-118.235551" +
"&mode=fastest;car;traffic:disabled&departure=now&app_id=[appID]&app_code=[appCode]"
Вызов работает, и это ответ:
{
"response": {
"metaInfo": {
"timestamp": "2020-04-05T09:06:42Z",
"mapVersion": "8.30.107.152",
"moduleVersion": "7.2.202013-6774",
"interfaceVersion": "2.6.76",
"availableMapVersion": [
"8.30.107.152"
]
},
"route": [
{
"waypoint": [
{
"linkId": "-1252788623",
"mappedPosition": {
"latitude": 34.0452509,
"longitude": -118.2226727
},
"originalPosition": {
"latitude": 34.0455349,
"longitude": -118.222708
},
"type": "stopOver",
"spot": 0.4571429,
"sideOfStreet": "right",
"mappedRoadName": "E 3rd St",
"label": "E 3rd St",
"shapeIndex": 0,
"source": "user"
},
{
"linkId": "+23907924",
"mappedPosition": {
"latitude": 34.0450604,
"longitude": -118.2356195
},
"originalPosition": {
"latitude": 34.045142,
"longitude": -118.235551
},
"type": "stopOver",
"spot": 0.6229508,
"sideOfStreet": "right",
"mappedRoadName": "Traction Ave",
"label": "Traction Ave",
"shapeIndex": 20,
"source": "user"
}
],
"mode": {
"type": "fastest",
"transportModes": [
"car"
],
"trafficMode": "disabled",
"feature": []
},
"leg": [
{
"start": {
"linkId": "-1252788623",
"mappedPosition": {
"latitude": 34.0452509,
"longitude": -118.2226727
},
"originalPosition": {
"latitude": 34.0455349,
"longitude": -118.222708
},
"type": "stopOver",
"spot": 0.4571429,
"sideOfStreet": "right",
"mappedRoadName": "E 3rd St",
"label": "E 3rd St",
"shapeIndex": 0,
"source": "user"
},
"end": {
"linkId": "+23907924",
"mappedPosition": {
"latitude": 34.0450604,
"longitude": -118.2356195
},
"originalPosition": {
"latitude": 34.045142,
"longitude": -118.235551
},
"type": "stopOver",
"spot": 0.6229508,
"sideOfStreet": "right",
"mappedRoadName": "Traction Ave",
"label": "Traction Ave",
"shapeIndex": 20,
"source": "user"
},
"length": 1743,
"travelTime": 201,
"maneuver": [
{
"position": {
"latitude": 34.0452509,
"longitude": -118.2226727
},
"instruction": "Head <span class=\"heading\">west</span> on <span class=\"street\">E 3rd St</span>. <span class=\"distance-description\">Go for <span class=\"length\">39 m</span>.</span>",
"travelTime": 19,
"length": 39,
"id": "M1",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 34.0452147,
"longitude": -118.2231045
},
"instruction": "Turn <span class=\"direction\">left</span> onto <span class=\"next-street\">S Gless St</span>. <span class=\"distance-description\">Go for <span class=\"length\">258 m</span>.</span>",
"travelTime": 46,
"length": 258,
"id": "M2",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 34.0429187,
"longitude": -118.2227612
},
"instruction": "Turn <span class=\"direction\">right</span> onto <span class=\"next-street\">E 4th St</span>. <span class=\"distance-description\">Go for <span class=\"length\">1.1 km</span>.</span>",
"travelTime": 84,
"length": 1120,
"id": "M3",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 34.0429831,
"longitude": -118.2341015
},
"instruction": "Turn <span class=\"direction\">right</span> onto <span class=\"next-street\">Merrick St</span>. <span class=\"distance-description\">Go for <span class=\"length\">112 m</span>.</span>",
"travelTime": 20,
"length": 112,
"id": "M4",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 34.043895,
"longitude": -118.2338119
},
"instruction": "Continue on <span class=\"next-street\">Traction Ave</span>. <span class=\"distance-description\">Go for <span class=\"length\">214 m</span>.</span>",
"travelTime": 32,
"length": 214,
"id": "M5",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 34.0450604,
"longitude": -118.2356195
},
"instruction": "Arrive at <span class=\"street\">Traction Ave</span>. Your destination is on the right.",
"travelTime": 0,
"length": 0,
"id": "M6",
"_type": "PrivateTransportManeuverType"
}
]
}
],
"summary": {
"distance": 1743,
"trafficTime": 203,
"baseTime": 201,
"flags": [
"builtUpArea"
],
"text": "The trip takes <span class=\"length\">1.7 km</span> and <span class=\"time\">3 mins</span>.",
"travelTime": 201,
"_type": "RouteSummaryType"
}
}
],
"language": "en-us"
}
}
Это верно, за исключением того, что он не включает в себя все точки ссылки для маршрута. Этот снимок экрана с полученным маршрутом довольно понятен:
API возвращает точки ссылки, которые обозначают красную линию вместо зеленой линия, которая должна быть фактическим сухопутным маршрутом.
Я пропускаю какие-либо атрибуты, которые могут быть причиной этого?