Display icons, country names, and boundaries on the basemap
diff --git a/basemap/layers/boundary/tileset.js b/basemap/layers/boundary/tileset.js
index 0911190..34cb9fc 100644
--- a/basemap/layers/boundary/tileset.js
+++ b/basemap/layers/boundary/tileset.js
@@ -20,12 +20,12 @@
},
{
minzoom: 6,
- maxzoom: 14,
+ maxzoom: 10,
sql:
"SELECT fid as id, jsonb_build_object('boundary', 'administrative', 'admin_level', '1') as tags, geom FROM globaladm1_z$zoom",
},
{
- minzoom: 14,
+ minzoom: 10,
maxzoom: 20,
sql:
"SELECT id, tags, geom FROM osm_ways WHERE tags ? 'boundary'",
diff --git a/basemap/layers/point/country_label.js b/basemap/layers/point/country_label.js
new file mode 100644
index 0000000..c9358a7
--- /dev/null
+++ b/basemap/layers/point/country_label.js
@@ -0,0 +1,42 @@
+/**
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ in compliance with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software distributed under the License
+ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the License for the specific language governing permissions and limitations under
+ the License.
+ **/
+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]],
+ },
+];
+
+export default asLayerObject(withSymbolSortKeys(directives), {
+ id: 'country_label',
+ type: 'symbol',
+ source: 'baremaps',
+ 'source-layer': 'point',
+ 'minzoom': 1,
+ 'maxzoom': 4,
+ layout: {
+ visibility: 'visible',
+ 'text-font': ['Noto Sans Regular'],
+ 'text-field': ['get', 'name'],
+ },
+ paint: {
+ 'text-halo-color': 'rgba(255, 255, 255, 0.8)',
+ 'text-halo-width': 1,
+ },
+});
diff --git a/basemap/layers/point/label.js b/basemap/layers/point/point_label.js
similarity index 90%
rename from basemap/layers/point/label.js
rename to basemap/layers/point/point_label.js
index 0515b31..5cce37e 100644
--- a/basemap/layers/point/label.js
+++ b/basemap/layers/point/point_label.js
@@ -15,15 +15,6 @@
{
filter: [
'all',
- ['==', ['get', 'place'], 'country']
- ],
- 'text-size': 18,
- 'text-color': 'rgb(25, 25, 25)',
- 'symbol-sort-key': ["-", ["to-number", ['get', 'population'], 0]],
- },
- {
- filter: [
- 'all',
['==', ['get', 'capital'], 'yes'],
['==', ['get', 'place'], 'city']
],
@@ -77,10 +68,12 @@
];
export default asLayerObject(withSymbolSortKeys(directives), {
- id: 'label',
+ id: 'point_label',
type: 'symbol',
source: 'baremaps',
'source-layer': 'point',
+ 'minzoom': 4,
+ 'maxzoom': 24,
layout: {
visibility: 'visible',
'text-font': ['Noto Sans Regular'],
diff --git a/basemap/layers/point/tileset.js b/basemap/layers/point/tileset.js
index 24f08b6..68d665e 100644
--- a/basemap/layers/point/tileset.js
+++ b/basemap/layers/point/tileset.js
@@ -20,7 +20,7 @@
{
"minzoom": 4,
"maxzoom": 20,
- "sql": "SELECT id, tags, geom FROM osm_point_z$zoom WHERE tags != '{}' AND (tags ->> 'place' != 'country')"
+ "sql": "SELECT id, tags, geom FROM osm_point_z$zoom WHERE tags != '{}'"
}
]
}
diff --git a/basemap/style.js b/basemap/style.js
index c57251d..e2a1057 100644
--- a/basemap/style.js
+++ b/basemap/style.js
@@ -52,7 +52,8 @@
import waterway_tunnel_line from "./layers/waterway/tunnel_line.js"
import waterway_tunnel_casing from "./layers/waterway/tunnel_casing.js"
import icon from "./layers/point/icon.js";
-import label from './layers/point/label.js';
+import country_label from './layers/point/country_label.js';
+import point_label from './layers/point/point_label.js';
export default {
"version": 8,
@@ -109,6 +110,7 @@
boundary_line,
waterway_label,
icon,
- label,
+ country_label,
+ point_label,
],
};
\ No newline at end of file
diff --git a/basemap/tileset.js b/basemap/tileset.js
index b7bbc91..c92d632 100644
--- a/basemap/tileset.js
+++ b/basemap/tileset.js
@@ -46,7 +46,7 @@
amenity,
attraction,
barrier,
- // boundary,
+ boundary,
building,
highway,
landuse,