@maptoolkit/maplibre-scene3d-control 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -123,10 +123,10 @@ landmarks: {
123
123
 
124
124
  `fill3d` then leaves those features out: its filter becomes `["all", <its own filter, if any>, ["!", <the landmarks' filter>]]` (expression filters). A scene without `landmarks` keeps them in `fill3d`, drawn as plain buildings. `landmarks` works without `fill3d` and `lod1` too; the style's own 3D buildings (`hideLayers`) then stay. `paint` goes to the `Fill3DLayer` as it is, on `fill3d` as well, including the `fill-3d-ambient-occlusion-*` keys of maplibre-3d-layers ≥ 0.6 (older versions ignore them, and place a landmark like a building instead of rigidly at its anchor).
125
125
 
126
- `fill3d.extrusion` lets the `Fill3DLayer` extrude the 2D footprints as well (maplibre-3d-layers ≥ 0.6.0, experimental), so that they get the shading and the fake ambient occlusion of the 3D buildings. The control passes it on as it is; hand the same footprints over by zoom, so that none is drawn twice:
126
+ `fill3d.extrusion` lets the `Fill3DLayer` extrude the 2D footprints as well (maplibre-3d-layers ≥ 0.6.0, experimental), so that they get the shading and the fake ambient occlusion of the 3D buildings. The control passes it on as it is; hand the same footprints over by the zoom of the tile, so that none is drawn twice:
127
127
 
128
128
  ```js
129
- lod1: { maxzoom: 15, filter: ["!=", ["get", "extrude"], false], paint }, // native below z15
129
+ lod1: { filter: ["all", ["!=", ["get", "extrude"], false], ["<", ["zoom"], 15]], paint }, // native in tiles below z15
130
130
  fill3d: {
131
131
  extrusion: {
132
132
  "source-layer": "buildings2d",
@@ -136,7 +136,7 @@ fill3d: {
136
136
  },
137
137
  ```
138
138
 
139
- The extrusion filter sees the zoom of the tile, not of the map. The extruded faces carry `type: "roof" | "wall"`, so a `fill-3d-color` keyed on `type` colours them like the 3D buildings.
139
+ Both filters see the zoom of the tile, not of the map. Don't stop `lod1` with `maxzoom` instead: that is the map zoom, and a pitched view at zoom 15+ still loads z13/z14 tiles in the distance, which then get no buildings from either layer. The extruded faces carry `type: "roof" | "wall"`, so a `fill-3d-color` keyed on `type` colours them like the 3D buildings.
140
140
 
141
141
  MapLibre ignores a diffed `setStyle` that changes nothing but the metadata. A scene that changes on its own, with the rest of the style unchanged, therefore never reaches the control that way: pass it with `setScene()` or use `setStyle` with `diff: false`.
142
142
 
@@ -47,7 +47,7 @@ export interface Scene3dManifest {
47
47
  /**
48
48
  * `Fill3DLayer` on the source layer `buildings3d`. With `extrusion` it also extrudes the 2D footprints of a source
49
49
  * layer of the same tiles (maplibre-3d-layers ≥ 0.6.0, experimental), so that they get its shading and fake ambient
50
- * occlusion; hide the same footprints in `lod1` where it does, e.g. by zoom.
50
+ * occlusion; leave the same footprints out of `lod1` where it does, by a filter on the tile zoom (not `maxzoom`).
51
51
  */
52
52
  fill3d?: {
53
53
  position?: Scene3dPosition;