Access places response properly
This commit is contained in:
parent
c8890f3033
commit
3dbae679ac
1 changed files with 2 additions and 2 deletions
|
@ -28,11 +28,11 @@ function addPlacesMap(latitude, longitude, uncertainty) {
|
||||||
alertify.reset();
|
alertify.reset();
|
||||||
alertify.error(j.error_description);
|
alertify.error(j.error_description);
|
||||||
}
|
}
|
||||||
if (j.length > 0) {
|
if (j.places.length > 0) {
|
||||||
var i;
|
var i;
|
||||||
var places = [];
|
var places = [];
|
||||||
for (i = 0; i < j.places.length; ++i) {
|
for (i = 0; i < j.places.length; ++i) {
|
||||||
var latlng = parseLocation(j[i].location);
|
var latlng = parseLocation(j.places[i].location);
|
||||||
var name = j.places[i].name;
|
var name = j.places[i].name;
|
||||||
var slug = j.places[i].slug;
|
var slug = j.places[i].slug;
|
||||||
places.push([name, slug, latlng[0], latlng[1]]);
|
places.push([name, slug, latlng[0], latlng[1]]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue