From 3face5f2f4f87640b920bad1fc72567828599758 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Thu, 3 Sep 2015 19:48:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D0=BB=20=D0=B2=D1=8B=D0=B4=D0=B0=D1=87=D1=83=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=B5=D0=BA=20=D0=B2=20JSON=20=D0=B2=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B5=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=20=D1=81=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/JsonController.php | 15 ++++++++------- public/js/map.js | 6 +++--- public/js/mapPoint.js | 10 +++++----- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ground/controllers/JsonController.php b/ground/controllers/JsonController.php index 5615831..425ce2b 100644 --- a/ground/controllers/JsonController.php +++ b/ground/controllers/JsonController.php @@ -29,13 +29,14 @@ class JsonController extends Controller $result = array(); foreach ($points as $point) { - $id = $point->id; - $result[$id]['id'] = $point->id; - $result[$id]['name'] = $point->name; - $result[$id]['lat'] = $point->lat; - $result[$id]['lng'] = $point->lng; - $result[$id]['categoryId'] = $point->categoryId; - $result[$id]['moderate'] = $point->moderate ? 'show' : 'hide'; + $tempPoint['id'] = $point->id; + $tempPoint['name'] = $point->name; + $tempPoint['lat'] = $point->lat; + $tempPoint['lng'] = $point->lng; + $tempPoint['categoryId'] = $point->categoryId; + $tempPoint['moderate'] = $point->moderate ? 'show' : 'hide'; + + $result[] = $tempPoint; } self::renderPartial('json.php', array( diff --git a/public/js/map.js b/public/js/map.js index bd6b179..5cb2ecb 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -189,9 +189,9 @@ function initPoints(useBounds) bounds: bounds }, success: function (data) { - for (var k in data) { - if (typeof points[k] == 'undefined') { - markers.addLayer(constructPoint(data[k])); + for(var i=0; i