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