leaflet-draw-rotate
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1501,4 +1501,2 @@ (function (factory) { | ||
_onScaleStandard: function (evt) { | ||
console.log('_onScaleStandard'); | ||
let ptH = this._map.latLngToContainerPoint(evt.latlng); | ||
@@ -1529,2 +1527,3 @@ | ||
let handler = this._handlers[indexHandler]; | ||
const round = this.options.scaleRounding || 4; | ||
let pathLatLng = null; | ||
@@ -1534,3 +1533,3 @@ | ||
for (let j = 0, jj = rings[i].length; j < jj; j++) { | ||
if (latlngs[i][j].lat === handler._latlng.lat && latlngs[i][j].lng === handler._latlng.lng) { | ||
if (+latlngs[i][j].lat.toFixed(round) === +handler._latlng.lat.toFixed(round) && +latlngs[i][j].lng.toFixed(round) === +handler._latlng.lng.toFixed(round)) { | ||
pathLatLng = latlngs[i][j]; | ||
@@ -1537,0 +1536,0 @@ } |
{ | ||
"name": "leaflet-draw-rotate", | ||
"description": "Add rotate functionality to the Leaflet.Draw plugin", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"license": "See LICENSE in LICENSE", | ||
@@ -6,0 +6,0 @@ "author": "Daniel.Wild@csiro.au", |
@@ -37,6 +37,7 @@ # leaflet-draw-rotate [![NPM version][npm-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] | ||
- **`options.rotateHandleOptions`** - **<[Polyline_options](http://leafletjs.com/reference.html#polyline-options)>** - rotation handle line styles | ||
- **`options.handleLength`** - **Number** - Length of the rotation handle in pixels. Defaults to 20. | ||
- **`options.handleLength`** - **Int** - Length of the rotation handle in pixels. Defaults to 20. | ||
- **`options.rotation`** - **Boolean** - Enable/disable rotation. Default `true` | ||
- **`options.scaling`** - **Boolean** - Enable/disable scaling. Default `true` | ||
- **`options.uniformScaling`** - **Boolean** - Use uniform scaling (maintain aspect ratio). Default `true` | ||
- **`options.scaleRounding`** - **Int** - Decimal rounding value to use when matching non-uniform drag handles (can use this if you encounter [#5](https://github.com/onaci/Leaflet.draw.rotate/issues/5)). Default `4` | ||
@@ -43,0 +44,0 @@ ## Events |
@@ -1570,4 +1570,3 @@ | ||
_onScaleStandard: function(evt) { | ||
console.log('_onScaleStandard'); | ||
let ptH = this._map.latLngToContainerPoint(evt.latlng); | ||
@@ -1596,6 +1595,7 @@ | ||
const round = this.options.scaleRounding || 4; | ||
let pathLatLng = null; | ||
for (let i = 0, len = rings.length; i < len; i++) { | ||
for (let j = 0, jj = rings[i].length; j < jj; j++) { | ||
if (latlngs[i][j].lat === handler._latlng.lat && latlngs[i][j].lng === handler._latlng.lng) { | ||
if (+latlngs[i][j].lat.toFixed(round) === +handler._latlng.lat.toFixed(round) && +latlngs[i][j].lng.toFixed(round) === +handler._latlng.lng.toFixed(round)) { | ||
pathLatLng = latlngs[i][j]; | ||
@@ -1616,3 +1616,3 @@ } | ||
// on est sur le coin B | ||
let BPrimeLatLng = this._map.containerPointToLatLng(pHonLineOB); | ||
let BPrimeLatLng = this._map.containerPointToLatLng(pHonLineOB); | ||
handler._latlng.lat = BPrimeLatLng.lat; | ||
@@ -1619,0 +1619,0 @@ handler._latlng.lng = BPrimeLatLng.lng; |
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
109072
67