From 4b4514d559d7438c093c12f75eb2e6615baf5b6b Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sat, 3 May 2014 22:12:03 +0400 Subject: [PATCH] =?UTF-8?q?ADD=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D1=82=D1=8C=20=D1=81=D0=B5=D0=B1=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D0=BC=D0=B0=D1=80=D1=88=D1=80=D1=83=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/main.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 6cfe031..d5b9d22 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -6,7 +6,6 @@ ymaps.ready(init); var myMap; var categories; var points = Array(); -var im; var search; var route = false; @@ -56,11 +55,15 @@ function init() { } }); - im = new ymaps.Placemark( + points.im = new ymaps.Placemark( [ymaps.geolocation.latitude, ymaps.geolocation.longitude], { balloonContentHeader: 'Вы здесь', - balloonContent: '' + hintContent: 'Ваше местоположение', + balloonContent: + '' }, { iconImageHref: '/ico/man.png', @@ -68,7 +71,7 @@ function init() { iconImageOffset: [-16, -33], } ); - myMap.geoObjects.add(im); + myMap.geoObjects.add(points.im); $("#wayPoints").sortable(); $("#wayPoints").disableSelection(); @@ -180,11 +183,11 @@ function searchAdderess() function showMeOnTheMap() { navigator.geolocation.getCurrentPosition(function(pos) { - im.geometry.setCoordinates([pos.coords.latitude, pos.coords.longitude]); - myMap.setCenter(im.geometry.getCoordinates()); + points.im.geometry.setCoordinates([pos.coords.latitude, pos.coords.longitude]); + myMap.setCenter(points.im.geometry.getCoordinates()); }); - myMap.setCenter(im.geometry.getCoordinates()); + myMap.setCenter(points.im.geometry.getCoordinates()); } function activateAddPoint()