diff options
Diffstat (limited to 'htdocs/leafletjs/Leaflet.streetlabels.js')
-rw-r--r-- | htdocs/leafletjs/Leaflet.streetlabels.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/htdocs/leafletjs/Leaflet.streetlabels.js b/htdocs/leafletjs/Leaflet.streetlabels.js index 91bd596..8aee67b 100644 --- a/htdocs/leafletjs/Leaflet.streetlabels.js +++ b/htdocs/leafletjs/Leaflet.streetlabels.js @@ -80,10 +80,8 @@ L.StreetLabels = L.LabelTextCollision ctx.lineWidth = this.options.fontStyle.lineWidth; var fontSize = this.options.fontStyle.fontSize; - if (this._map && this.options.fontStyle.dynamicFontSize === true) { - fontSize = this._getDynamicFontSize(); - + fontSize = this._getDynamicFontSize(layer.feature); } ctx.font = fontSize + this.options.fontStyle.fontSizeUnit + " 'Helvetica Neue',Helvetica,Arial,sans-serif"; @@ -98,7 +96,6 @@ L.StreetLabels = L.LabelTextCollision textWidth, textHeight)); if (this.options.collisionFlg) { - for (var index in this._textList) { var pointBounds = this._textList[index]; if (pointBounds.intersects(bounds)) { @@ -184,7 +181,7 @@ L.StreetLabels = L.LabelTextCollision return polyline; }, - _getDynamicFontSize: function () { + _getDynamicFontSize: function (layer) { return parseInt(this._map.getZoom()); }, |