diff --git a/bower.json b/bower.json index 389076f..c1dcde0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "Leaflet.label", - "version": "0.2.2", + "version": "0.2.3", "homepage": "https://github.com/Leaflet/Leaflet.label", "authors": [ "Jacob Toye " diff --git a/dist/leaflet.label-src.js b/dist/leaflet.label-src.js index a8e930c..01c77d8 100644 --- a/dist/leaflet.label-src.js +++ b/dist/leaflet.label-src.js @@ -154,6 +154,12 @@ L.Label = (L.Layer ? L.Layer : L.Class).extend({ this._prevContent = this._content; + this._labelWidth = this._container.offsetWidth; + } else if (this._content instanceof Element) { + this._container.appendChild(this._content); + + this._prevContent = this._content; + this._labelWidth = this._container.offsetWidth; } }, @@ -542,4 +548,4 @@ L.FeatureGroup.include({ } }); -}(window, document)); \ No newline at end of file +}(window, document)); diff --git a/package.json b/package.json index a74c9e0..21a871a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet.label", - "version": "0.2.1", + "version": "0.2.3", "description": "Labels for leaflet maps", "devDependencies": { "jshint": "~2.1.4",