lib/leaflet.draw/src/draw/handler/Draw.Feature.js in leaflet-js-0.6.beta4 vs lib/leaflet.draw/src/draw/handler/Draw.Feature.js in leaflet-js-0.7.0
- old
+ new
@@ -11,11 +11,11 @@
// Merge default shapeOptions options with custom shapeOptions
if (options && options.shapeOptions) {
options.shapeOptions = L.Util.extend({}, this.options.shapeOptions, options.shapeOptions);
}
- L.Util.extend(this.options, options);
+ L.setOptions(this, options);
},
enable: function () {
if (this._enabled) { return; }
@@ -35,11 +35,15 @@
this._map.fire('draw:drawstop', { layerType: this.type });
},
addHooks: function () {
- if (this._map) {
+ var map = this._map;
+
+ if (map) {
L.DomUtil.disableTextSelection();
+
+ map.getContainer().focus();
this._tooltip = new L.Tooltip(this._map);
L.DomEvent.addListener(this._container, 'keyup', this._cancelDrawing, this);
}
\ No newline at end of file