brouter-web/js/plugin/Routing.js
2014-05-14 13:14:35 +02:00

29 lines
831 B
JavaScript

BR.Routing = L.Routing.extend({
options: {
icons: {
/* not implemented yet
start: new L.Icon.Default({iconUrl: 'bower_components/leaflet-gpx/pin-icon-start.png'}),
end: new L.Icon.Default(),
normal: new L.Icon.Default()
*/
draw: false
},
snapping: null
},
onAdd: function (map) {
var container = L.Routing.prototype.onAdd.call(this, map);
this._draw.on('enabled', function() {
L.DomUtil.addClass(map.getContainer(), 'routing-draw-enabled');
});
this._draw.on('disabled', function() {
L.DomUtil.removeClass(map.getContainer(), 'routing-draw-enabled');
});
// enable drawing mode
this.draw(true);
return container;
}
});