@maptoolkit/maplibre-scene3d-control 0.5.2 → 0.6.0

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
@@ -10,7 +10,8 @@ Maptoolkit styles name their scene in `metadata["maptoolkit:scene3d"]`. The cont
10
10
  - adds the buildings source with your API key (only for a scene with buildings or landmarks),
11
11
  - puts the layers under the style's labels,
12
12
  - keeps the tilt in the global state `pitch`, which the scene's opacity fades read,
13
- - rebuilds the layers after a style or terrain change; a diffed `setStyle` that keeps the scene only puts back what the diff dropped and keeps the 3D layers,
13
+ - rebuilds the layers after a style change; a diffed `setStyle` that keeps the scene only puts back what the diff dropped and keeps the 3D layers,
14
+ - leaves the 3D layers in place when the terrain is switched on, off or changed: they move onto the new heights themselves, without loading again,
14
15
  - loads the 3D library (with three.js) only once the map reaches zoom 12.
15
16
 
16
17
  The 3D library comes with the control: you install and import only the control.
@@ -121,7 +121,8 @@ type ResolvedOptions = Required<Omit<Scene3dControlOptions, "apiKey" | "scene" |
121
121
  * The scene comes from the style itself (`metadata["maptoolkit:scene3d"]`, written by style-family-js),
122
122
  * so a style switch brings its own scene. The control keeps the tilt in the global state `pitch`
123
123
  * that the scene's opacity fades read, puts the layers under the style's labels, rebuilds them after
124
- * style and terrain changes and loads the 3D library only when the map gets close enough.
124
+ * a style change and loads the 3D library only when the map gets close enough. A terrain that is
125
+ * switched on, off or changed leaves the 3D layers as they are: they move onto it themselves.
125
126
  */
126
127
  export declare class Scene3dControl extends Evented<Scene3dControlEventType> implements IControl {
127
128
  readonly options: ResolvedOptions;
@@ -151,8 +152,6 @@ export declare class Scene3dControl extends Evented<Scene3dControlEventType> imp
151
152
  private sourceOk;
152
153
  /** The position each custom layer was added with (`"below-labels"` when the scene names none). */
153
154
  private customPosition;
154
- /** The terrain the 3D layers were built with (source and exaggeration), see onTerrain. */
155
- private terrainKey;
156
155
  constructor(options?: Scene3dControlOptions);
157
156
  getDefaultPosition(): ControlPosition;
158
157
  onAdd(map: MaplibreMap): HTMLElement;
@@ -178,7 +177,6 @@ export declare class Scene3dControl extends Evented<Scene3dControlEventType> imp
178
177
  private onStyleLoad;
179
178
  private onStyleData;
180
179
  private syncWithStyle;
181
- private onTerrain;
182
180
  private onZoom;
183
181
  /** `["global-state", "pitch"]` for the scene's opacity fades. Whole degrees: each change is a style update. */
184
182
  private syncPitch;