I am integrating the MapQuest API Direction Routing function into my website. However, when I submit my request to the API, it returns incorrect routing points between 2 destinations.
Below is the request form I POST to the API: http://www.mapquestapi.com/directions/v2/route?key=[APIKEY]
{
"locations": [
{
"latLng": {
"lat": 37.47601247,
"lng": 126.96594338
}
},
{
"latLng": {
"lat": 37.4713402954355,
"lng": 126.95234849232048
}
}
],
"options": {
"avoids": [],
"avoidTimedConditions": false,
"doReverseGeocode": false,
"enhancedNarrative": true,
"generalize": 0,
"narrativeType": "text",
"routeType": "fastest",
"shapeFormat": "raw",
"unit": "k"
}
}
And the results that I received, I used the startPoint.lng
and startPoint.lat
in the maneuvers
, but that doesn't seem to be correct
Below is the return results and map illustrations:
{
"route": {
"sessionId": "AHEA5gcAAFMBAAANAAAAMgAAAIQAAAB42mNoYWBgZGJgYGDPSC1KtUrOfcOaA-IybLykdYbrcqHnrSM-y6L8v3nd4t63PIoBC0DXeI7hyGImxx9ut9iLl0YdZPO69S5mBVaNILAwZvIzEA0AW5Egkyj61e4:car",
"realTime": 31,
"distance": 0.6,
"time": 31,
"formattedTime": "00:00:31",
"hasHighway": false,
"hasTollRoad": false,
"hasBridge": false,
"hasSeasonalClosure": false,
"hasTunnel": false,
"hasFerry": false,
"hasUnpaved": false,
"hasTimedRestriction": false,
"hasCountryCross": false,
"shape": {
"shapePoints": [
37.483936,
126.974279,
37.48681,
126.96995,
37.487346,
126.969139
],
"legIndexes": [
0,
3
],
"maneuverIndexes": [
0,
2
]
},
"legs": [
{
"index": 0,
"hasTollRoad": false,
"hasHighway": false,
"hasBridge": false,
"hasUnpaved": false,
"hasTunnel": false,
"hasSeasonalClosure": false,
"hasFerry": false,
"hasCountryCross": false,
"hasTimedRestriction": false,
"distance": 0.6,
"time": 31,
"formattedTime": "00:00:31",
"origIndex": 0,
"origNarrative": "",
"destIndex": 0,
"destNarrative": "",
"maneuvers": [
{
"index": 0,
"distance": 0.6,
"narrative": "Head northwest. Go for 591 m.",
"time": 31,
"direction": 2,
"directionName": "Northwest",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:31",
"transportMode": "car",
"startPoint": {
"lng": 126.974279,
"lat": 37.483936
},
"turnType": 0,
"mapUrl": "",
"attributes": 0,
"iconUrl": "",
"streets": []
},
{
"index": 1,
"distance": 0,
"narrative": "Arrive at your destination.",
"time": 0,
"direction": 0,
"directionName": "None",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:00",
"transportMode": "car",
"startPoint": {
"lng": 126.969139,
"lat": 37.487345999999995
},
"turnType": 0,
"mapUrl": "",
"attributes": 0,
"iconUrl": "",
"streets": []
}
]
}
],
"options": {
"avoids": [],
"avoidTimedConditions": false,
"doReverseGeocode": false,
"enhancedNarrative": true,
"generalize": 2,
"narrativeType": "text",
"routeType": "FASTEST",
"shapeFormat": "raw",
"unit": "K",
"walkingSpeed": -1,
"highwayEfficiency": 22,
"locale": "en_US",
"useTraffic": false,
"timeType": 0,
"dateType": 0,
"sideOfStreetDisplay": true
},
"boundingBox": {
"ul": {
"lng": 126.969139,
"lat": 37.487345999999995
},
"lr": {
"lng": 126.974279,
"lat": 37.483936
}
},
"routeWarnings": [],
"maxRoutes": "",
"locations": [
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "",
"adminArea5Type": "City",
"adminArea4": "",
"adminArea4Type": "County",
"adminArea3": "",
"adminArea3Type": "State",
"adminArea1": "",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "XXXXX",
"geocodeQuality": "LATLNG",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "0",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 37.47601247,
"lng": 126.96594338
},
"displayLatLng": {
"lat": 37.47601247,
"lng": 126.96594338
}
},
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "",
"adminArea5Type": "City",
"adminArea4": "",
"adminArea4Type": "County",
"adminArea3": "",
"adminArea3Type": "State",
"adminArea1": "",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "XXXXX",
"geocodeQuality": "LATLNG",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "0",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 37.4713402954355,
"lng": 126.95234849232048
},
"displayLatLng": {
"lat": 37.4713402954355,
"lng": 126.95234849232048
}
}
],
"locationSequence": [
0,
1
]
},
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2022 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2022 MapQuest, Inc."
},
"messages": []
}
}
Are there any parameters I have to adjust to archive the correct information? I have tried to change generalize
parameter but it does not help much. I used to get the location really precise about a month ago... This is strange to me
MapQuest's map/route data in South Korea is lacking a lot of detail. We hope some day to have more detailed routing in the area.