You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by bc...@apache.org on 2023/05/25 13:54:22 UTC

[incubator-baremaps] branch main updated: Add countries at low zoom level (#671)

This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


The following commit(s) were added to refs/heads/main by this push:
     new ba33fa30 Add countries at low zoom level (#671)
ba33fa30 is described below

commit ba33fa30f13574e9f43908dd807a2886e2c4db82
Author: Leonard <73...@users.noreply.github.com>
AuthorDate: Thu May 25 15:54:18 2023 +0200

    Add countries at low zoom level (#671)
---
 basemap/layers/point/label.js   | 9 +++++++++
 basemap/layers/point/tileset.js | 7 ++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/basemap/layers/point/label.js b/basemap/layers/point/label.js
index f48e0527..0515b31f 100644
--- a/basemap/layers/point/label.js
+++ b/basemap/layers/point/label.js
@@ -12,6 +12,15 @@
 import {asLayerObject, withSymbolSortKeys} from "../../utils/utils.js";
 
 let directives = [
+    {
+        filter: [
+            'all',
+            ['==', ['get', 'place'], 'country']
+        ],
+        'text-size': 18,
+        'text-color': 'rgb(25, 25, 25)',
+        'symbol-sort-key': ["-", ["to-number", ['get', 'population'], 0]],
+    },
     {
         filter: [
             'all',
diff --git a/basemap/layers/point/tileset.js b/basemap/layers/point/tileset.js
index 4c41735d..24f08b64 100644
--- a/basemap/layers/point/tileset.js
+++ b/basemap/layers/point/tileset.js
@@ -14,8 +14,13 @@ export default {
     "queries": [
         {
             "minzoom": 1,
+            "maxzoom": 4,
+            "sql": "SELECT id, tags, geom FROM osm_point_z$zoom WHERE tags != '{}' AND (tags ->> 'place' = 'country')"
+        },
+        {
+            "minzoom": 4,
             "maxzoom": 20,
-            "sql": "SELECT id, tags, geom FROM osm_point_z$zoom WHERE tags != '{}'"
+            "sql": "SELECT id, tags, geom FROM osm_point_z$zoom WHERE tags != '{}' AND (tags ->> 'place' != 'country')"
         }
     ]
 }