Случайна точка
This commit is contained in:
parent
d9134fae03
commit
75fc4e290d
|
|
@ -27,6 +27,8 @@
|
|||
<a onclick="$('#howToUseModal').modal('show');" href="#">Как пользоваться</a><br/>
|
||||
<a onclick="$('#categoriesModal').modal('show');" href="#">Легенда</a><br/>
|
||||
<a href="/page/points">Список точек</a><br/>
|
||||
<br/>
|
||||
<a href="/?point=random">Случайная точка</a>
|
||||
</div>
|
||||
<div id="boxLayers">
|
||||
<h3>Карты</h3>
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue