Скрытие списка точек при подгрузке роута из урла и при проклыдывании маршрута по кнопке 'проложить'
This commit is contained in:
parent
39c7abe761
commit
498851352a
|
|
@ -51,7 +51,7 @@
|
||||||
<h3>Маршрут</h3>
|
<h3>Маршрут</h3>
|
||||||
<div id="wayPoints"></div>
|
<div id="wayPoints"></div>
|
||||||
<div id="routeDistance"></div>
|
<div id="routeDistance"></div>
|
||||||
<button class="btn btn-info" onclick="buildRoute()"><span class="glyphicon glyphicon-send"></span> Проложить</button>
|
<button class="btn btn-info" onclick="buildRoute(true)"><span class="glyphicon glyphicon-send"></span> Проложить</button>
|
||||||
<?php if ($user): ?>
|
<?php if ($user): ?>
|
||||||
<button class="btn btn-default" onclick="saveRoute()"><span class="glyphicon glyphicon-cloud-upload" title="Сохранить"></span></button>
|
<button class="btn btn-default" onclick="saveRoute()"><span class="glyphicon glyphicon-cloud-upload" title="Сохранить"></span></button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ function initPoints()
|
||||||
} else if (getURLParameter('route') != 'null')
|
} else if (getURLParameter('route') != 'null')
|
||||||
{
|
{
|
||||||
loadRouteJSON(getURLParameter('route'));
|
loadRouteJSON(getURLParameter('route'));
|
||||||
buildRoute();
|
buildRoute(true);
|
||||||
} else if ((getURLParameter('lat') != 'null') && (getURLParameter('lng') != 'null') && (getURLParameter('zoom') != 'null'))
|
} else if ((getURLParameter('lat') != 'null') && (getURLParameter('lng') != 'null') && (getURLParameter('zoom') != 'null'))
|
||||||
{
|
{
|
||||||
myMap.setView([getURLParameter('lat'), getURLParameter('lng')], getURLParameter('zoom'));
|
myMap.setView([getURLParameter('lat'), getURLParameter('lng')], getURLParameter('zoom'));
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
* Строит маршрут по выбранным точкам.
|
* Строит маршрут по выбранным точкам.
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
function buildRoute()
|
function buildRoute(fit)
|
||||||
{
|
{
|
||||||
wayPoints = Array();
|
wayPoints = Array();
|
||||||
if (route)
|
if (route)
|
||||||
|
|
@ -51,7 +51,11 @@ function buildRoute()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
myMap.fitBounds(bounds).zoomOut();
|
if (fit === true)
|
||||||
|
{
|
||||||
|
closeBox();
|
||||||
|
myMap.fitBounds(bounds).zoomOut();
|
||||||
|
}
|
||||||
|
|
||||||
routeToURL();
|
routeToURL();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue