From 035ed471cd3160c20be6d010da84b67ef97e8362 Mon Sep 17 00:00:00 2001 From: yongjunhong Date: Sun, 2 Feb 2025 16:29:18 +0900 Subject: [PATCH] Display building numbers --- 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,