diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-25 13:08:14 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-25 13:08:14 +0200 |
commit | 771704bf15515ac524724c20399a0b44ccc44531 (patch) | |
tree | 891d68f3dd8160138b116e140260f71bfe2aa20f /htdocs/leafletjs | |
parent | 3cb30788200babf53b0718283d5de61e3460f15e (diff) | |
download | lifomapserver-771704bf15515ac524724c20399a0b44ccc44531.tar.gz lifomapserver-771704bf15515ac524724c20399a0b44ccc44531.tar.bz2 lifomapserver-771704bf15515ac524724c20399a0b44ccc44531.zip |
Add basic support for city outlines
Use with load_geojson(
"Cities (outline, demo)",
"./geojson/cities_demo.json",
"outline",
"black",
1,
style_outlines);
Diffstat (limited to 'htdocs/leafletjs')
-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()); }, |