Dear All,
I am using an api to search for address data. The Data I get back looks as follows:
{
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2020 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2020 MapQuest, Inc."
},
"messages": []
},
"options": {
"maxResults": 4,
"thumbMaps": true,
"ignoreLatLngInput": false
},
"results": [
{
"providedLocation": {
"location": "Kaiserstrasse, Frankfurt"
},
"locations": [
{
"street": "Kaiserstraße",
"adminArea5": "Frankfurt",
"adminArea5Type": "City",
"adminArea1": "DE",
"adminArea1Type": "Country",
"postalCode": "60311",
"geocodeQuality": "STREET",
"latLng": {
"lat": 50.110525,
"lng": 8.675396
},
"mapUrl": "http://open.mapquestapi.com/staticmap/v5/map?key=U1tglbAv9Ib2uvRHK407DFON51co2FD1&type=map&size=225,160&locations=50.1105246,8.6753957|marker-sm-50318A-1&scalebar=true&zoom=15&rand=-1278117604"
},
{
"street": "Kaiserstraße",
"adminArea5": "Kelsterbach",
"adminArea5Type": "City",
"adminArea1": "DE",
"adminArea1Type": "Country",
"postalCode": "60329",
"geocodeQuality": "STREET",
"latLng": {
"lat": 50.108349,
"lng": 8.668294
},
"mapUrl": "http://open.mapquestapi.com/staticmap/v5/map?key=U1tglbAv9Ib2uvRHK407DFON51co2FD1&type=map&size=225,160&locations=50.1083489,8.6682939|marker-sm-50318A-3&scalebar=true&zoom=15&rand=1243864394"
}
]
}
]
}
I would like to work with the locations inside results. Somehow I am not able to access the locations.
My logic is fairly Basic:
data.OpenMapsApi1 does not allow me to access anything like data.OpenMapsApi1.locations or data.OpenMapsApi1[0] …
Any idea, what I am doing wrong?
Thanks in advance,
Tobias