Маленькие точки-маркеры на маршруте v2

This commit is contained in:
Krivchikov Dmitry 2015-05-27 21:00:20 +03:00
parent 18bcf9e80f
commit 8df0cf677a
1 changed files with 6 additions and 3 deletions

View File

@ -27,8 +27,10 @@ function buildRoute(fit)
wayPoints.push({latLng: {lat: lat, lng: lng}});
costomPointName = 'c_'+lat+'_'+lng;
if (typeof points[costomPointName] == 'undefined') {
points[costomPointName] = L.marker([lat, lng], {icon: categories.simplepoint, title: 'Произвольная точка'});
points[costomPointName].addTo(myMap);
markers.addLayer(points[costomPointName]);
}
}
if (i == 0)
@ -172,7 +174,8 @@ function addToRoute(id, build)
e = (id[1]>=0) ? 'E'+id[1] : 'W'+Math.abs(id[1]);
coordsName = n.substring(0,10)+'° '+e.substring(0,10)+'°';
$('#wayPoints').append('<div pointid="'+JSON.stringify(id)+'" class="wayPoint"><span class="del" onclick="$(this).parent().remove();buildRoute();">&times;</span> '+coordsName+'</div>');
costomPointName = 'c_'+id[0]+'_'+id[1];
$('#wayPoints').append('<div pointid="'+JSON.stringify(id)+'" class="wayPoint"><span class="del" onclick="$(this).parent().remove();myMap.removeLayer(points[\''+costomPointName+'\']);buildRoute();">&times;</span> '+coordsName+'</div>');
closePopup();
openBox('Route', true);