FIX цвет линии маршрута

This commit is contained in:
Krivchikov Dmitry 2015-12-26 18:47:41 +03:00
parent b25bf536ff
commit ed1852f859
1 changed files with 5 additions and 6 deletions

View File

@ -56,15 +56,14 @@ function buildRoute(fit)
console.error(err);
alert('Произошла ошибка. Вероятно построить маршрут по выбранным точкам невозможно.');
} else {
route = L.Routing.line(routes[0]);
distance = Math.round(routes[0].summary.totalDistance / 1000);
$('#routeDistance').html('Протяженность <b>' + distance + '</b> км.');
route.options.styles = [
route = L.Routing.line(routes[0], {styles:[
{color: 'black', opacity: 0.5, weight: 9},
{color: 'green', opacity: 0.7, weight: 7},
{color: 'orange', opacity: 1, weight: 3}
];
]});
distance = Math.round(routes[0].summary.totalDistance / 1000);
$('#routeDistance').html('Протяженность <b>' + distance + '</b> км.');
route.addTo(myMap);
}