switch leaflet-routing to development fork

This commit is contained in:
Norbert Renner 2014-08-23 20:33:00 +02:00
parent 8344404483
commit 30cbcc6f6d
7 changed files with 137 additions and 42 deletions

View file

@ -94,7 +94,7 @@ L.Routing.Edit = L.Handler.extend({
if (!this._map) { return; }
if (!this._mouseMarker) {
this._mouseMarker = L.marker(this._map.getCenter(), {
this._mouseMarker = new L.Marker(this._map.getCenter(), {
icon: L.divIcon({
className: 'line-mouse-marker'
,iconAnchor: [5, 5]
@ -104,13 +104,15 @@ L.Routing.Edit = L.Handler.extend({
,draggable: true
,opacity: 0
,zIndexOffset: this.options.zIndexOffset
,title: this.options.tooltips.segment
});
}
this._mouseMarker.addTo(this._map);
if (!this._trailer1) {
var ll = this._map.getCenter();
var style = {opacity: 0.0,clickable: false};
this._trailerOpacity = this.options.styles.trailer.opacity || 0.2;
var style = L.extend({}, this.options.styles.trailer, {opacity: 0.0,clickable: false});
this._trailer1 = new L.Polyline([ll, ll], style);
this._trailer2 = new L.Polyline([ll, ll], style);
}
@ -369,10 +371,10 @@ L.Routing.Edit = L.Handler.extend({
return;
} else {
if (next !== null) {
this._trailer1.setStyle({opacity: 0.2});
this._trailer1.setStyle({opacity: this._trailerOpacity});
}
if (prev !== null) {
this._trailer2.setStyle({opacity: 0.2});
this._trailer2.setStyle({opacity: this._trailerOpacity});
}
}
}