leaflet-draw-rotate
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -31,2 +31,4 @@ (function (factory) { | ||
this._enableScale(); | ||
this._initMarkers(); | ||
@@ -163,2 +165,36 @@ } | ||
this._fireEdit(); | ||
}, | ||
/* ------------------- SCALE (RESIZE) STUFF ------------------*/ | ||
/** | ||
* Adds scale listeners | ||
*/ | ||
_enableScale: function () { | ||
this._shape.on('scalestart', this._onStartScaleFeature, this).on('scaleend', this._onStopScaleFeature, this); | ||
}, | ||
/** | ||
* Removes drag start listeners | ||
*/ | ||
_disableScale: function () { | ||
this._shape.off('scalestart', this._onStartDragFeature, this).off('scaleend', this._onStopScaleFeature, this); | ||
}, | ||
/** | ||
* Start scale | ||
* @param {L.MouseEvent} evt | ||
*/ | ||
_onStartScaleFeature: function () { | ||
this._shape._map.removeLayer(this._markerGroup); | ||
this._shape.fire('editstart'); | ||
}, | ||
/** | ||
* Scale stopped | ||
* @param {L.MouseEvent} evt | ||
*/ | ||
_onStopScaleFeature: function () { | ||
this._fireEdit(); | ||
} | ||
@@ -165,0 +201,0 @@ }); |
{ | ||
"name": "leaflet-draw-rotate", | ||
"description": "Add rotate functionality to the Leaflet.Draw plugin", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "See LICENSE in LICENSE", | ||
@@ -6,0 +6,0 @@ "author": "Daniel.Wild@csiro.au", |
@@ -23,2 +23,3 @@ /** | ||
this._enableDragging(); | ||
this._enableScale(); | ||
this._initMarkers(); | ||
@@ -146,3 +147,39 @@ } | ||
this._fireEdit(); | ||
}, | ||
/* ------------------- SCALE (RESIZE) STUFF ------------------*/ | ||
/** | ||
* Adds scale listeners | ||
*/ | ||
_enableScale: function() { | ||
this._shape | ||
.on('scalestart', this._onStartScaleFeature, this) | ||
.on('scaleend', this._onStopScaleFeature, this); | ||
}, | ||
/** | ||
* Removes drag start listeners | ||
*/ | ||
_disableScale: function() { | ||
this._shape | ||
.off('scalestart', this._onStartDragFeature, this) | ||
.off('scaleend', this._onStopScaleFeature, this); | ||
}, | ||
/** | ||
* Start scale | ||
* @param {L.MouseEvent} evt | ||
*/ | ||
_onStartScaleFeature: function() { | ||
this._shape._map.removeLayer(this._markerGroup); | ||
this._shape.fire('editstart'); | ||
}, | ||
/** | ||
* Scale stopped | ||
* @param {L.MouseEvent} evt | ||
*/ | ||
_onStopScaleFeature: function() { | ||
this._fireEdit(); | ||
} | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110876
3219