@navaramap/three 0.0.8 → 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.
- package/LICENSE +1 -1
- package/README.md +20 -8
- package/dist/assets/fontWorker-C5cHhkWQ.js +2 -0
- package/dist/assets/fontWorker-C5cHhkWQ.js.map +1 -0
- package/dist/assets/{index-DaejBdUz.js → index-VfUncKuS.js} +2 -2
- package/dist/assets/index-VfUncKuS.js.map +1 -0
- package/dist/assets/{navara_wasm_font_worker_bg-CSmoDs_Q.wasm → navara_wasm_font_worker_bg-CKqHBoCR.wasm} +0 -0
- package/dist/assets/{navara_wasm_worker_bg-C1dUd_Nk.wasm → navara_wasm_worker_bg-CT26EH41.wasm} +0 -0
- package/dist/index.d.ts +213 -34
- package/dist/index.js +1476 -1351
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +79 -58
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +12 -12
- package/src/core/MeshDesc.test.ts +6 -8
- package/src/core/MeshDesc.ts +2 -5
- package/src/evaluations/FeatureEvaluator.ts +17 -10
- package/src/event/feature.ts +15 -2
- package/src/event/features/billboard.test.ts +62 -0
- package/src/event/features/billboard.ts +4 -2
- package/src/index.ts +98 -27
- package/src/material/macro/tileShader.ts +12 -2
- package/src/mesh/polyline.ts +32 -4
- package/src/mesh/sdfText/batchedSdfText.test.ts +65 -0
- package/src/mesh/sdfText/batchedSdfText.ts +121 -43
- package/src/mesh/sprite/instancedSprite.ts +173 -65
- package/src/pick/pickHelper.test.ts +261 -3
- package/src/pick/pickHelper.ts +94 -7
- package/src/renderOrder.ts +10 -0
- package/src/terrain/sampleTerrainMostDetailed.test.ts +6 -6
- package/src/terrain/sampleTerrainMostDetailed.ts +7 -5
- package/src/type/index.ts +22 -1
- package/dist/assets/fontWorker-CkLGtrXf.js +0 -2
- package/dist/assets/fontWorker-CkLGtrXf.js.map +0 -1
- package/dist/assets/index-DaejBdUz.js.map +0 -1
|
Binary file
|
package/dist/assets/{navara_wasm_worker_bg-C1dUd_Nk.wasm → navara_wasm_worker_bg-CT26EH41.wasm}
RENAMED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -995,8 +995,15 @@ export declare class BatchedSdfTextMesh extends InstancedMesh<Object3D> implemen
|
|
|
995
995
|
private _transform;
|
|
996
996
|
/** Labels in slot order — `_labels[slot]` is also the declutter handle map. */
|
|
997
997
|
private _labels;
|
|
998
|
-
/** Sparse
|
|
999
|
-
private
|
|
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;
|
|
1000
1007
|
/** In-flight per-feature text preparations; see {@link whenLabelsSettled}. */
|
|
1001
1008
|
private _pendingTextPrepares;
|
|
1002
1009
|
private _glyphs;
|
|
@@ -1104,9 +1111,20 @@ export declare class BatchedSdfTextMesh extends InstancedMesh<Object3D> implemen
|
|
|
1104
1111
|
onAfterPicking(): void;
|
|
1105
1112
|
getRenderable(): Object3D;
|
|
1106
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;
|
|
1107
1124
|
_update(m: TextMesh, needRender?: () => void): Promise<void>;
|
|
1108
1125
|
private _applyUpdate;
|
|
1109
1126
|
setTextByBatchIndex(batchIndex: number, text: string): void;
|
|
1127
|
+
private _setTextByInstance;
|
|
1110
1128
|
/** Kick off async font preparation for `text`, then lay it out — unless a
|
|
1111
1129
|
* newer text supersedes it while the fonts load. */
|
|
1112
1130
|
private _prepareAndApply;
|
|
@@ -1137,6 +1155,20 @@ declare class BatchPropResult {
|
|
|
1137
1155
|
private constructor();
|
|
1138
1156
|
free(): void;
|
|
1139
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);
|
|
1140
1172
|
get layerId(): string | undefined;
|
|
1141
1173
|
set layerId(value: string | null | undefined);
|
|
1142
1174
|
properties: any;
|
|
@@ -1226,6 +1258,18 @@ declare class BillboardMaterial {
|
|
|
1226
1258
|
* Emissive glow intensity (default: 0.3 when Bloom enabled)
|
|
1227
1259
|
*/
|
|
1228
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);
|
|
1229
1273
|
get height(): number | undefined;
|
|
1230
1274
|
set height(value: number | null | undefined);
|
|
1231
1275
|
/**
|
|
@@ -1994,6 +2038,14 @@ declare type ConvertColorFields<T> = {
|
|
|
1994
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];
|
|
1995
2039
|
};
|
|
1996
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
|
+
|
|
1997
2049
|
/**
|
|
1998
2050
|
* Converts screen coordinates to world coordinates by raycasting against the WGS84 ellipsoid.
|
|
1999
2051
|
* @param window - Window configuration with width, height, and pixelRatio
|
|
@@ -3353,11 +3405,13 @@ declare class ElevationHeatmapMaterial {
|
|
|
3353
3405
|
* Wrapper class for geodesic calculations on an ellipsoid surface.
|
|
3354
3406
|
* Precomputes common variables for optimization when instantiated.
|
|
3355
3407
|
*
|
|
3408
|
+
* All latitudes/longitudes and headings are in **degrees**.
|
|
3409
|
+
*
|
|
3356
3410
|
* @example
|
|
3357
3411
|
* ```typescript
|
|
3358
3412
|
* const geodesic = new EllipsoidGeodesic(
|
|
3359
|
-
* { lat:
|
|
3360
|
-
* { lat:
|
|
3413
|
+
* { lat: 35.6812, lng: 139.7671, height: 0 },
|
|
3414
|
+
* { lat: 34.7025, lng: 135.4959, height: 0 }
|
|
3361
3415
|
* );
|
|
3362
3416
|
*
|
|
3363
3417
|
* console.log(geodesic.distance);
|
|
@@ -3371,8 +3425,8 @@ export declare class EllipsoidGeodesic {
|
|
|
3371
3425
|
private _raw;
|
|
3372
3426
|
/**
|
|
3373
3427
|
* Create a new geodesic between two points on the ellipsoid.
|
|
3374
|
-
* @param start - Start point in geodetic coordinates (lat/lng in
|
|
3375
|
-
* @param end - End point in geodetic coordinates (lat/lng in
|
|
3428
|
+
* @param start - Start point in geodetic coordinates (lat/lng in degrees)
|
|
3429
|
+
* @param end - End point in geodetic coordinates (lat/lng in degrees)
|
|
3376
3430
|
*/
|
|
3377
3431
|
constructor(start: LatLngHeight, end: LatLngHeight);
|
|
3378
3432
|
/** Distance in meters between start and end points */
|
|
@@ -3384,24 +3438,24 @@ export declare class EllipsoidGeodesic {
|
|
|
3384
3438
|
* unreliable solution.
|
|
3385
3439
|
*/
|
|
3386
3440
|
get converged(): boolean;
|
|
3387
|
-
/** Heading at the start point in
|
|
3441
|
+
/** Heading at the start point in degrees */
|
|
3388
3442
|
get startHeading(): number;
|
|
3389
|
-
/** Heading at the end point in
|
|
3443
|
+
/** Heading at the end point in degrees */
|
|
3390
3444
|
get endHeading(): number;
|
|
3391
|
-
/** Start point in geodetic coordinates */
|
|
3445
|
+
/** Start point in geodetic coordinates (lat/lng in degrees) */
|
|
3392
3446
|
get start(): LatLngHeight;
|
|
3393
|
-
/** End point in geodetic coordinates */
|
|
3447
|
+
/** End point in geodetic coordinates (lat/lng in degrees) */
|
|
3394
3448
|
get end(): LatLngHeight;
|
|
3395
3449
|
/**
|
|
3396
3450
|
* Interpolate points along the geodesic path.
|
|
3397
3451
|
* @param granularity - Distance between interpolated points in meters (optional)
|
|
3398
|
-
* @returns Array of interpolated points in geodetic coordinates
|
|
3452
|
+
* @returns Array of interpolated points in geodetic coordinates (lat/lng in degrees)
|
|
3399
3453
|
*/
|
|
3400
3454
|
interpolatePoints(granularity?: number): LatLngHeight[];
|
|
3401
3455
|
/**
|
|
3402
3456
|
* Interpolate a point at a specific distance along the geodesic path.
|
|
3403
3457
|
* @param distance - Distance from start point in meters
|
|
3404
|
-
* @returns Interpolated point in geodetic coordinates
|
|
3458
|
+
* @returns Interpolated point in geodetic coordinates (lat/lng in degrees)
|
|
3405
3459
|
*/
|
|
3406
3460
|
interpolateDistance(distance: number): LatLngHeight;
|
|
3407
3461
|
/**
|
|
@@ -3854,6 +3908,11 @@ declare type FeatureHandler = {
|
|
|
3854
3908
|
* Information about a feature batch, passed to evaluation callbacks.
|
|
3855
3909
|
*/
|
|
3856
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
|
+
*/
|
|
3857
3916
|
batchId: number;
|
|
3858
3917
|
properties: Record<string, unknown> | undefined;
|
|
3859
3918
|
layerId: LayerId | undefined;
|
|
@@ -4115,14 +4174,14 @@ export declare type GeodeticPlacement = {
|
|
|
4115
4174
|
|
|
4116
4175
|
/**
|
|
4117
4176
|
* Computes the surface normal vector at a geodetic position on the WGS84 ellipsoid.
|
|
4118
|
-
* @param lle - Geodetic coordinates (lng in
|
|
4177
|
+
* @param lle - Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
|
|
4119
4178
|
* @returns Unit normal vector pointing outward from the ellipsoid surface
|
|
4120
4179
|
*/
|
|
4121
4180
|
export declare function geodeticSurfaceNormal(lle: LatLngHeight): Vector3;
|
|
4122
4181
|
|
|
4123
4182
|
/**
|
|
4124
4183
|
* Converts geodetic coordinates (longitude, latitude, height) to a Cartesian Vector3 in ECEF coordinates.
|
|
4125
|
-
* @param lle - Geodetic coordinates (lng in
|
|
4184
|
+
* @param lle - Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
|
|
4126
4185
|
* @returns Cartesian Vector3 in Earth-Centered Earth-Fixed (ECEF) coordinates
|
|
4127
4186
|
*/
|
|
4128
4187
|
export declare function geodeticToVector3(lle: LatLngHeight): Vector3;
|
|
@@ -4448,7 +4507,6 @@ declare type HandleEvent = {
|
|
|
4448
4507
|
* engines differ in which axis they treat as an asset's front, so a model
|
|
4449
4508
|
* ported from one may need a multiple of 90° added to its heading.
|
|
4450
4509
|
*
|
|
4451
|
-
* NOTE: unlike {@link geodeticToVector3} and the other helpers in this module,
|
|
4452
4510
|
* `lng`/`lat` and all angles here are in **degrees**, matching
|
|
4453
4511
|
* `setCamera` and the `geodetic` mesh Descriptor field.
|
|
4454
4512
|
*
|
|
@@ -4902,7 +4960,15 @@ export declare type InstancedSpriteMaterialProps = {
|
|
|
4902
4960
|
|
|
4903
4961
|
export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material | Material[], CustomObject3DEventMap> implements PickableMesh, DeclutterParticipant {
|
|
4904
4962
|
private _geometryType;
|
|
4905
|
-
|
|
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;
|
|
4906
4972
|
private _initialColor;
|
|
4907
4973
|
private _initialHeight;
|
|
4908
4974
|
private _initialSize;
|
|
@@ -4995,6 +5061,15 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
|
|
|
4995
5061
|
* hasn't been overridden per-feature via setFeatureImageByBatchId.
|
|
4996
5062
|
*/
|
|
4997
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;
|
|
4998
5073
|
onBeforePicking(): void;
|
|
4999
5074
|
onAfterPicking(): void;
|
|
5000
5075
|
getRenderable(): Object3D;
|
|
@@ -5002,10 +5077,21 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
|
|
|
5002
5077
|
* Get the enhancer, throwing if not initialized.
|
|
5003
5078
|
*/
|
|
5004
5079
|
private getEnhancer;
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
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;
|
|
5009
5095
|
/**
|
|
5010
5096
|
* Set one instance's declutter fade target; the attribute animates toward
|
|
5011
5097
|
* it in {@link stepDeclutterFade}. Deliberately separate from the `show`
|
|
@@ -5018,8 +5104,8 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
|
|
|
5018
5104
|
* layer-level `declutterPriority` for this instance. Driven by the feature
|
|
5019
5105
|
* evaluator.
|
|
5020
5106
|
*/
|
|
5021
|
-
|
|
5022
|
-
|
|
5107
|
+
setFeatureDeclutterPriorityByBatchIndex(batchIndex: number, priority: number): void;
|
|
5108
|
+
setFeatureSizeByBatchIndex(batchIndex: number, size: number): void;
|
|
5023
5109
|
/**
|
|
5024
5110
|
* Give one feature its own image, packed into this mesh's texture atlas.
|
|
5025
5111
|
* Loads are deduplicated by URL, so styling many features with few distinct
|
|
@@ -5028,7 +5114,7 @@ export declare class InstancedSpriteMesh extends Mesh_2<BufferGeometry, Material
|
|
|
5028
5114
|
* reverts the feature to the material's default image. No-op for
|
|
5029
5115
|
* non-billboard (point) meshes.
|
|
5030
5116
|
*/
|
|
5031
|
-
|
|
5117
|
+
setFeatureImageByBatchIndex(batchIndex: number, url: string | null | undefined): Promise<void>;
|
|
5032
5118
|
dispose(): void;
|
|
5033
5119
|
}
|
|
5034
5120
|
|
|
@@ -5071,8 +5157,12 @@ export declare type LabelLayout = {
|
|
|
5071
5157
|
maxYEm: number;
|
|
5072
5158
|
};
|
|
5073
5159
|
|
|
5160
|
+
/** Geodetic position: `lat`/`lng` in **degrees**. */
|
|
5074
5161
|
export declare type LatLng = Omit<LatLngHeight, "height">;
|
|
5075
5162
|
|
|
5163
|
+
/**
|
|
5164
|
+
* Geodetic position: `lat`/`lng` in **degrees**, `height` in meters.
|
|
5165
|
+
*/
|
|
5076
5166
|
export declare type LatLngHeight = Required<NormalizeWASMClass<LLE>>;
|
|
5077
5167
|
|
|
5078
5168
|
/**
|
|
@@ -6610,7 +6700,11 @@ export declare type Options = {
|
|
|
6610
6700
|
atmosphere?: AtmosphereOptions;
|
|
6611
6701
|
/** Background color of the scene. Defaults to dark color (0x0a0a0f). */
|
|
6612
6702
|
backgroundColor?: Color_2;
|
|
6613
|
-
/**
|
|
6703
|
+
/**
|
|
6704
|
+
* Feature picking configuration (default: true). Enables the `featureClick`
|
|
6705
|
+
* event (click) and the `featureHover` / `featureEnter` / `featureLeave`
|
|
6706
|
+
* events (mousemove).
|
|
6707
|
+
*/
|
|
6614
6708
|
picking?: boolean;
|
|
6615
6709
|
/** When true, renders every frame. When false, renders only on changes or when forceUpdate() is called. */
|
|
6616
6710
|
animation?: boolean;
|
|
@@ -7033,6 +7127,18 @@ declare class PointMaterial {
|
|
|
7033
7127
|
* Emissive glow intensity (default: 0.3 when Bloom enabled)
|
|
7034
7128
|
*/
|
|
7035
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);
|
|
7036
7142
|
get height(): number | undefined;
|
|
7037
7143
|
set height(value: number | null | undefined);
|
|
7038
7144
|
/**
|
|
@@ -7751,6 +7857,22 @@ declare class PolylineMaterial {
|
|
|
7751
7857
|
* Emissive glow intensity (default: 0.3 when Bloom enabled)
|
|
7752
7858
|
*/
|
|
7753
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);
|
|
7754
7876
|
get height(): number | undefined;
|
|
7755
7877
|
set height(value: number | null | undefined);
|
|
7756
7878
|
/**
|
|
@@ -7858,6 +7980,8 @@ export declare class PolylineMesh extends BatchedFeatureMesh<BufferGeometry<Attr
|
|
|
7858
7980
|
get emissiveColor(): number;
|
|
7859
7981
|
get emissiveIntensity(): number;
|
|
7860
7982
|
get effectIdsMask(): number;
|
|
7983
|
+
/** Visible stroke width to restore after a pick-pass width bump. */
|
|
7984
|
+
private _pickSavedWidth?;
|
|
7861
7985
|
onBeforePicking(pickingCoord?: Vector2): void;
|
|
7862
7986
|
onAfterPicking(): void;
|
|
7863
7987
|
_getDefaultBatchAttributeValues(): DefaultBatchAttributeValues;
|
|
@@ -8466,9 +8590,9 @@ export declare type RTEUserData = {
|
|
|
8466
8590
|
};
|
|
8467
8591
|
|
|
8468
8592
|
export declare type SampledTerrainPosition = {
|
|
8469
|
-
/** Latitude in
|
|
8593
|
+
/** Latitude in degrees, echoed from the input. */
|
|
8470
8594
|
lat: number;
|
|
8471
|
-
/** Longitude in
|
|
8595
|
+
/** Longitude in degrees, echoed from the input. */
|
|
8472
8596
|
lng: number;
|
|
8473
8597
|
/**
|
|
8474
8598
|
* Terrain height in meters, or `undefined` when no tile covering the
|
|
@@ -9061,6 +9185,15 @@ declare class SourceDescription_2 {
|
|
|
9061
9185
|
set type(value: string | null | undefined);
|
|
9062
9186
|
}
|
|
9063
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
|
+
|
|
9064
9197
|
export declare type SourceLayerBase<Layer extends {
|
|
9065
9198
|
source?: string | undefined;
|
|
9066
9199
|
}> = Omit<Layer, "source"> & {
|
|
@@ -9300,6 +9433,18 @@ declare class TextMaterial {
|
|
|
9300
9433
|
* is specified.
|
|
9301
9434
|
*/
|
|
9302
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);
|
|
9303
9448
|
get height(): number | undefined;
|
|
9304
9449
|
set height(value: number | null | undefined);
|
|
9305
9450
|
/**
|
|
@@ -9548,6 +9693,8 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
|
|
|
9548
9693
|
/** Pending `flyTo` promises keyed by flight id, settled by
|
|
9549
9694
|
* `camera_flight_ended` events from the engine. */
|
|
9550
9695
|
private _pendingFlights;
|
|
9696
|
+
/** Currently hovered feature, used to diff-synthesize hover events. */
|
|
9697
|
+
private _hoveredFeature;
|
|
9551
9698
|
private _meshes;
|
|
9552
9699
|
private _abortControllers;
|
|
9553
9700
|
private _workerPoolPromises;
|
|
@@ -10006,7 +10153,7 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
|
|
|
10006
10153
|
cameraFreeLook(enabled: boolean, target?: LatLngHeight): void;
|
|
10007
10154
|
/**
|
|
10008
10155
|
* Samples the terrain height at a given geodetic position synchronously.
|
|
10009
|
-
* @param pos - Geodetic position (lat in
|
|
10156
|
+
* @param pos - Geodetic position (lat in degrees, lng in degrees)
|
|
10010
10157
|
* @returns Terrain height in meters, or undefined if terrain data not loaded
|
|
10011
10158
|
*/
|
|
10012
10159
|
sampleTerrainHeight(pos: LatLng): number | undefined;
|
|
@@ -10024,14 +10171,14 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
|
|
|
10024
10171
|
* sampled.
|
|
10025
10172
|
*
|
|
10026
10173
|
* @param source - A registered terrain source (handle or id)
|
|
10027
|
-
* @param positions - Geodetic positions (lat/lng in
|
|
10174
|
+
* @param positions - Geodetic positions (lat/lng in degrees)
|
|
10028
10175
|
* @param options - Optional abort signal and fixed-level sampling
|
|
10029
10176
|
* @returns One result per input position, in the same order
|
|
10030
10177
|
*/
|
|
10031
10178
|
sampleTerrainMostDetailed(source: SourceRef, positions: LatLng[], options?: SampleTerrainOptions): Promise<SampledTerrainPosition[]>;
|
|
10032
10179
|
/**
|
|
10033
10180
|
* Observes terrain height changes at a position. Callback is invoked each time terrain data updates.
|
|
10034
|
-
* @param pos - Geodetic position to observe (lat in
|
|
10181
|
+
* @param pos - Geodetic position to observe (lat in degrees, lng in degrees)
|
|
10035
10182
|
* @param cb - Callback function receiving the terrain height in meters
|
|
10036
10183
|
* @returns Cleanup function to stop observing
|
|
10037
10184
|
*/
|
|
@@ -10050,11 +10197,22 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
|
|
|
10050
10197
|
private _startMainLoop;
|
|
10051
10198
|
private _getCanvasSize;
|
|
10052
10199
|
private _handleResize;
|
|
10200
|
+
/**
|
|
10201
|
+
* Resolves a picked batch ID into feature information via the engine's
|
|
10202
|
+
* property store.
|
|
10203
|
+
*/
|
|
10204
|
+
private resolvePickedFeature;
|
|
10053
10205
|
/**
|
|
10054
10206
|
* Handles pick events and emits the picked feature information.
|
|
10055
10207
|
* @param pickArr - Array of picked batch IDs
|
|
10056
10208
|
*/
|
|
10057
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;
|
|
10058
10216
|
/**
|
|
10059
10217
|
* Gets whether continuous animation mode is enabled.
|
|
10060
10218
|
*/
|
|
@@ -10063,6 +10221,11 @@ declare class ThreeView<D extends Descriptions = EmptyDescriptions> extends Even
|
|
|
10063
10221
|
* Sets whether to render every frame continuously (true) or only on changes (false).
|
|
10064
10222
|
*/
|
|
10065
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;
|
|
10066
10229
|
/**
|
|
10067
10230
|
* Gets the current screen size in pixels.
|
|
10068
10231
|
*/
|
|
@@ -10903,7 +11066,7 @@ export declare class UnknownTypeError extends Error {
|
|
|
10903
11066
|
/**
|
|
10904
11067
|
* Converts a Cartesian Vector3 in ECEF coordinates to geodetic coordinates.
|
|
10905
11068
|
* @param xyz - Cartesian Vector3 in Earth-Centered Earth-Fixed (ECEF) coordinates
|
|
10906
|
-
* @returns Geodetic coordinates (lng in
|
|
11069
|
+
* @returns Geodetic coordinates (lng in degrees, lat in degrees, height in meters)
|
|
10907
11070
|
*/
|
|
10908
11071
|
export declare function vector3ToGeodetic(xyz: Vector3): LatLngHeight;
|
|
10909
11072
|
|
|
@@ -10913,9 +11076,9 @@ export declare class UnknownTypeError extends Error {
|
|
|
10913
11076
|
*/
|
|
10914
11077
|
export declare type VectorLayer = SourceLayerBase<VectorLayerBase>;
|
|
10915
11078
|
|
|
10916
|
-
declare type VectorLayerBase = WithColorSupport<Layer_2<VectorLayerDescription & {
|
|
11079
|
+
declare type VectorLayerBase = WithColorSupport<ConvertGeometryTypeFields<Layer_2<VectorLayerDescription & {
|
|
10917
11080
|
type: "vector";
|
|
10918
|
-
}
|
|
11081
|
+
}>>>;
|
|
10919
11082
|
|
|
10920
11083
|
/**
|
|
10921
11084
|
* A `vector` layer references a `geojson` or `vector-tile` source and renders
|
|
@@ -11181,8 +11344,24 @@ export declare class UnknownTypeError extends Error {
|
|
|
11181
11344
|
export declare type ViewEvents = {
|
|
11182
11345
|
/** Emitted when the view is resized. Receives width and height in pixels. */
|
|
11183
11346
|
resize: (w: number, h: number) => void;
|
|
11184
|
-
/**
|
|
11185
|
-
|
|
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;
|
|
11186
11365
|
/** Emitted when a layer event occurs. Receives event type, layer ID, and event arguments. */
|
|
11187
11366
|
layer: <K extends keyof LayerEvent>(k: K, layerId: string, ...args: Parameters<LayerEvent[K]>) => void;
|
|
11188
11367
|
/** Emitted before an update process happens. Receives `DOMHighResTimeStamp` as a timestamp. */
|