diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index 54c736a..ca65481 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -27,6 +27,8 @@ Как пользоваться
Легенда
Список точек
+
+ Случайная точка

Карты

diff --git a/public/js/map.js b/public/js/map.js index 70847b7..9fe7a5f 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -121,7 +121,20 @@ function initPoints() if (getURLParameter('point') != 'null') { - showInfo(getURLParameter('point')); + if (getURLParameter('point') == 'random') + { + roundIndex = Math.floor(Math.random()*points.length); + runner = 0; + for(var key in points) + { + if(runner++ >= roundIndex) + return showInfo(key); + } + } + else + { + showInfo(getURLParameter('point')); + } } else if (getURLParameter('route') != 'null') { loadRouteJSON(getURLParameter('route'));