@navaramap/three 0.0.7 → 0.1.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.
Files changed (46) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +20 -8
  3. package/dist/assets/fontWorker-C5cHhkWQ.js +2 -0
  4. package/dist/assets/fontWorker-C5cHhkWQ.js.map +1 -0
  5. package/dist/assets/index-VfUncKuS.js +25 -0
  6. package/dist/assets/index-VfUncKuS.js.map +1 -0
  7. package/dist/assets/{navara_wasm_font_worker_bg-XvE_oYPr.wasm → navara_wasm_font_worker_bg-CKqHBoCR.wasm} +0 -0
  8. package/dist/assets/{navara_wasm_worker_bg-Dg9fnGLP.wasm → navara_wasm_worker_bg-CT26EH41.wasm} +0 -0
  9. package/dist/index.d.ts +460 -43
  10. package/dist/index.js +3732 -3584
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.umd.cjs +230 -209
  13. package/dist/index.umd.cjs.map +1 -1
  14. package/package.json +17 -17
  15. package/src/camera.ts +11 -4
  16. package/src/core/InstancedMeshDesc.ts +1 -1
  17. package/src/core/MeshDesc.test.ts +396 -0
  18. package/src/core/MeshDesc.ts +219 -8
  19. package/src/core/errors.ts +14 -0
  20. package/src/core/index.ts +2 -0
  21. package/src/evaluations/FeatureEvaluator.ts +17 -10
  22. package/src/event/context.ts +6 -0
  23. package/src/event/feature.ts +15 -2
  24. package/src/event/features/billboard.test.ts +62 -0
  25. package/src/event/features/billboard.ts +4 -2
  26. package/src/event/index.ts +7 -0
  27. package/src/index.ts +174 -40
  28. package/src/material/macro/tileShader.ts +12 -2
  29. package/src/mesh/polyline.ts +32 -4
  30. package/src/mesh/sdfText/batchedSdfText.test.ts +65 -0
  31. package/src/mesh/sdfText/batchedSdfText.ts +121 -43
  32. package/src/mesh/sprite/billboardAtlas.ts +8 -1
  33. package/src/mesh/sprite/instancedSprite.ts +173 -65
  34. package/src/pick/pickHelper.test.ts +302 -0
  35. package/src/pick/pickHelper.ts +119 -20
  36. package/src/plugins/AttributionPlugin/index.ts +1 -1
  37. package/src/renderOrder.ts +10 -0
  38. package/src/terrain/sampleTerrainMostDetailed.test.ts +6 -6
  39. package/src/terrain/sampleTerrainMostDetailed.ts +7 -5
  40. package/src/terrain/terrainHeightEvent.test.ts +32 -0
  41. package/src/terrain/terrainHeightEvent.ts +22 -0
  42. package/src/type/index.ts +22 -1
  43. package/dist/assets/fontWorker-DaqfXmZf.js +0 -2
  44. package/dist/assets/fontWorker-DaqfXmZf.js.map +0 -1
  45. package/dist/assets/index-Dydat1h1.js +0 -25
  46. package/dist/assets/index-Dydat1h1.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -122,6 +122,19 @@ export declare function appendOptionalGBufferAttachments(renderTarget: WebGLRend
122
122
  /** Applies a material's three-state `lit` option. */
123
123
  export declare function applyLitOption(material: Material, lit: boolean | undefined): void;
124
124
 
125
+ /**
126
+ * `geodetic`, `matrix` and `matrixWorld` all claim the object's placement, so
127
+ * they share a single slot and at most one may be set. Every consumer resolves
128
+ * that slot with a priority chain (`applyTransform`, `applyRTETransform`), so
129
+ * allowing two would silently drop the lower-priority one — notably `matrix`
130
+ * under `matrixWorld`, which cannot be honoured at all once
131
+ * `matrixWorldAutoUpdate` is off. Takes the values rather than reading `this`,
132
+ * so a caller can check a prospective state before committing it. Exported so
133
+ * subclasses that override `onUpdateConfig` (e.g. RTE Descriptors like
134
+ * `GLTFModelDesc`) reuse this single check instead of hand-rolling their own.
135
+ */
136
+ export declare function assertNoTransformConflict(geodetic: GeodeticPlacement | undefined, matrix: Matrix4 | undefined, matrixWorld: Matrix4 | undefined): void;
137
+
125
138
  /** Creates the per-tile MRT trio. Injected so tests can supply fakes. */
126
139
  declare type AtlasFactory = (size: number) => CompositeAtlas;
127
140
 
@@ -982,8 +995,15 @@ export declare class BatchedSdfTextMesh extends InstancedMesh<Object3D> implemen
982
995
  private _transform;
983
996
  /** Labels in slot order — `_labels[slot]` is also the declutter handle map. */
984
997
  private _labels;
985
- /** Sparse batchIndex → label; labels are created on first per-feature touch. */
986
- private _labelByIndex;
998
+ /** Sparse anchor slot → label; labels are created on first per-feature touch. */
999
+ private _labelByInstance;
1000
+ /**
1001
+ * Feature (batch) index → this feature's anchor slots. A feature owns
1002
+ * multiple anchors for MultiPoint geometry and for labels derived from
1003
+ * line/polygon vertices via `geometryTypes`, so per-feature styling must fan
1004
+ * out to all of them. `null` means anchors and features are 1:1.
1005
+ */
1006
+ private _batchIndexToInstances;
987
1007
  /** In-flight per-feature text preparations; see {@link whenLabelsSettled}. */
988
1008
  private _pendingTextPrepares;
989
1009
  private _glyphs;
@@ -1091,9 +1111,20 @@ export declare class BatchedSdfTextMesh extends InstancedMesh<Object3D> implemen
1091
1111
  onAfterPicking(): void;
1092
1112
  getRenderable(): Object3D;
1093
1113
  private extractPositions;
1114
+ /**
1115
+ * Group anchor slots by their feature's batch index from the geometry's
1116
+ * per-anchor `batch_index` buffer. The u32 view is consumed synchronously —
1117
+ * other wasm calls may detach views, so it must not be stored. An identity
1118
+ * mapping (every feature owns exactly one anchor, the common MVT case) skips
1119
+ * the map entirely.
1120
+ */
1121
+ private _rebuildBatchIndexMap;
1122
+ /** All anchor slots owned by the feature at `batchIndex`. */
1123
+ private _instancesOfBatchIndex;
1094
1124
  _update(m: TextMesh, needRender?: () => void): Promise<void>;
1095
1125
  private _applyUpdate;
1096
1126
  setTextByBatchIndex(batchIndex: number, text: string): void;
1127
+ private _setTextByInstance;
1097
1128
  /** Kick off async font preparation for `text`, then lay it out — unless a
1098
1129
  * newer text supersedes it while the fonts load. */
1099
1130
  private _prepareAndApply;
@@ -1124,6 +1155,20 @@ declare class BatchPropResult {
1124
1155
  private constructor();
1125
1156
  free(): void;
1126
1157
  [Symbol.dispose](): void;
1158
+ /**
1159
+ * The picked feature's canonical global batch id (its first instance's
1160
+ * id). A picked instance of a multi-instance feature (e.g. MultiPoint)
1161
+ * carries its own id, while styling APIs report the canonical one, so
1162
+ * consumers correlate picks through this field.
1163
+ */
1164
+ get batchId(): number | undefined;
1165
+ /**
1166
+ * The picked feature's canonical global batch id (its first instance's
1167
+ * id). A picked instance of a multi-instance feature (e.g. MultiPoint)
1168
+ * carries its own id, while styling APIs report the canonical one, so
1169
+ * consumers correlate picks through this field.
1170
+ */
1171
+ set batchId(value: number | null | undefined);
1127
1172
  get layerId(): string | undefined;
1128
1173
  set layerId(value: string | null | undefined);
1129
1174
  properties: any;
@@ -1213,6 +1258,18 @@ declare class BillboardMaterial {
1213
1258
  * Emissive glow intensity (default: 0.3 when Bloom enabled)
1214
1259
  */
1215
1260
  set emissiveIntensity(value: number | null | undefined);
1261
+ /**
1262
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
1263
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
1264
+ * emits a billboard per line-string / polygon-ring vertex.
1265
+ */
1266
+ get geometryTypes(): string[] | undefined;
1267
+ /**
1268
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
1269
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
1270
+ * emits a billboard per line-string / polygon-ring vertex.
1271
+ */
1272
+ set geometryTypes(value: string[] | null | undefined);
1216
1273
  get height(): number | undefined;
1217
1274
  set height(value: number | null | undefined);
1218
1275
  /**
@@ -1561,6 +1618,18 @@ export declare type CameraEvent = {
1561
1618
  frustumChanged: () => void;
1562
1619
  };
1563
1620
 
1621
+ /**
1622
+ * Terminal record of a `flyTo` flight, delivered once through the event
1623
+ * stream. `completed` is `false` when the flight was superseded or canceled.
1624
+ */
1625
+ declare class CameraFlightEndedEvent {
1626
+ private constructor();
1627
+ free(): void;
1628
+ [Symbol.dispose](): void;
1629
+ completed: boolean;
1630
+ id: number;
1631
+ }
1632
+
1564
1633
  export declare type CameraFrustum = Required<NormalizeWASMClass<CameraFrustum_3>>;
1565
1634
 
1566
1635
  declare class CameraFrustum_2 {
@@ -1569,6 +1638,9 @@ declare class CameraFrustum_2 {
1569
1638
  constructor(near: number, far: number, fov: number, aspect_ratio: number);
1570
1639
  aspect_ratio: number;
1571
1640
  far: number;
1641
+ /**
1642
+ * Vertical field of view in radians.
1643
+ */
1572
1644
  fov: number;
1573
1645
  near: number;
1574
1646
  }
@@ -1579,6 +1651,9 @@ declare class CameraFrustum_3 {
1579
1651
  constructor(near: number, far: number, fov: number, aspect_ratio: number);
1580
1652
  aspect_ratio: number;
1581
1653
  far: number;
1654
+ /**
1655
+ * Vertical field of view in radians.
1656
+ */
1582
1657
  fov: number;
1583
1658
  near: number;
1584
1659
  }
@@ -1865,6 +1940,15 @@ declare type ConcurrencyManager = {
1865
1940
  canDecrement: () => boolean;
1866
1941
  };
1867
1942
 
1943
+ /**
1944
+ * Raised when a config or update names more than one of `geodetic` / `matrix` /
1945
+ * `matrixWorld`. They share a single placement slot, so the message is
1946
+ * deliberately symmetric — neither argument order implies a winner.
1947
+ */
1948
+ export declare class ConflictingTransformError extends Error {
1949
+ constructor(field: string, conflictsWith: string);
1950
+ }
1951
+
1868
1952
  declare class ConstructPolygonBatchedFeatureParameters {
1869
1953
  private constructor();
1870
1954
  free(): void;
@@ -1954,6 +2038,14 @@ declare type ConvertColorFields<T> = {
1954
2038
  [K in keyof T]: K extends `${string}Color` | "color" ? T[K] extends number | undefined ? Color | undefined : T[K] extends number ? Color : T[K] : T[K] extends object | undefined ? ConvertColorFields<T[K]> | Extract<T[K], undefined> : T[K];
1955
2039
  };
1956
2040
 
2041
+ /**
2042
+ * Helper type to narrow the generated `geometryTypes?: string[]` material
2043
+ * fields to the {@link SourceGeometryType} literal union.
2044
+ */
2045
+ declare type ConvertGeometryTypeFields<T> = {
2046
+ [K in keyof T]: K extends "geometryTypes" ? SourceGeometryType[] | Extract<T[K], undefined> : T[K] extends object | undefined ? ConvertGeometryTypeFields<T[K]> | Extract<T[K], undefined> : T[K];
2047
+ };
2048
+
1957
2049
  /**
1958
2050
  * Converts screen coordinates to world coordinates by raycasting against the WGS84 ellipsoid.
1959
2051
  * @param window - Window configuration with width, height, and pixelRatio
@@ -2008,13 +2100,22 @@ declare class Core {
2008
2100
  * each from its `InMemoryBufferStore` map every frame.
2009
2101
  */
2010
2102
  drainRemovedExternalHandles(): Int32Array;
2011
- flyTo(position?: Float64Array | null, pitch?: number | null, heading?: number | null, roll?: number | null, duration?: number | null, max_height?: number | null, distance?: number | null): void;
2103
+ /**
2104
+ * Starts a camera flight and returns its id. A `CameraFlightEndedEvent`
2105
+ * carrying the same id is delivered through the event stream when the
2106
+ * flight completes (`completed: true`) or is superseded/canceled
2107
+ * (`completed: false`).
2108
+ */
2109
+ flyTo(position?: Float64Array | null, pitch?: number | null, heading?: number | null, roll?: number | null, duration?: number | null, max_height?: number | null, distance?: number | null, easing?: number | null): number;
2012
2110
  genGlobalBatchId(): number | undefined;
2013
2111
  getBufferF32(handle: number): Float32Array | undefined;
2014
2112
  getBufferF64(handle: number): Float64Array | undefined;
2015
2113
  getBufferU32(handle: number): Uint32Array | undefined;
2016
2114
  getBufferU8(handle: number): Uint8Array | undefined;
2017
- getCameraFOVY(): number | undefined;
2115
+ /**
2116
+ * Vertical field of view in radians as set via `setFrustum`.
2117
+ */
2118
+ getCameraFOV(): number | undefined;
2018
2119
  getCameraOrientation(): CameraOrientation_2 | undefined;
2019
2120
  getCameraPositionECEF(): Float64Array | undefined;
2020
2121
  getCameraPositionLLE(): Float64Array | undefined;
@@ -3304,11 +3405,13 @@ declare class ElevationHeatmapMaterial {
3304
3405
  * Wrapper class for geodesic calculations on an ellipsoid surface.
3305
3406
  * Precomputes common variables for optimization when instantiated.
3306
3407
  *
3408
+ * All latitudes/longitudes and headings are in **degrees**.
3409
+ *
3307
3410
  * @example
3308
3411
  * ```typescript
3309
3412
  * const geodesic = new EllipsoidGeodesic(
3310
- * { lat: 0.5, lng: 2.0, height: 0 },
3311
- * { lat: 0.6, lng: 2.1, height: 0 }
3413
+ * { lat: 35.6812, lng: 139.7671, height: 0 },
3414
+ * { lat: 34.7025, lng: 135.4959, height: 0 }
3312
3415
  * );
3313
3416
  *
3314
3417
  * console.log(geodesic.distance);
@@ -3322,8 +3425,8 @@ export declare class EllipsoidGeodesic {
3322
3425
  private _raw;
3323
3426
  /**
3324
3427
  * Create a new geodesic between two points on the ellipsoid.
3325
- * @param start - Start point in geodetic coordinates (lat/lng in radians)
3326
- * @param end - End point in geodetic coordinates (lat/lng in radians)
3428
+ * @param start - Start point in geodetic coordinates (lat/lng in degrees)
3429
+ * @param end - End point in geodetic coordinates (lat/lng in degrees)
3327
3430
  */
3328
3431
  constructor(start: LatLngHeight, end: LatLngHeight);
3329
3432
  /** Distance in meters between start and end points */
@@ -3335,24 +3438,24 @@ export declare class EllipsoidGeodesic {
3335
3438
  * unreliable solution.
3336
3439
  */
3337
3440
  get converged(): boolean;
3338
- /** Heading at the start point in radians */
3441
+ /** Heading at the start point in degrees */
3339
3442
  get startHeading(): number;
3340
- /** Heading at the end point in radians */
3443
+ /** Heading at the end point in degrees */
3341
3444
  get endHeading(): number;
3342
- /** Start point in geodetic coordinates */
3445
+ /** Start point in geodetic coordinates (lat/lng in degrees) */
3343
3446
  get start(): LatLngHeight;
3344
- /** End point in geodetic coordinates */
3447
+ /** End point in geodetic coordinates (lat/lng in degrees) */
3345
3448
  get end(): LatLngHeight;
3346
3449
  /**
3347
3450
  * Interpolate points along the geodesic path.
3348
3451
  * @param granularity - Distance between interpolated points in meters (optional)
3349
- * @returns Array of interpolated points in geodetic coordinates
3452
+ * @returns Array of interpolated points in geodetic coordinates (lat/lng in degrees)
3350
3453
  */
3351
3454
  interpolatePoints(granularity?: number): LatLngHeight[];
3352
3455
  /**
3353
3456
  * Interpolate a point at a specific distance along the geodesic path.
3354
3457
  * @param distance - Distance from start point in meters
3355
- * @returns Interpolated point in geodetic coordinates
3458
+ * @returns Interpolated point in geodetic coordinates (lat/lng in degrees)
3356
3459
  */
3357
3460
  interpolateDistance(distance: number): LatLngHeight;
3358
3461
  /**
@@ -3475,6 +3578,7 @@ declare class EventContext {
3475
3578
  readonly viewEvents: EventHandler<ViewEvents>;
3476
3579
  readonly layersManager: LayersManager;
3477
3580
  readonly viewContext: ViewContext;
3581
+ readonly flightHandler: FlightHandler;
3478
3582
  readonly layerHandler?: LayerHandler;
3479
3583
  readonly fontManager?: FontManager;
3480
3584
  readonly textureFragmentIndex?: Map<string, Set<TextureSlot>>;
@@ -3510,6 +3614,7 @@ declare type EventContextArgs = {
3510
3614
  viewEvents: EventHandler<ViewEvents>;
3511
3615
  layersManager: LayersManager;
3512
3616
  viewContext: ViewContext;
3617
+ flightHandler: FlightHandler;
3513
3618
  layerHandler?: LayerHandler;
3514
3619
  fontManager?: FontManager;
3515
3620
  textureFragmentIndex?: Map<string, Set<TextureSlot>>;
@@ -3557,6 +3662,7 @@ declare class Events {
3557
3662
  private constructor();
3558
3663
  free(): void;
3559
3664
  [Symbol.dispose](): void;
3665
+ take_camera_flight_ended(): CameraFlightEndedEvent[];
3560
3666
  take_camera_frustum_updated(): CameraFrustum_2 | undefined;
3561
3667
  take_camera_transform_updated(): Transform_2 | undefined;
3562
3668
  take_data_requested(): DataRequestEvent[];
@@ -3802,6 +3908,11 @@ declare type FeatureHandler = {
3802
3908
  * Information about a feature batch, passed to evaluation callbacks.
3803
3909
  */
3804
3910
  export declare type FeatureInfo = {
3911
+ /**
3912
+ * The feature's canonical global batch id (its first instance's id when a
3913
+ * feature spans several instances, e.g. MultiPoint). Pick events report the
3914
+ * same canonical id, so picks and evaluations correlate through this field.
3915
+ */
3805
3916
  batchId: number;
3806
3917
  properties: Record<string, unknown> | undefined;
3807
3918
  layerId: LayerId | undefined;
@@ -3850,6 +3961,23 @@ export declare type FinalCopyPassConfig = Description & EffectConfig;
3850
3961
 
3851
3962
  export declare type FinalCopyPassUpdate = Description & EffectUpdate;
3852
3963
 
3964
+ /** Settles the pending `flyTo` promise registered under `id`. */
3965
+ declare type FlightHandler = (id: number, completed: boolean) => void;
3966
+
3967
+ /** Easing presets applied to a `flyTo` flight's normalized time. */
3968
+ export declare type FlyToEasing = "linear" | "quadInOut" | "cubicInOut" | "cubicOut" | "quinticInOut";
3969
+
3970
+ export declare type FlyToOptions = {
3971
+ /** Animation duration in milliseconds. Defaults to a duration derived from
3972
+ * the flight distance (2–3 s). Pass `0` to jump instantly. */
3973
+ duration?: number;
3974
+ /** Maximum height during the flight arc in meters. */
3975
+ maxHeight?: number;
3976
+ /** Easing preset. Defaults to `"quinticInOut"`, or `"cubicOut"` when
3977
+ * descending from above 11,500 m. */
3978
+ easing?: FlyToEasing;
3979
+ };
3980
+
3853
3981
  export { FontFace_2 as FontFace }
3854
3982
 
3855
3983
  export { FontFamily }
@@ -4010,16 +4138,50 @@ export declare function generateTileMapFragment(maxTextures: number, features: T
4010
4138
  */
4011
4139
  export declare function generateTileNormalFragmentMaps(features: TileShaderFeatures): string;
4012
4140
 
4141
+ /**
4142
+ * High-level geographic placement of a mesh object.
4143
+ *
4144
+ * All angles are in **degrees** and `height` is in metres, matching
4145
+ * `ThreeView.setCamera`. The asset is oriented in a West-Up-North tangent
4146
+ * frame, which matches glTF's own convention (front `+Z`, up `+Y`,
4147
+ * right `-X`) on all three axes — so an unmodified glTF asset needs no
4148
+ * up-axis correction.
4149
+ */
4150
+ export declare type GeodeticPlacement = {
4151
+ /** Longitude in degrees. */
4152
+ lng: number;
4153
+ /** Latitude in degrees. */
4154
+ lat: number;
4155
+ /**
4156
+ * Metres above the ellipsoid, or above terrain when `heightReference` is
4157
+ * `"terrain"`. Defaults to 0.
4158
+ */
4159
+ height?: number;
4160
+ /**
4161
+ * Degrees clockwise from north that the asset's front (glTF `+Z`) faces.
4162
+ * Same convention as `setCamera`'s heading. Defaults to 0.
4163
+ */
4164
+ heading?: number;
4165
+ /** Degrees, nose up positive. Defaults to 0. */
4166
+ pitch?: number;
4167
+ /** Degrees, right wing down positive. Defaults to 0. */
4168
+ roll?: number;
4169
+ /** Uniform or per-axis scale of the frame. Defaults to 1. */
4170
+ scale?: number | XYZ;
4171
+ /** How `height` is interpreted. Defaults to `"ellipsoid"`. */
4172
+ heightReference?: "ellipsoid" | "terrain";
4173
+ };
4174
+
4013
4175
  /**
4014
4176
  * Computes the surface normal vector at a geodetic position on the WGS84 ellipsoid.
4015
- * @param lle - Geodetic coordinates (lng in radians, lat in radians, height in meters)
4177
+ * @param lle - Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
4016
4178
  * @returns Unit normal vector pointing outward from the ellipsoid surface
4017
4179
  */
4018
4180
  export declare function geodeticSurfaceNormal(lle: LatLngHeight): Vector3;
4019
4181
 
4020
4182
  /**
4021
4183
  * Converts geodetic coordinates (longitude, latitude, height) to a Cartesian Vector3 in ECEF coordinates.
4022
- * @param lle - Geodetic coordinates (lng in radians, lat in radians, height in meters)
4184
+ * @param lle - Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
4023
4185
  * @returns Cartesian Vector3 in Earth-Centered Earth-Fixed (ECEF) coordinates
4024
4186
  */
4025
4187
  export declare function geodeticToVector3(lle: LatLngHeight): Vector3;
@@ -4335,6 +4497,27 @@ declare type HandleEvent = {
4335
4497
  deleted: () => void;
4336
4498
  };
4337
4499
 
4500
+ /**
4501
+ * Builds a WUN tangent frame at a geodetic position and composes heading,
4502
+ * pitch, roll and scale onto it — the single call that turns a geographic
4503
+ * placement into a world matrix.
4504
+ *
4505
+ * `heading` is the compass bearing the asset's front faces, where the front is
4506
+ * glTF's own `+Z` — the same convention as `ThreeView.setCamera`. Other globe
4507
+ * engines differ in which axis they treat as an asset's front, so a model
4508
+ * ported from one may need a multiple of 90° added to its heading.
4509
+ *
4510
+ * `lng`/`lat` and all angles here are in **degrees**, matching
4511
+ * `setCamera` and the `geodetic` mesh Descriptor field.
4512
+ *
4513
+ * `heightReference` is intentionally not accepted: resolving terrain-relative
4514
+ * height needs a view to sample from, so it is the Descriptor's job.
4515
+ *
4516
+ * @param placement - Geographic placement in degrees and metres
4517
+ * @returns 4x4 transformation matrix from the placed local frame to ECEF
4518
+ */
4519
+ export declare function headingPitchRollToFixedFrame(placement: Omit<GeodeticPlacement, "heightReference">): Matrix4;
4520
+
4338
4521
  declare class HillshadeBackfilledEvent {
4339
4522
  private constructor();
4340
4523
  free(): void;
@@ -4564,7 +4747,7 @@ export declare type InstancedMeshConfig = MeshConfigWithSelectiveEffect;
4564
4747
  * Per-instance variation is achieved through `instanceMatrix` (position, rotation, scale)
4565
4748
  * and `instanceColor` (per-instance color).
4566
4749
  *
4567
- * The parent's transform fields (position, scale, rotation, matrix, matrixWorld)
4750
+ * The parent's transform fields (position, scale, rotation, matrix, matrixWorld, geodetic)
4568
4751
  * define the parent coordinate space. Each instance's transform is local to the parent.
4569
4752
  *
4570
4753
  * Subclasses that maintain external per-instance state (e.g. picking batchIds)
@@ -4777,7 +4960,15 @@ export declare type InstancedSpriteMaterialProps = {
4777
4960
 
4778
4961
  export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material | Material[], CustomObject3DEventMap> implements PickableMesh, DeclutterParticipant {
4779
4962
  private _geometryType;
4780
- private _batchIdToInstance;
4963
+ /**
4964
+ * Feature (batch) index → this feature's instance ids. A feature owns
4965
+ * multiple instances for MultiPoint geometry and for points derived from
4966
+ * line/polygon vertices via `geometryTypes`, so per-feature styling must
4967
+ * fan out to all of them. `null` means instances and features are 1:1.
4968
+ */
4969
+ private _batchIndexToInstances;
4970
+ /** Instance count of the current geometry; bounds the identity fallback. */
4971
+ private _instanceCount;
4781
4972
  private _initialColor;
4782
4973
  private _initialHeight;
4783
4974
  private _initialSize;
@@ -4870,6 +5061,15 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
4870
5061
  * hasn't been overridden per-feature via setFeatureImageByBatchId.
4871
5062
  */
4872
5063
  private _setDefaultImage;
5064
+ /**
5065
+ * An instance's atlas rect changed. The rect drives the quad's aspect and
5066
+ * whether the instance draws at all, so the declutter bounds computed before
5067
+ * the image landed are stale — and because packs resolve long after the
5068
+ * frame that requested them, the view has usually gone idle by now. Without
5069
+ * the render request the page keeps showing the pre-image state until the
5070
+ * next camera move.
5071
+ */
5072
+ private _onAtlasRectsChanged;
4873
5073
  onBeforePicking(): void;
4874
5074
  onAfterPicking(): void;
4875
5075
  getRenderable(): Object3D;
@@ -4877,10 +5077,21 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
4877
5077
  * Get the enhancer, throwing if not initialized.
4878
5078
  */
4879
5079
  private getEnhancer;
4880
- setFeatureColorByBatchId(batchId: number, color: Color_3): void;
4881
- setFeatureShowByBatchId(batchId: number, rawVisible: boolean): void;
4882
- setFeatureOpacityByBatchId(batchId: number, opacity: number): void;
4883
- setFeatureHeightByBatchId(batchId: number, height: number): void;
5080
+ /**
5081
+ * Group instances by their feature's batch index from the geometry's
5082
+ * per-instance `batch_index` buffer. The u32 view is consumed synchronously,
5083
+ * so other wasm calls may detach views, so it must not be stored. The handle
5084
+ * stays owned by the ECS geometry, whose destroy path frees it
5085
+ * (`remove_from_buf`). An identity mapping (every feature owns exactly one
5086
+ * instance, the common case) skips the map entirely.
5087
+ */
5088
+ private _rebuildBatchIndexMap;
5089
+ /** All instances owned by the feature at `batchIndex`; empty when unknown. */
5090
+ private instancesOfBatchIndex;
5091
+ setFeatureColorByBatchIndex(batchIndex: number, color: Color_3): void;
5092
+ setFeatureShowByBatchIndex(batchIndex: number, rawVisible: boolean): void;
5093
+ setFeatureOpacityByBatchIndex(batchIndex: number, opacity: number): void;
5094
+ setFeatureHeightByBatchIndex(batchIndex: number, height: number): void;
4884
5095
  /**
4885
5096
  * Set one instance's declutter fade target; the attribute animates toward
4886
5097
  * it in {@link stepDeclutterFade}. Deliberately separate from the `show`
@@ -4893,8 +5104,8 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
4893
5104
  * layer-level `declutterPriority` for this instance. Driven by the feature
4894
5105
  * evaluator.
4895
5106
  */
4896
- setFeatureDeclutterPriorityByBatchId(batchId: number, priority: number): void;
4897
- setFeatureSizeByBatchId(batchId: number, size: number): void;
5107
+ setFeatureDeclutterPriorityByBatchIndex(batchIndex: number, priority: number): void;
5108
+ setFeatureSizeByBatchIndex(batchIndex: number, size: number): void;
4898
5109
  /**
4899
5110
  * Give one feature its own image, packed into this mesh's texture atlas.
4900
5111
  * Loads are deduplicated by URL, so styling many features with few distinct
@@ -4903,7 +5114,7 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
4903
5114
  * reverts the feature to the material's default image. No-op for
4904
5115
  * non-billboard (point) meshes.
4905
5116
  */
4906
- setFeatureImageByBatchId(batchId: number, url: string | null | undefined): Promise<void>;
5117
+ setFeatureImageByBatchIndex(batchIndex: number, url: string | null | undefined): Promise<void>;
4907
5118
  dispose(): void;
4908
5119
  }
4909
5120
 
@@ -4946,8 +5157,12 @@ export declare type LabelLayout = {
4946
5157
  maxYEm: number;
4947
5158
  };
4948
5159
 
5160
+ /** Geodetic position: `lat`/`lng` in **degrees**. */
4949
5161
  export declare type LatLng = Omit<LatLngHeight, "height">;
4950
5162
 
5163
+ /**
5164
+ * Geodetic position: `lat`/`lng` in **degrees**, `height` in meters.
5165
+ */
4951
5166
  export declare type LatLngHeight = Required<NormalizeWASMClass<LLE>>;
4952
5167
 
4953
5168
  /**
@@ -5400,6 +5615,15 @@ declare class MemoryStats_2 {
5400
5615
  readonly sseMultiplier: number;
5401
5616
  }
5402
5617
 
5618
+ /**
5619
+ * Merges a partial placement onto an existing one and checks it is complete.
5620
+ * Pure — returns the merged value instead of assigning it, so the caller can
5621
+ * validate before committing. Exported so subclasses that manage their own
5622
+ * `onUpdateConfig` (e.g. `GLTFModelDesc`'s RTE-split transform) can merge a
5623
+ * `geodetic` update with the same semantics instead of re-deriving them.
5624
+ */
5625
+ export declare function mergeGeodetic(current: GeodeticPlacement | undefined, update: Partial<GeodeticPlacement>): GeodeticPlacement;
5626
+
5403
5627
  declare class Mesh {
5404
5628
  private constructor();
5405
5629
  free(): void;
@@ -5517,6 +5741,9 @@ export declare type MeshConfig = {
5517
5741
  * Local frame. When combined with `position` / `rotation` / `scale`, the
5518
5742
  * effective local matrix is `matrix · T(position) · R(rotation) · S(scale)`.
5519
5743
  * Disables Three.js's auto matrix update.
5744
+ *
5745
+ * Mutually exclusive with `matrixWorld` and `geodetic`: all three define the
5746
+ * object's placement.
5520
5747
  */
5521
5748
  matrix?: Matrix4;
5522
5749
  /**
@@ -5525,8 +5752,25 @@ export declare type MeshConfig = {
5525
5752
  * matrix is `matrixWorld · T(position) · R(rotation) · S(scale)`, so the
5526
5753
  * offset fields are interpreted in the frame's local coordinates.
5527
5754
  * Disables Three.js's auto matrix-world update.
5755
+ *
5756
+ * Mutually exclusive with `matrix` and `geodetic`: all three define the
5757
+ * object's placement.
5528
5758
  */
5529
5759
  matrixWorld?: Matrix4;
5760
+ /**
5761
+ * High-level geographic placement in degrees and metres. Builds a
5762
+ * West-Up-North tangent frame at `lng`/`lat`/`height` and applies
5763
+ * `heading`/`pitch`/`roll`/`scale`, then occupies the same slot as
5764
+ * `matrixWorld` — so `position` / `rotation` / `scale` remain offsets
5765
+ * *inside* the resulting frame.
5766
+ *
5767
+ * `heading` is the compass bearing the asset's front (glTF `+Z`) faces, the
5768
+ * same convention as `setCamera`. Because the frame is Y-up with `+Z` north,
5769
+ * an unmodified glTF asset needs no up-axis correction.
5770
+ *
5771
+ * Mutually exclusive with `matrix` and `matrixWorld`.
5772
+ */
5773
+ geodetic?: GeodeticPlacement;
5530
5774
  /**
5531
5775
  * Lighting override for every material of the mesh. `false` outputs albedo
5532
5776
  * only, while normals and the shadow G-buffer keep being written.
@@ -5658,7 +5902,7 @@ export declare type MeshConfigWithSelectiveEffect = MeshConfig & {
5658
5902
  * The base class applies position/scale/rotation and adds it to the scene
5659
5903
  * determined by {@link getPassKey}.
5660
5904
  * 3. **{@link onUpdateConfig}** - Called when `handle.update()` is invoked. The base class
5661
- * handles `visible`, `matrix`, `matrixWorld`, `position`, `scale`, and `rotation`; override to handle your
5905
+ * handles `visible`, `matrix`, `matrixWorld`, `position`, `scale`, `rotation`, and `geodetic`; override to handle your
5662
5906
  * custom properties. Always call `super.onUpdateConfig(updates)`.
5663
5907
  * 4. **{@link update}** - Optional per-frame callback for animation.
5664
5908
  * 5. **{@link onResize}** - Optional callback when the viewport is resized.
@@ -5684,10 +5928,51 @@ export declare abstract class MeshDesc<Config extends MeshConfig = MeshConfig, U
5684
5928
  rotation?: XYZ;
5685
5929
  matrix?: Matrix4;
5686
5930
  matrixWorld?: Matrix4;
5931
+ geodetic?: GeodeticPlacement;
5932
+ /** Terrain height under `geodetic`, when `heightReference` is `"terrain"`. */
5933
+ protected terrainHeight?: number;
5934
+ private terrainUnsubscribe?;
5687
5935
  /** Three-state `lit` override (see {@link MeshConfig.lit}). */
5688
5936
  lit?: boolean;
5689
5937
  private prevPassKey?;
5690
5938
  constructor(view: ThreeView, ctx: ViewContext, config?: Config);
5939
+ /**
5940
+ * Builds the world frame for a {@link GeodeticPlacement}, adding
5941
+ * {@link terrainHeight} when one has been observed. This method does not
5942
+ * gate on `heightReference` itself — `terrainHeight` is only ever populated
5943
+ * for a terrain-referenced placement, and is cleared otherwise.
5944
+ *
5945
+ * Fields are passed explicitly rather than spread: `headingPitchRollToFixedFrame`
5946
+ * rejects `heightReference`, which this class resolves itself.
5947
+ */
5948
+ protected resolveGeodeticFrame(g: GeodeticPlacement): Matrix4;
5949
+ /**
5950
+ * Subscribes to terrain height under a terrain-referenced `geodetic`
5951
+ * placement.
5952
+ *
5953
+ * `sampleTerrainHeight` seeds synchronously from tiles already resident, so
5954
+ * the object does not sit at the wrong altitude while tiles stream in; the
5955
+ * observer then re-places it on every terrain update. With no terrain layer
5956
+ * added, the sample is `undefined` and the observer does not fire until a
5957
+ * terrain layer is added, so the placement degrades to ellipsoid-relative
5958
+ * rather than failing — terrain layers may be added after the object.
5959
+ *
5960
+ * Protected (not private) so a subclass that manages its own world-matrix
5961
+ * representation for `geodetic` (e.g. `GLTFModelDesc`'s RTE position split)
5962
+ * can call it directly from its own `onCreate`/`onUpdateConfig` instead of
5963
+ * routing through this class's `onCreate`.
5964
+ */
5965
+ protected subscribeTerrainHeight(): void;
5966
+ /**
5967
+ * Re-applies the effective transform after `geodetic`'s resolved frame
5968
+ * changes outside of `onUpdateConfig` — currently only a terrain-height
5969
+ * observation firing asynchronously. Subclasses that override
5970
+ * `applyTransform`'s effect with their own representation (e.g.
5971
+ * `GLTFModelDesc`'s RTE position/rotation split, which needs the *encoded*
5972
+ * position refreshed too) override this instead of relying on the default.
5973
+ */
5974
+ protected reapplyGeodeticFrame(): void;
5975
+ private unsubscribeTerrainHeight;
5691
5976
  /**
5692
5977
  * Applies {@link lit} to every material under the mesh. Subclasses that
5693
5978
  * attach materials asynchronously (glTF) call it again once they exist.
@@ -5726,12 +6011,17 @@ export declare abstract class MeshDesc<Config extends MeshConfig = MeshConfig, U
5726
6011
  /**
5727
6012
  * Applies the configured transform to the underlying `Object3D`.
5728
6013
  *
5729
- * When `matrixWorld` (or `matrix`) is set together with any of
6014
+ * When `matrixWorld` / `geodetic` (or `matrix`) is set together with any of
5730
6015
  * `position` / `rotation` / `scale`, the base/frame is left-multiplied
5731
6016
  * by the local `T · R · S`: e.g. `effective = matrixWorld · T · R · S`.
5732
6017
  * This lets callers pass a frame (such as an NUE-to-ECEF matrix) as
5733
6018
  * `matrixWorld` and express offsets inside that frame via
5734
6019
  * `position` / `rotation` / `scale`.
6020
+ *
6021
+ * The branches below are a priority chain, which is only safe because
6022
+ * `assertNoTransformConflict` has already rejected any state with more than
6023
+ * one of `geodetic` / `matrixWorld` / `matrix` set — so an earlier branch
6024
+ * can never shadow a configured field.
5735
6025
  */
5736
6026
  private applyTransform;
5737
6027
  removeFromScene(passKey: PassKey): void;
@@ -5805,7 +6095,14 @@ declare type MeshHandler = {
5805
6095
  setTileMeshPrepared: (handle: bigint) => void;
5806
6096
  };
5807
6097
 
5808
- export declare type MeshUpdate = Pick<MeshConfig, "position" | "scale" | "rotation" | "matrix" | "matrixWorld" | "lit"> & BaseDescConfigUpdate;
6098
+ export declare type MeshUpdate = Pick<MeshConfig, "position" | "scale" | "rotation" | "matrix" | "matrixWorld" | "lit"> & {
6099
+ /**
6100
+ * Partial geographic placement, merged into the stored placement — so
6101
+ * `update({ geodetic: { heading } })` keeps the existing lng/lat/height.
6102
+ * `lng` and `lat` are required only when the object has no placement yet.
6103
+ */
6104
+ geodetic?: Partial<GeodeticPlacement>;
6105
+ } & BaseDescConfigUpdate;
5809
6106
 
5810
6107
  export declare type MeshUpdateWithSelectiveEffect = MeshUpdate & {
5811
6108
  effectIds?: string[];
@@ -6403,7 +6700,11 @@ export declare type Options = {
6403
6700
  atmosphere?: AtmosphereOptions;
6404
6701
  /** Background color of the scene. Defaults to dark color (0x0a0a0f). */
6405
6702
  backgroundColor?: Color_2;
6406
- /** Feature picking configuration. */
6703
+ /**
6704
+ * Feature picking configuration (default: true). Enables the `featureClick`
6705
+ * event (click) and the `featureHover` / `featureEnter` / `featureLeave`
6706
+ * events (mousemove).
6707
+ */
6407
6708
  picking?: boolean;
6408
6709
  /** When true, renders every frame. When false, renders only on changes or when forceUpdate() is called. */
6409
6710
  animation?: boolean;
@@ -6826,6 +7127,18 @@ declare class PointMaterial {
6826
7127
  * Emissive glow intensity (default: 0.3 when Bloom enabled)
6827
7128
  */
6828
7129
  set emissiveIntensity(value: number | null | undefined);
7130
+ /**
7131
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
7132
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
7133
+ * emits a point per line-string / polygon-ring vertex.
7134
+ */
7135
+ get geometryTypes(): string[] | undefined;
7136
+ /**
7137
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
7138
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
7139
+ * emits a point per line-string / polygon-ring vertex.
7140
+ */
7141
+ set geometryTypes(value: string[] | null | undefined);
6829
7142
  get height(): number | undefined;
6830
7143
  set height(value: number | null | undefined);
6831
7144
  /**
@@ -7544,6 +7857,22 @@ declare class PolylineMaterial {
7544
7857
  * Emissive glow intensity (default: 0.3 when Bloom enabled)
7545
7858
  */
7546
7859
  set emissiveIntensity(value: number | null | undefined);
7860
+ /**
7861
+ * Source geometry types this appearance consumes: `"line"`, `"polygon"`.
7862
+ * Defaults to `["line"]`; adding `"polygon"` also renders polygon boundary
7863
+ * rings (outer ring and holes) as closed polylines at the ring's base
7864
+ * height. Extruded-polygon edges stay the polygon material's `outline`
7865
+ * feature.
7866
+ */
7867
+ get geometryTypes(): string[] | undefined;
7868
+ /**
7869
+ * Source geometry types this appearance consumes: `"line"`, `"polygon"`.
7870
+ * Defaults to `["line"]`; adding `"polygon"` also renders polygon boundary
7871
+ * rings (outer ring and holes) as closed polylines at the ring's base
7872
+ * height. Extruded-polygon edges stay the polygon material's `outline`
7873
+ * feature.
7874
+ */
7875
+ set geometryTypes(value: string[] | null | undefined);
7547
7876
  get height(): number | undefined;
7548
7877
  set height(value: number | null | undefined);
7549
7878
  /**
@@ -7651,6 +7980,8 @@ export declare class PolylineMesh extends BatchedFeatureMesh<BufferGeometry<Attr
7651
7980
  get emissiveColor(): number;
7652
7981
  get emissiveIntensity(): number;
7653
7982
  get effectIdsMask(): number;
7983
+ /** Visible stroke width to restore after a pick-pass width bump. */
7984
+ private _pickSavedWidth?;
7654
7985
  onBeforePicking(pickingCoord?: Vector2): void;
7655
7986
  onAfterPicking(): void;
7656
7987
  _getDefaultBatchAttributeValues(): DefaultBatchAttributeValues;
@@ -8259,9 +8590,9 @@ export declare type RTEUserData = {
8259
8590
  };
8260
8591
 
8261
8592
  export declare type SampledTerrainPosition = {
8262
- /** Latitude in radians, echoed from the input. */
8593
+ /** Latitude in degrees, echoed from the input. */
8263
8594
  lat: number;
8264
- /** Longitude in radians, echoed from the input. */
8595
+ /** Longitude in degrees, echoed from the input. */
8265
8596
  lng: number;
8266
8597
  /**
8267
8598
  * Terrain height in meters, or `undefined` when no tile covering the
@@ -8854,6 +9185,15 @@ declare class SourceDescription_2 {
8854
9185
  set type(value: string | null | undefined);
8855
9186
  }
8856
9187
 
9188
+ /**
9189
+ * Source geometry categories a vector appearance can consume via its
9190
+ * `geometryTypes` option. Each appearance defaults to its native geometry only
9191
+ * (`"point"` for point/billboard/text, `"line"` for polyline); adding entries
9192
+ * derives extra representations, e.g. `polyline: { geometryTypes: ["line",
9193
+ * "polygon"] }` also renders polygon boundary rings as polylines.
9194
+ */
9195
+ export declare type SourceGeometryType = "point" | "line" | "polygon";
9196
+
8857
9197
  export declare type SourceLayerBase<Layer extends {
8858
9198
  source?: string | undefined;
8859
9199
  }> = Omit<Layer, "source"> & {
@@ -9093,6 +9433,18 @@ declare class TextMaterial {
9093
9433
  * is specified.
9094
9434
  */
9095
9435
  set font(value: string | null | undefined);
9436
+ /**
9437
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
9438
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
9439
+ * emits a label per line-string / polygon-ring vertex.
9440
+ */
9441
+ get geometryTypes(): string[] | undefined;
9442
+ /**
9443
+ * Source geometry types this appearance consumes: `"point"`, `"line"`,
9444
+ * `"polygon"`. Defaults to `["point"]`; adding `"line"`/`"polygon"` also
9445
+ * emits a label per line-string / polygon-ring vertex.
9446
+ */
9447
+ set geometryTypes(value: string[] | null | undefined);
9096
9448
  get height(): number | undefined;
9097
9449
  set height(value: number | null | undefined);
9098
9450
  /**
@@ -9338,6 +9690,11 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9338
9690
  private _declutterRetryDelay;
9339
9691
  private _isIdle;
9340
9692
  private _uniforms;
9693
+ /** Pending `flyTo` promises keyed by flight id, settled by
9694
+ * `camera_flight_ended` events from the engine. */
9695
+ private _pendingFlights;
9696
+ /** Currently hovered feature, used to diff-synthesize hover events. */
9697
+ private _hoveredFeature;
9341
9698
  private _meshes;
9342
9699
  private _abortControllers;
9343
9700
  private _workerPoolPromises;
@@ -9755,16 +10112,24 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9755
10112
  moveCameraWithDirection(dir: number[], amount: number): void;
9756
10113
  /**
9757
10114
  * Animates the camera to fly to a target position.
10115
+ *
10116
+ * The flight follows an arced path: the default duration is derived from
10117
+ * the flight distance (2–3 s), the default easing is `quinticInOut`
10118
+ * (`cubicOut` when descending from high altitude), and longitudes take the
10119
+ * short way across the antimeridian.
10120
+ *
9758
10121
  * @param camPos - Target position with required lng/lat (degrees). Provide either `height` (meters above the ellipsoid)
9759
10122
  * or `distance` (meters from the target point along the camera forward direction). Optional pitch, heading, roll (degrees).
9760
- * @param duration - Animation duration in milliseconds
9761
- * @param maxHeight - Maximum height during the flight arc in meters
10123
+ * @param options - Flight options (`duration`, `maxHeight`, `easing`)
10124
+ * @returns A promise resolving to `true` when the flight completes, or
10125
+ * `false` when it is interrupted by another camera operation, such as a
10126
+ * newer `flyTo` or a `setCamera` call.
9762
10127
  */
9763
10128
  flyTo(camPos: CameraPosition & Required<Pick<CameraPosition, "lng" | "lat">> & ({
9764
10129
  height: number;
9765
10130
  } | {
9766
10131
  distance: number;
9767
- }), duration?: number, maxHeight?: number): void;
10132
+ }), options?: FlyToOptions): Promise<boolean>;
9768
10133
  /**
9769
10134
  * Makes the camera look at a target position with an offset.
9770
10135
  * @param target - Target geodetic position (lng in degrees, lat in degrees, height in meters)
@@ -9788,7 +10153,7 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9788
10153
  cameraFreeLook(enabled: boolean, target?: LatLngHeight): void;
9789
10154
  /**
9790
10155
  * Samples the terrain height at a given geodetic position synchronously.
9791
- * @param pos - Geodetic position (lat in radians, lng in radians)
10156
+ * @param pos - Geodetic position (lat in degrees, lng in degrees)
9792
10157
  * @returns Terrain height in meters, or undefined if terrain data not loaded
9793
10158
  */
9794
10159
  sampleTerrainHeight(pos: LatLng): number | undefined;
@@ -9806,14 +10171,14 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9806
10171
  * sampled.
9807
10172
  *
9808
10173
  * @param source - A registered terrain source (handle or id)
9809
- * @param positions - Geodetic positions (lat/lng in radians)
10174
+ * @param positions - Geodetic positions (lat/lng in degrees)
9810
10175
  * @param options - Optional abort signal and fixed-level sampling
9811
10176
  * @returns One result per input position, in the same order
9812
10177
  */
9813
10178
  sampleTerrainMostDetailed(source: SourceRef, positions: LatLng[], options?: SampleTerrainOptions): Promise<SampledTerrainPosition[]>;
9814
10179
  /**
9815
10180
  * Observes terrain height changes at a position. Callback is invoked each time terrain data updates.
9816
- * @param pos - Geodetic position to observe (lat in radians, lng in radians)
10181
+ * @param pos - Geodetic position to observe (lat in degrees, lng in degrees)
9817
10182
  * @param cb - Callback function receiving the terrain height in meters
9818
10183
  * @returns Cleanup function to stop observing
9819
10184
  */
@@ -9832,11 +10197,22 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9832
10197
  private _startMainLoop;
9833
10198
  private _getCanvasSize;
9834
10199
  private _handleResize;
10200
+ /**
10201
+ * Resolves a picked batch ID into feature information via the engine's
10202
+ * property store.
10203
+ */
10204
+ private resolvePickedFeature;
9835
10205
  /**
9836
10206
  * Handles pick events and emits the picked feature information.
9837
10207
  * @param pickArr - Array of picked batch IDs
9838
10208
  */
9839
10209
  private onPick;
10210
+ /**
10211
+ * Handles hover pick results and synthesizes `featureHover` / `featureEnter` /
10212
+ * `featureLeave` events by diffing against the previously hovered feature.
10213
+ * @param pickArr - Array of picked batch IDs
10214
+ */
10215
+ private onHoverPick;
9840
10216
  /**
9841
10217
  * Gets whether continuous animation mode is enabled.
9842
10218
  */
@@ -9845,6 +10221,11 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
9845
10221
  * Sets whether to render every frame continuously (true) or only on changes (false).
9846
10222
  */
9847
10223
  set animation(v: boolean);
10224
+ /**
10225
+ * Gets the canvas element the view renders into. Useful for styling,
10226
+ * e.g. switching the cursor from a `featureHover` event listener.
10227
+ */
10228
+ get canvas(): HTMLCanvasElement;
9848
10229
  /**
9849
10230
  * Gets the current screen size in pixels.
9850
10231
  */
@@ -9888,13 +10269,18 @@ declare class ThreeViewCamera extends EventHandler<CameraEvent> {
9888
10269
  get positionECEF(): XYZ;
9889
10270
  get positionGeographic(): LatLngHeight;
9890
10271
  get orientation(): CameraOrientation;
9891
- get fovy(): number | undefined;
9892
10272
  /**
9893
10273
  * Effective Web Mercator zoom level the camera is viewing the surface at
9894
10274
  * (fractional). Computed engine-side from the camera's ellipsoid height (not
9895
10275
  * terrain), FOV and viewport.
9896
10276
  */
9897
10277
  get zoom(): number | undefined;
10278
+ /**
10279
+ * The vertical field of view in degrees; the horizontal extent follows
10280
+ * from the viewport aspect ratio.
10281
+ * Reading returns `undefined` until the engine camera exists.
10282
+ */
10283
+ get fov(): number | undefined;
9898
10284
  set fov(val: number);
9899
10285
  set near(val: number);
9900
10286
  get near(): number;
@@ -10680,7 +11066,7 @@ export declare class UnknownTypeError extends Error {
10680
11066
  /**
10681
11067
  * Converts a Cartesian Vector3 in ECEF coordinates to geodetic coordinates.
10682
11068
  * @param xyz - Cartesian Vector3 in Earth-Centered Earth-Fixed (ECEF) coordinates
10683
- * @returns Geodetic coordinates (lng in radians, lat in radians, height in meters)
11069
+ * @returns Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
10684
11070
  */
10685
11071
  export declare function vector3ToGeodetic(xyz: Vector3): LatLngHeight;
10686
11072
 
@@ -10690,9 +11076,9 @@ export declare class UnknownTypeError extends Error {
10690
11076
  */
10691
11077
  export declare type VectorLayer = SourceLayerBase<VectorLayerBase>;
10692
11078
 
10693
- declare type VectorLayerBase = WithColorSupport<Layer_2<VectorLayerDescription & {
11079
+ declare type VectorLayerBase = WithColorSupport<ConvertGeometryTypeFields<Layer_2<VectorLayerDescription & {
10694
11080
  type: "vector";
10695
- }>>;
11081
+ }>>>;
10696
11082
 
10697
11083
  /**
10698
11084
  * A `vector` layer references a `geojson` or `vector-tile` source and renders
@@ -10958,8 +11344,24 @@ export declare class UnknownTypeError extends Error {
10958
11344
  export declare type ViewEvents = {
10959
11345
  /** Emitted when the view is resized. Receives width and height in pixels. */
10960
11346
  resize: (w: number, h: number) => void;
10961
- /** Emitted when a feature is picked. Receives picked feature info or null. */
10962
- pick: (info: Nullable<PickedFeature>) => void;
11347
+ /**
11348
+ * Emitted when a feature is clicked (click-gesture GPU pick). Receives the
11349
+ * clicked feature, or null when empty space was clicked. For raw click
11350
+ * coordinates use the `click` event instead.
11351
+ */
11352
+ featureClick: (info: Nullable<PickedFeature>) => void;
11353
+ /**
11354
+ * Emitted when the hovered feature changes (mousemove picking). Receives
11355
+ * the newly hovered feature, or null when the pointer leaves all pickable
11356
+ * features. Hover picking runs a GPU pick per frame while the pointer
11357
+ * moves, and is active only while at least one `featureHover` /
11358
+ * `featureEnter` / `featureLeave` listener is registered.
11359
+ */
11360
+ featureHover: (info: Nullable<PickedFeature>) => void;
11361
+ /** Emitted when the pointer starts hovering a pickable feature. See `featureHover` for activation. */
11362
+ featureEnter: (info: PickedFeature) => void;
11363
+ /** Emitted when the pointer stops hovering the previously hovered feature. See `featureHover` for activation. */
11364
+ featureLeave: (info: PickedFeature) => void;
10963
11365
  /** Emitted when a layer event occurs. Receives event type, layer ID, and event arguments. */
10964
11366
  layer: <K extends keyof LayerEvent>(k: K, layerId: string, ...args: Parameters<LayerEvent[K]>) => void;
10965
11367
  /** Emitted before an update process happens. Receives `DOMHighResTimeStamp` as a timestamp. */
@@ -11022,6 +11424,21 @@ export declare class UnknownTypeError extends Error {
11022
11424
  timeUniform?: UniformValue<number>;
11023
11425
  };
11024
11426
 
11427
+ /**
11428
+ * Creates a local West-Up-North (WUN) reference frame transformation matrix at
11429
+ * a position.
11430
+ *
11431
+ * WUN is the only right-handed, Y-up tangent frame whose `+Z` axis is north, so
11432
+ * it agrees with glTF's own convention (front `+Z`, up `+Y`, right `-X`) on all
11433
+ * three axes. An unmodified glTF asset placed in this frame needs **no**
11434
+ * `Rx(+90°)` up-axis correction — the correction is absorbed here, once, as the
11435
+ * `Ry(+90°)` basis change from NUE.
11436
+ *
11437
+ * @param origin - Origin position in ECEF coordinates
11438
+ * @returns 4x4 transformation matrix from WUN to ECEF
11439
+ */
11440
+ export declare function westUpNorthToFixedFrame(origin: Vector3): Matrix4;
11441
+
11025
11442
  declare type Window_2 = Required<NormalizeWASMClass<Window_3>>;
11026
11443
  export { Window_2 as Window }
11027
11444