From 7c8ac62b451bafe7d2739f18517366840a842075 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 2 Nov 2025 22:58:28 +0000 Subject: [PATCH 1/2] Update base_layers.ts: add 3D --- styles/src/base_layers.ts | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index a73a40f7..93c0ddb0 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -600,6 +600,70 @@ export function nolabels_layers( "fill-opacity": 0.5, }, }, + { + "id": "3d-buildings", + "source": "protomaps", + "source-layer": "buildings", + "type": "fill-extrusion", + "paint": { + "fill-extrusion-color": t.buildings, + "fill-extrusion-height": [ + "case", + [ + "has", + "height" + ], + [ + "get", + "height" + ], + [ + "has", + "floors" + ], + [ + "*", + [ + "to-number", + [ + "get", + "floors" + ] + ], + 2 + ], + 3.5 + ], + "fill-extrusion-base": [ + "case", + [ + "has", + "min_height" + ], + [ + "get", + "min_height" + ], + [ + "has", + "min_floors" + ], + [ + "*", + [ + "to-number", + [ + "get", + "min_floors" + ] + ], + 2 + ], + 0 + ], + "fill-extrusion-opacity": 0.6 + } + }, { id: "roads_pier", type: "line", From befa773075e07c10981fa67d22320f23ce8a984a Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 2 Nov 2025 23:09:15 +0000 Subject: [PATCH 2/2] Update base_layers.ts: fix formatting issues --- styles/src/base_layers.ts | 48 ++++++++++----------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index 93c0ddb0..e93d3591 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -601,34 +601,22 @@ export function nolabels_layers( }, }, { - "id": "3d-buildings", - "source": "protomaps", + id: "3d-buildings", + source: "protomaps", "source-layer": "buildings", - "type": "fill-extrusion", - "paint": { + type: "fill-extrusion", + paint: { "fill-extrusion-color": t.buildings, "fill-extrusion-height": [ "case", - [ - "has", - "height" - ], - [ - "get", - "height" - ], - [ - "has", - "floors" - ], + ["has", "height"], + ["get", "height"], + ["has", "floors"], [ "*", [ "to-number", - [ - "get", - "floors" - ] + ["get", "floors"] ], 2 ], @@ -636,26 +624,14 @@ export function nolabels_layers( ], "fill-extrusion-base": [ "case", - [ - "has", - "min_height" - ], - [ - "get", - "min_height" - ], - [ - "has", - "min_floors" - ], + ["has", "min_height"], + ["get", "min_height"], + ["has", "min_floors"], [ "*", [ "to-number", - [ - "get", - "min_floors" - ] + ["get", "min_floors"] ], 2 ],