Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-draw-rotate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-draw-rotate - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

dist/Edit.Rectangle.Rotate.js

@@ -83,3 +83,3 @@ (function (factory) {

/**
* Adds drag start listeners
* Adds rotate listeners
*/

@@ -97,3 +97,3 @@ _enableRotate: function () {

/**
* Removes drag start listeners
* Removes rotate listeners
*/

@@ -100,0 +100,0 @@ _disableRotate: function () {

@@ -1581,3 +1581,2 @@ (function (factory) {

_onScaleUniform: function (evt) {
console.log('_onScaleUniform');
var originPoint = this._originMarker._point;

@@ -1604,4 +1603,2 @@ var ratioX, ratioY;

_onScaleEnd: function (evt) {
console.log('_onScaleEnd');
this._map.off('mousemove', this._onScaleUniform, this).off('mousemove', this._onScaleStandard, this).off('mouseup', this._onScaleEnd, this);

@@ -1643,3 +1640,3 @@

} else {
return new L.Rectangle(this._path.getBounds(), this.options.boundsOptions);
return L.GeoJSON.geometryToLayer(this._path.toGeoJSON(), this.options.boundsOptions);
}

@@ -1646,0 +1643,0 @@ },

{
"name": "leaflet-draw-rotate",
"description": "Add rotate functionality to the Leaflet.Draw plugin",
"version": "0.0.3",
"version": "0.0.4",
"license": "See LICENSE in LICENSE",

@@ -6,0 +6,0 @@ "author": "Daniel.Wild@csiro.au",

@@ -34,5 +34,5 @@ # leaflet-draw-rotate [![NPM version][npm-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url]

- **`options.handlerOptions`** - **<[Path_options](http://leafletjs.com/reference.html#path-options)>** - edge markers options
- **`options.boundsOptions`** - **<[Polyline_options](http://leafletjs.com/reference.html#polyline-options)>** - bounding rectangle options
- **`options.rotateHandleOptions`** - **<[Polyline_options](http://leafletjs.com/reference.html#polyline-options)>** - rotation handle line styles
- **`options.handlerOptions`** - **<[Path_options](http://leafletjs.com/reference.html#path-option)>** - edge markers options
- **`options.boundsOptions`** - **<[Polyline_options](http://leafletjs.com/reference.html#polyline-option)>** - bounding rectangle options
- **`options.rotateHandleOptions`** - **<[Polyline_options](http://leafletjs.com/reference.html#polyline-option)>** - rotation handle line styles
- **`options.handleLength`** - **Int** - Length of the rotation handle in pixels. Defaults to 20.

@@ -52,2 +52,13 @@ - **`options.rotation`** - **Boolean** - Enable/disable rotation. Default `true`

## Programmatic changes
If you have changed the geometry of the transformed layer and want the tool to reflect the changes, use:
```js
// you have changed the geometry here
layer.setLatLngs([...]);
// and want to update handlers:
layer.transform.reset();
```
## Development

@@ -54,0 +65,0 @@

@@ -66,3 +66,3 @@ /**

/**
* Adds drag start listeners
* Adds rotate listeners
*/

@@ -80,3 +80,3 @@ _enableRotate: function() {

/**
* Removes drag start listeners
* Removes rotate listeners
*/

@@ -83,0 +83,0 @@ _disableRotate: function() {

@@ -1645,5 +1645,3 @@

*/
_onScaleUniform: function(evt) {
console.log('_onScaleUniform');
_onScaleUniform: function(evt) {
var originPoint = this._originMarker._point;

@@ -1673,4 +1671,2 @@ var ratioX, ratioY;

_onScaleEnd: function(evt) {
console.log('_onScaleEnd');
this._map

@@ -1717,4 +1713,4 @@ .off('mousemove', this._onScaleUniform, this)

} else {
return new L.Rectangle(
this._path.getBounds(), this.options.boundsOptions);
return L.GeoJSON.geometryToLayer(
this._path.toGeoJSON(), this.options.boundsOptions);
}

@@ -1721,0 +1717,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc