|
|
|
@ -94,7 +94,7 @@ function rebuildRegionPointsList(region) {
|
|
|
|
|
$('<h3>').text(data.text).appendTo(result);
|
|
|
|
|
$('<i>').text(data.description).appendTo(result);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).dxList('instance');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -133,6 +133,7 @@ function rebuildSelectedPointsList(selectedPointsIndexes) {
|
|
|
|
|
dataSource: selected,
|
|
|
|
|
keyExpr: 'id',
|
|
|
|
|
height: 400,
|
|
|
|
|
width: '100%',
|
|
|
|
|
showScrollbar: 'always',
|
|
|
|
|
itemDragging: {
|
|
|
|
|
allowReordering: true,
|
|
|
|
@ -162,20 +163,36 @@ function rebuildSelectedPointsList(selectedPointsIndexes) {
|
|
|
|
|
}).dxList('instance');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initRecalculateWaypointsButton(){
|
|
|
|
|
// Инициализация кнопки для расчета маршрута
|
|
|
|
|
function initRecalculateWaypointsButton() {
|
|
|
|
|
$('#recalculateWaypointsButton').dxButton({
|
|
|
|
|
stylingMode: 'contained',
|
|
|
|
|
text: 'Рассчитать маршрут',
|
|
|
|
|
type: 'default',
|
|
|
|
|
width: 220,
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 40,
|
|
|
|
|
onClick() {
|
|
|
|
|
recalculateWaypoints();
|
|
|
|
|
recalculateWaypoints(selectedPointsWidget.option('items'));
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function recalculateWaypoints(){
|
|
|
|
|
DevExpress.ui.notify('The Text button was clicked');
|
|
|
|
|
// Вычисление оптимального маршрута по начальной и конечной точке
|
|
|
|
|
function recalculateWaypoints(waypoints) {
|
|
|
|
|
if (!waypoints || waypoints.length < 2) {
|
|
|
|
|
DevExpress.ui.notify("Недостаточно точек для построения маршрута");
|
|
|
|
|
} else {
|
|
|
|
|
var start = waypoints[0];
|
|
|
|
|
var end = waypoints[waypoints.length - 1];
|
|
|
|
|
DevExpress.ui.notify("Расчет маршрута от '" + start.text + "' к '" + end.text + "'");
|
|
|
|
|
if (waypoints.length == 2) {
|
|
|
|
|
|
|
|
|
|
} else if (waypoints.length == 3) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(() => {
|
|
|
|
|