leaflet-editable-textbox
Advanced tools
Comparing version 1.0.15 to 1.0.16
{ | ||
"name": "leaflet-editable-textbox", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "TextBox for Leaflet.Editable", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -166,3 +166,6 @@ /** | ||
_updateTextAreaBounds: function() { | ||
var scale, latlngs, pos, size; | ||
var scale; | ||
var pos; | ||
var size; | ||
var center; | ||
var feature = this.feature; | ||
@@ -172,2 +175,3 @@ var bounds = feature._bounds; | ||
var map = this.map; | ||
var bounds; | ||
@@ -177,10 +181,14 @@ if (null !== textArea) { | ||
scale = feature._getScale(map.getZoom()); | ||
latlngs = feature._boundsToLatLngs(bounds); | ||
pos = map.latLngToLayerPoint(latlngs[1]); | ||
size = map.latLngToLayerPoint(latlngs[3]).subtract(pos); | ||
bounds = feature.getBounds(); | ||
center = map.latLngToLayerPoint(bounds.getCenter()); | ||
pos = map.latLngToLayerPoint(bounds.getNorthWest()); | ||
size = L.point(2 * Math.abs(center.x - pos.x), | ||
2 * Math.abs(center.y - pos.y)) | ||
.divideBy(scale) | ||
.round(); | ||
L.DomUtil | ||
.setSize(textArea, size.divideBy(scale).round()) | ||
.setSize(textArea, size) | ||
.setTransform(textArea, pos, scale.toFixed(3)); | ||
textArea.style.display = ''; | ||
textArea.style.display = ''; | ||
textArea.style.position = 'absolute'; | ||
@@ -187,0 +195,0 @@ textArea.setAttribute('spellcheck', false); |
@@ -70,5 +70,7 @@ /** | ||
var scale = layer._getScale(this._map.getZoom()); | ||
var pos = layer._rings[0][1]; | ||
var size = layer._rings[0][3].subtract(pos).divideBy(scale); | ||
var bounds = layer.getBounds(); | ||
var center = layer._map.latLngToLayerPoint(bounds.getCenter()); | ||
var pos = layer._map.latLngToLayerPoint(bounds.getNorthWest()); | ||
var size = L.point(2 * Math.abs(center.x - pos.x), | ||
2 * Math.abs(center.y - pos.y)).divideBy(scale); | ||
var chars = text.split(''); | ||
@@ -75,0 +77,0 @@ var line = chars.shift(); |
@@ -79,4 +79,5 @@ | ||
_updatePosition: function() { | ||
if (null !== this._textNode && 0 !== this._rings.length) { | ||
var pos = this._rings[0][1]; | ||
if (null !== this._textNode) { | ||
var bounds = this.getBounds(); | ||
var pos = this._map.latLngToLayerPoint(bounds.getNorthWest()); | ||
var textMatrix = new L.Matrix(1, 0, 0, 1, 0, 0) | ||
@@ -83,0 +84,0 @@ .translate(pos) |
Sorry, the diff of this file is too big to display
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
2720748
17727