diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index 71f5ebe..5a34d3f 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -28,7 +28,7 @@ Легенда
Список точек

- Случайная точка + Случайная точка


Группа ВКонтакте diff --git a/public/js/map.js b/public/js/map.js index 3b355ff..b80e63f 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -133,13 +133,7 @@ function initPoints() { if (getURLParameter('point') == 'random') { - roundIndex = Math.floor(Math.random()*points.length); - runner = 0; - for(var key in points) - { - if(runner++ >= roundIndex) - return showInfo(key); - } + showRandomPoint(); } else { @@ -230,6 +224,17 @@ function showInfo(id) } } +function showRandomPoint() +{ + roundIndex = Math.floor(Math.random()*points.length); + runner = 0; + for(var key in points) + { + if(runner++ >= roundIndex) + return showInfo(key); + } +} + /** * Загружает с сервера список категорий точек. * @returns {Boolean}