Рассчет расстояния для маршрута
This commit is contained in:
parent
b210ee11ba
commit
c5618bbd58
|
|
@ -1,6 +1,6 @@
|
|||
<div id="map"></div>
|
||||
<div id="routeWindow" class="popover fade in" style="display: none; position: absolute; top: 50px; right: 7px; left: auto;">
|
||||
<h3 class="popover-title">Мой маршрут</h3>
|
||||
<h3 class="popover-title">Мой маршрут <b id="routeDistance"></b></h3>
|
||||
<div class="popover-content">
|
||||
<ul id="wayPoints"></ul>
|
||||
<button class="btn btn-default" onclick="buildRoute()"><span class="glyphicon glyphicon-send"></span> Проложить</button>
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ function buildRoute()
|
|||
});
|
||||
|
||||
myMap.geoObjects.add(route);
|
||||
distance = Math.round(route.getLength() / 1000);
|
||||
$('#routeDistance').text(distance + ' км.')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue