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