From 3dbae679ac4e7bc8fd6258050fd8c4ebeaea4099 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 3 Oct 2016 16:36:42 +0100 Subject: [PATCH] Access places response properly --- resources/assets/js/newnote.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/newnote.js b/resources/assets/js/newnote.js index e3322456..e8a05957 100644 --- a/resources/assets/js/newnote.js +++ b/resources/assets/js/newnote.js @@ -28,11 +28,11 @@ function addPlacesMap(latitude, longitude, uncertainty) { alertify.reset(); alertify.error(j.error_description); } - if (j.length > 0) { + if (j.places.length > 0) { var i; var places = []; 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 slug = j.places[i].slug; places.push([name, slug, latlng[0], latlng[1]]);