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 96cf335ea Display building numbers (#945)
96cf335ea is described below

commit 96cf335eaefa6ccdff923f31c3b81adaef211016
Author: Yongjun Hong <[email protected]>
AuthorDate: Mon Feb 3 18:24:06 2025 +0900

    Display building numbers (#945)
---
 basemap/layers/building/number.js | 11 ++++++++---
 basemap/style.js                  |  2 ++
 daylight/style.js                 |  2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/basemap/layers/building/number.js 
b/basemap/layers/building/number.js
index 9b4336f29..a9066a57d 100644
--- a/basemap/layers/building/number.js
+++ b/basemap/layers/building/number.js
@@ -24,7 +24,7 @@ export default {
     layout: {
         'text-allow-overlap': false,
         'text-anchor': 'center',
-        'text-field': '{addr:housenumber}',
+        'text-field': ['get', 'addr:housenumber'],
         'text-font': ['Noto Sans Regular'],
         'text-offset': [0, 0],
         'text-size': [
@@ -34,9 +34,9 @@ export default {
             15,
             0,
             16,
-            11,
+            10,
+            20,
             20,
-            11,
         ],
         visibility: 'visible',
     },
@@ -45,4 +45,9 @@ export default {
         'text-halo-color': theme.buildingNumberTextHaloColor,
         'text-halo-width': 1.2,
     },
+    filter: ['all',
+      ['==', ['geometry-type'], 'Polygon'],
+      ['!=', ['get', 'building'], 'no'],
+      ['!=', ['get', 'addr:housenumber'], '']
+    ],
 }
diff --git a/basemap/style.js b/basemap/style.js
index bc03a82d4..96f66c282 100644
--- a/basemap/style.js
+++ b/basemap/style.js
@@ -55,6 +55,7 @@ import highway_label from './layers/highway/highway_label.js';
 
 import ocean_overlay from './layers/ocean/overlay.js';
 import route_line from "./layers/route/style.js"
+import building_number from "./layers/building/number.js";
 import building_fill from "./layers/building/fill.js";
 import building_extrusion from "./layers/building/extrusion.js";
 import man_made_fill from "./layers/man_made/man_made_fill.js";
@@ -105,6 +106,7 @@ export default {
         highway_tunnel_outline,
         highway_tunnel_line,
         building_fill,
+        building_number,
         highway_construction_line,
         highway_fill,
         highway_outline,
diff --git a/daylight/style.js b/daylight/style.js
index 38775b1db..aef26a699 100644
--- a/daylight/style.js
+++ b/daylight/style.js
@@ -50,6 +50,7 @@ import highway_label from 
'../basemap/layers/highway/highway_label.js';
 
 import ocean_overlay from '../basemap/layers/ocean/overlay.js';
 import route_line from "../basemap/layers/route/style.js"
+import building_number from "../basemap/layers/building/number.js";
 import building_fill from "../basemap/layers/building/fill.js";
 import building_extrusion from "../basemap/layers/building/extrusion.js";
 import man_made_fill from "../basemap/layers/man_made/man_made_fill.js";
@@ -102,6 +103,7 @@ export default {
         highway_tunnel_line,
         railway_tunnel,
         building_fill,
+        building_number,
         highway_construction_line,
         highway_outline,
         highway_line,

Reply via email to