diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-26 17:01:26 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-26 17:01:26 +0200 |
commit | 1ddb72414082f60da2aa9742e14aaea965871093 (patch) | |
tree | 8a35603549928721a9e9a37c88f85620cd557ba5 | |
parent | 1292c1a57377a0e8fb8f80a7f4869880d0fc26ca (diff) | |
download | lifomapserver-1ddb72414082f60da2aa9742e14aaea965871093.tar.gz lifomapserver-1ddb72414082f60da2aa9742e14aaea965871093.tar.bz2 lifomapserver-1ddb72414082f60da2aa9742e14aaea965871093.zip |
Give cities, towns, and villages different font sizes
-rw-r--r-- | htdocs/mapscript.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js index 7d7d940..735dcd9 100644 --- a/htdocs/mapscript.js +++ b/htdocs/mapscript.js @@ -45,9 +45,28 @@ streetLabelsRenderer._getDynamicFontSize = function (layer) { return 2**(zoom - 9) * 11; break; case "Polygon": + var size; if (zoom >= 4) - return 30; - return 20; + size = 30; + else + size = 20; + switch (layer.properties.type) { + case "city": + break; + case "town": + size *= 2/3; + break; + case "village": + size *= 1/3; + break; + case "district": + size *= 2/3; + break; + default: + size *= 0.5/3; + break; + } + return size; default: break; } |