Skip to content

Commit 96cf335

Browse files
authored
Display building numbers (#945)
1 parent 6cae7e0 commit 96cf335

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

basemap/layers/building/number.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default {
2424
layout: {
2525
'text-allow-overlap': false,
2626
'text-anchor': 'center',
27-
'text-field': '{addr:housenumber}',
27+
'text-field': ['get', 'addr:housenumber'],
2828
'text-font': ['Noto Sans Regular'],
2929
'text-offset': [0, 0],
3030
'text-size': [
@@ -34,9 +34,9 @@ export default {
3434
15,
3535
0,
3636
16,
37-
11,
37+
10,
38+
20,
3839
20,
39-
11,
4040
],
4141
visibility: 'visible',
4242
},
@@ -45,4 +45,9 @@ export default {
4545
'text-halo-color': theme.buildingNumberTextHaloColor,
4646
'text-halo-width': 1.2,
4747
},
48+
filter: ['all',
49+
['==', ['geometry-type'], 'Polygon'],
50+
['!=', ['get', 'building'], 'no'],
51+
['!=', ['get', 'addr:housenumber'], '']
52+
],
4853
}

basemap/style.js

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import highway_label from './layers/highway/highway_label.js';
5555

5656
import ocean_overlay from './layers/ocean/overlay.js';
5757
import route_line from "./layers/route/style.js"
58+
import building_number from "./layers/building/number.js";
5859
import building_fill from "./layers/building/fill.js";
5960
import building_extrusion from "./layers/building/extrusion.js";
6061
import man_made_fill from "./layers/man_made/man_made_fill.js";
@@ -105,6 +106,7 @@ export default {
105106
highway_tunnel_outline,
106107
highway_tunnel_line,
107108
building_fill,
109+
building_number,
108110
highway_construction_line,
109111
highway_fill,
110112
highway_outline,

daylight/style.js

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import highway_label from '../basemap/layers/highway/highway_label.js';
5050

5151
import ocean_overlay from '../basemap/layers/ocean/overlay.js';
5252
import route_line from "../basemap/layers/route/style.js"
53+
import building_number from "../basemap/layers/building/number.js";
5354
import building_fill from "../basemap/layers/building/fill.js";
5455
import building_extrusion from "../basemap/layers/building/extrusion.js";
5556
import man_made_fill from "../basemap/layers/man_made/man_made_fill.js";
@@ -102,6 +103,7 @@ export default {
102103
highway_tunnel_line,
103104
railway_tunnel,
104105
building_fill,
106+
building_number,
105107
highway_construction_line,
106108
highway_outline,
107109
highway_line,

0 commit comments

Comments
 (0)