UNPKG

643 kBTypeScriptView Raw
1import { ExtrusionFeature } from '@here/harp-materials';
2import { Frustum } from 'three';
3import { Matrix4 } from 'three';
4import { Plane } from 'three';
5import { Ray } from 'three';
6import * as THREE_2 from 'three';
7import { Vector3 } from 'three';
8
9/**
10 * Add all the buffers of the technique to the transfer list.
11 */
12export declare function addBuffersToTransferList(technique: Technique, transferList: ArrayBuffer[]): void;
13
14/**
15 * Optional parameters passed on [[TextCanvas]].`addText` function call.
16 */
17declare interface AdditionParameters {
18 /**
19 * Path where text should be placed on. Overrides the original position parameter.
20 */
21 path?: THREE_2.Path | THREE_2.CurvePath<THREE_2.Vector2>;
22 /**
23 * If `true`, text on a path will be placed even when its size its bigger than the path's size.
24 */
25 pathOverflow?: boolean;
26 /**
27 * Layer where text will be added.
28 */
29 layer?: number;
30 /**
31 * If `true`, the input position parameter will be updated to contain the position of the last
32 * glyph added.
33 */
34 updatePosition?: boolean;
35 /**
36 * Object containing additional data intended to be retrieved during picking.
37 */
38 pickingData?: any;
39 /**
40 * Array containing info on whether the glyphs are upper or lower case. Needed to support
41 * `SmallCaps`.
42 */
43 letterCaseArray?: boolean[];
44}
45
46/**
47 * Light type: ambient.
48 *
49 * @remarks
50 *
51 * @defaultSnippets [
52 * {
53 * "label": "New Ambient Light",
54 * "description": "Adds a new Ambient Light",
55 * "body": {
56 * "type": "ambient",
57 * "name": "${1:ambient light}",
58 * "color": "#${2:fff}",
59 * "intensity": "^${3:1}"
60 * }
61 * }
62 * ]
63 */
64export declare interface AmbientLight extends BaseLight {
65 type: "ambient";
66 /**
67 * @format color-hex
68 */
69 color: string;
70 intensity?: number;
71}
72
73/**
74 * Handles animated extrusion effect of the buildings in {@link MapView}.
75 */
76export declare class AnimatedExtrusionHandler {
77 private m_mapView;
78 /**
79 * Animate the extrusion of the buildings if set to `true`.
80 */
81 enabled: boolean;
82 /**
83 * Duration of the building's extrusion in milliseconds
84 */
85 duration: number;
86 private m_minZoomLevel;
87 private m_forceEnabled;
88 private m_tileMap;
89 private m_state;
90 private m_startTime;
91 /**
92 * Creates an {@link AnimatedExtrusionHandler} in {@link MapView}.
93 *
94 * @param m_mapView - Instance of {@link MapView} on which the animation will run.
95 */
96 constructor(m_mapView: MapView);
97 /**
98 * Returns whether the extrusion animation is force enabled or not.
99 */
100 get forceEnabled(): boolean;
101 /**
102 * If `forceEnabled` is set to `true` then `animateExtrusion` and `animateExtrusionDuration`
103 * values from [[extrudedPolygonTechnique]] will be ignored and
104 * `AnimatedExtrusionHandler.enabled` with `AnimatedExtrusionHandler.duration` will be used
105 */
106 set forceEnabled(force: boolean);
107 /**
108 * Gets min zoom level at which extruded animation is enabled.
109 */
110 get minZoomLevel(): number;
111 /**
112 * Sets the extrusion animation properties obtained from a given technique.
113 * @internal
114 * @param technique - The technique where the extrusion animation properties are defined.
115 * @param env - The environment used to evaluate technique properties.
116 * @returns True if the technique has animation enabled (or animation is forced), false
117 * otherwise.
118 */
119 setAnimationProperties(technique: Technique, env: MapEnv): boolean;
120 /**
121 * Updates the extrusion animation for every frame.
122 * @internal
123 */
124 update(zoomLevel: number): void;
125 /**
126 * Adds a tile to be animated.
127 * @internal
128 * @param tile - The tile to be animated.
129 * @param materials - Extruded materials belonging to the tile.
130 */
131 add(tile: Tile, materials: ExtrusionFeature[]): void;
132 /**
133 * Is `true` if there's any extrusion animation ongoing.
134 */
135 get isAnimating(): boolean;
136 private skipAnimation;
137 private wasAnyAncestorAnimated;
138 private wasAnyDescendantAnimated;
139 private removeTile;
140 private animateExtrusion;
141 private resetAnimation;
142 private setExtrusionRatio;
143 private setTileExtrusionRatio;
144}
145
146/**
147 * Animation states for extrusion effect
148 */
149export declare enum AnimatedExtrusionState {
150 None = 0,
151 Started = 1,
152 Finished = 2
153}
154
155export declare enum APIFormat {
156 /**
157 * Use the REST API format of HERE Vector Tiles Server component version 1.
158 *
159 * Documentation:
160 * https://developer.here.com/documentation/vector-tiles-api/dev_guide/index.html
161 *
162 * Usage:
163 *
164 * <OmvRestClientParams.baseUrl>/<zoom>/<X>/<Y>/omv
165 *
166 * If [[OmvRestClientParams.authenticationToken]] is provided, it will be added as HTTP header:
167 *
168 * Authorization: Bearer $authenticationToken
169 *
170 * Format definition:
171 * `//http|s://<base-url>/{API version}/{layers}/{projection}/{z}/{x}/{y}/{format}`
172 *
173 * Default authentication method used: [[AuthenticationTypeBearer]].
174 */
175 HereV1 = 0,
176 /**
177 * Use the REST API format of Mapbox Vector Tile API v4.
178 *
179 * Usage:
180 * `<OmvRestClientParams.baseUrl>/<zoom>/<X>/<Y>.mvt?access_token=<OmvRestClientParams.authenticationCode>`
181 *
182 * Format definition:
183 * `http|s://<base-url>/v4/{map_id}/{z}/{x}/{y}{@2x}.{format}?[style]&access_token={access_token}`
184 *
185 * Sample URL:
186 * `http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/14/4823/6160.mvt?access_token=your-mapbox-access-token`
187 *
188 * Default authentication method used: [[AuthenticationTypeAccessToken]].
189 */
190 MapboxV4 = 1,
191 /**
192 * Use the REST API format of XYZ Vector Tile API in MVT format.
193 *
194 * Usage:
195 * `<OmvRestClientParams.baseUrl>/tiles/omsbase/256/<zoom>/<X>/<Y>.mvt?access_token=<OmvRestClientParams.authenticationCode>`
196 *
197 * Format definition:
198 * `http|s://<base-url>/tiles/{layers}/{z}/{x}/{y}/{format}?access_token={access_token}`
199 *
200 * Sample URL:
201 * `https://xyz.api.here.com/tiles/osmbase/256/all/16/19293/24641.mvt?access_token=your-xyz-access-token`
202 *
203 * Default authentication method used: [[AuthenticationTypeAccessToken]].
204 */
205 XYZMVT = 2,
206 /**
207 * Use the REST API format of XYZ Vector Tile API in JSON format.
208 *
209 * Usage:
210 * `<OmvRestClientParams.baseUrl>/tiles/omsbase/256/<zoom>/<X>/<Y>.mvt?access_token=<OmvRestClientParams.authenticationCode>`
211 *
212 * Format definition:
213 * `http|s://<base-url>/tiles/{layers}/{z}/{x}/{y}/{format}?access_token={access_token}`
214 *
215 * Sample URL:
216 * `https://xyz.api.here.com/tiles/osmbase/256/all/16/19293/24641.json?access_token=your-xyz-api-key`
217 *
218 * Default authentication method used: [[AuthenticationTypeAccessToken]].
219 */
220 XYZJson = 3,
221 /**
222 * Use the REST API format of XYZ Vector Tile API in OMV format.
223 *
224 * Usage:
225 * `<OmvRestClientParams.baseUrl>/tiles/herebase.02/<zoom>/<X>/<Y>/omv?access_token=<OmvRestClientParams.authenticationCode>`
226 *
227 * Format definition:
228 * `http|s://<base-url>/tiles/herebase.02/{z}/{x}/{y}/{format}?access_token={access_token}`
229 *
230 * Sample URL:
231 * `https://xyz.api.here.com/tiles/herebase.02/14/2649/6338/omv?access_token=your-xyz-access-token`
232 *
233 * Default authentication method used: [[AuthenticationTypeAccessToken]].
234 */
235 XYZOMV = 4,
236 /**
237 * Use the REST API format of Tomtoms Vector Tile API v1.
238 *
239 * Usage:
240 * `<OmvRestClientParams.baseUrl>/<zoom>/<X>/<Y>.pbf?key=<OmvRestClientParams.authenticationCode>`
241 *
242 * Format definition:
243 * `<http|https>://<baseURL>/map/<versionNumber>/tile/<layer>/<style>/<zoom>/<X>/<Y>.<format>?key=<apiKey>[&view=<view>][&language=<language>]`
244 *
245 * Sample URL:
246 * `http://api.tomtom.com/map/1/tile/basic/main/0/0/0.pbf?key=<apiKey>`
247 *
248 * Default authentication method used: [[AuthenticationTypeTomTomV1]].
249 */
250 TomtomV1 = 5,
251 /**
252 * Use the REST API format of XYZ Space Vector Tile API in OMV format.
253 *
254 * Usage:
255 * `<OmvRestClientParams.baseUrl>/hub/spaces/<space-id>/tile/web/<zoom>_<X>_<Y>.mvt?access_token=<OmvRestClientParams.authenticationCode>`
256 *
257 * Format definition:
258 * `http|s://<base-url>/hub/spaces/{spaceId}/tile/web/{z}_{x}_{y}.mvt?access_token={access_token}`
259 *
260 * Sample URL:
261 * `https://xyz.api.here.com/hub/spaces/your-space-id/tile/web/{z}_{x}_{y}.mvt?access_token=your-access-token`
262 *
263 * Default authentication method used: [[AuthenticationTypeAccessToken]].
264 */
265 XYZSpace = 6
266}
267
268/**
269 * Options for authentication with [[apikey]].
270 */
271declare interface ApiKeyAuthentication {
272 /**
273 * The `apikey` for the access of the Web Tile Data.
274 * @note Will not be used if [[authenticationCode]] is defined as well.
275 */
276 apikey: string;
277}
278
279/**
280 * Options for authentication with [[appId]] and [[appCode]].
281 */
282declare interface AppIdAuthentication {
283 /**
284 * The `appId` for the access of the Web Tile Data.
285 * @note Will not be used if [[apiKey]] or [[authenticationCode]] is defined as well.
286 */
287 appId: string;
288 /**
289 * The `appCode` for the access of the Web Tile Data.
290 * @note Will not be used if [[apiKey]] or [[authenticationCode]] is defined as well.
291 */
292 appCode: string;
293}
294
295/**
296 * Apply technique base color (transparency support) to material with modifying material opacity.
297 *
298 * This method applies main (or base) technique color with transparency support to the corresponding
299 * material color, with an effect on entire [[THREE.Material]] __opacity__ and __transparent__
300 * attributes.
301 *
302 * @note Transparent colors should be processed as the very last technique attributes,
303 * since their effect on material properties like [[THREE.Material.opacity]] and
304 * [[THREE.Material.transparent]] could be overridden by corresponding technique params.
305 *
306 * @param technique - an technique the applied color comes from
307 * @param material - the material to which color is applied
308 * @param prop - technique property (color) name
309 * @param value - color value in custom number format
310 * @param env - {@link @here/harp-datasource-protocol#Env} instance used to evaluate
311 * {@link @here/harp-datasource-protocol#Expr} based properties of [[Technique]]
312 */
313export declare function applyBaseColorToMaterial(material: THREE_2.Material, materialColor: THREE_2.Color, technique: Technique, techniqueColor: Value, env?: Env): void;
314
315/**
316 * Apply technique color to material taking special care with transparent (RGBA) colors.
317 *
318 * @note This function is intended to be used with secondary, triary etc. technique colors,
319 * not the base ones that may contain transparency information. Such colors should be processed
320 * with [[applyTechniqueBaseColorToMaterial]] function.
321 *
322 * @param technique - an technique the applied color comes from
323 * @param material - the material to which color is applied
324 * @param prop - technique property (color) name
325 * @param value - color value
326 * @param env - {@link @here/harp-datasource-protocol#Env} instance used
327 * to evaluate {@link @here/harp-datasource-protocol#Expr}
328 * based properties of [[Technique]]
329 */
330export declare function applySecondaryColorToMaterial(materialColor: THREE_2.Color, techniqueColor: Value | Expr, env?: Env): void;
331
332/**
333 * Schema of [Map Tile API copyright
334 * endpoint](https://developer.here.com/documentation/map-tile/topics/resource-copyright.html) JSON
335 * response.
336 */
337export declare interface AreaCopyrightInfo {
338 /**
339 * Minimum zoom level for the specified copyright label.
340 */
341 minLevel?: number;
342 /**
343 * Maximum zoom level for the specified copyright label.
344 */
345 maxLevel?: number;
346 /**
347 * Copyright text to display after the copyright symbol on the map.
348 */
349 label: string;
350 /**
351 * Verbose copyright text of the label to display by mouse over label or info menu entry.
352 */
353 alt?: string;
354 /**
355 * The bounding boxes define areas where specific copyrights are valid. A bounding box is
356 * defined by bottom (latitude), left (longitude) and top (latitude), right (longitude).
357 *
358 * The default copyright has no boxes element and covers all other areas.
359 */
360 boxes?: Array<[number, number, number, number]>;
361}
362
363/**
364 * Lists light modes.
365 */
366export declare enum AtmosphereLightMode {
367 LightOverhead = 0,
368 LightDynamic = 1
369}
370
371/**
372 * Atmosphere shader variants.
373 */
374declare enum AtmosphereShadingVariant {
375 ScatteringShader = 0,
376 SimpleColor = 1,
377 Wireframe = 2
378}
379
380/**
381 * Atmosphere effect variants.
382 */
383declare enum AtmosphereVariant {
384 Ground = 1,
385 Sky = 2,
386 SkyAndGround = 3
387}
388
389/**
390 * Attachments together with [[Geometry]] define the meshes and the objects
391 * of a [[Scene]].
392 */
393export declare interface Attachment {
394 /**
395 * The unique uuid of this [[Attachment]].
396 */
397 uuid?: string;
398 /**
399 * The name of this [[Attachment]].
400 */
401 name?: string;
402 /**
403 * The index [[BufferAttribute]]. If not provided the index
404 * buffer of the [[Geometry]] will be used.
405 */
406 index?: BufferAttribute;
407 /**
408 * Optional additional buffer index used to create an edge object.
409 */
410 edgeIndex?: BufferAttribute;
411 /**
412 * The draw [[Group]]]s of this [[Attachment]].
413 */
414 groups: Group[];
415}
416
417/**
418 * A reference to a style definition.
419 *
420 * Use as value `attrs` to reference value from `definitions`.
421 *
422 * Example of usage:
423 * ```json
424 * {
425 * "definitions": {
426 * "roadColor": { "type": "color", "value": "#f00" }
427 * },
428 * "styles": { "tilezen": [
429 * {
430 * "when": "kind == 'road",
431 * "technique": "solid-line",
432 * "attr": {
433 * "lineColor": { "$ref": "roadColor" }
434 * }
435 * }
436 * ] }
437 * }
438 * ```
439 */
440/**
441 * The attributes of a technique.
442 */
443declare type Attr_2<T> = {
444 [P in keyof T]?: T[P] | JsonExpr;
445};
446export { Attr_2 as Attr }
447
448declare interface AttrEvaluationContext {
449 /**
450 * Expression evaluation environment containing variable bindings.
451 */
452 env: MapEnv;
453 /**
454 * Optional, cache of expression results.
455 *
456 * @see [[Expr.evaluate]]
457 */
458 cachedExprResults?: Map<Expr, Value>;
459}
460
461/**
462 * Attributes corresponding to some decoded geometry. It may be either a map
463 * of multiple attributes or just a number with the geometry's feature id.
464 */
465export declare type AttributeMap = {} | number;
466
467declare enum AttrScope {
468 /**
469 * Attributes that affect generation of feature geometry and thus must be resolved at decoding
470 * time.
471 *
472 * They may have huge variancy as they are implemented as vertex attributes or embedded in
473 * generated meshes.
474 *
475 * These attributes are available only in decoding scope.
476 */
477 FeatureGeometry = 0,
478 /**
479 * Attributes that are common to whole group of features drawn with this technique.
480 * These attributes affect generated geometry and thus must be resolved at decoding time.
481 *
482 * They shouldn't have big variancy and evaluate to at least dozens of values as each
483 * combination of these attributes consitute new technique and material.
484 *
485 * These attributes are available in decoding and rendering scope.
486 */
487 TechniqueGeometry = 1,
488 /**
489 * Attributes that are common to whole group of features drawn with this technique.
490 * Attributes that can be changed in resulting object/material from frame to frame. They are
491 * usually implemented as uniforms.
492 *
493 * These attributes may be available only at rendering scope.
494 */
495 TechniqueRendering = 2
496}
497
498/**
499 * Authentication token/code provider used by [[OmvRestClient]] before each call to currently valid
500 * authentication code/token.
501 */
502export declare type AuthenticationCodeProvider = () => Promise<string>;
503
504export declare enum AuthenticationMethod {
505 QueryString = 0,
506 AuthorizationHeader = 1
507}
508
509export declare interface AuthenticationMethodInfo {
510 method: AuthenticationMethod;
511 name?: string;
512}
513
514/**
515 * Authentification token/code provider.
516 */
517declare type AuthenticationProvider = () => Promise<string>;
518
519export declare const AuthenticationTypeAccessToken: AuthenticationMethodInfo;
520
521/**
522 * Authentication method, where token will be provided as HTTP Header:
523 *
524 * Authorization: Bearer $authenticationToken
525 */
526export declare const AuthenticationTypeBearer: AuthenticationMethodInfo;
527
528/**
529 * TomTomV1 API compatible authorization method, where token will be provided as HTTP Header:
530 *
531 * Authorization: Bearer $authenticationToken
532 */
533export declare const AuthenticationTypeTomTomV1: AuthenticationMethodInfo;
534
535/**
536 * Non material properties of [[BaseTechnique]]
537 */
538export declare const BASE_TECHNIQUE_NON_MATERIAL_PROPS: string[];
539
540export declare interface BaseLight {
541 type: string;
542 name: string;
543}
544
545/**
546 * The object that defines what way an item of a [[DataSource]] should be decoded to assemble a
547 * tile. [[Style]] is describing which features are shown on a map and in what way they are being
548 * shown.
549 */
550export declare type BaseStyle<Technique, Params> = Partial<Params> & {
551 /**
552 * Human readable description.
553 */
554 description?: string;
555 /**
556 * The style set referenced by this styling rule.
557 */
558 styleSet?: string;
559 /**
560 * The category of this style.
561 */
562 category?: string | JsonExpr;
563 /**
564 * The name of the technique to use.
565 *
566 * @remarks
567 * Technique name. See the classes extending from this class to determine what possible
568 * techniques are possible, includes `"line"`, `"fill"`, `"solid-line"`, `"extruded-line"`,
569 * `"extruded-polygon"`, `"text"`, `"none"`.
570 */
571 technique: Technique;
572 /**
573 * Specify `renderOrder` of value.
574 *
575 * @remarks
576 * @default If not specified in style file, `renderOrder` will be assigned with monotonically
577 * increasing values according to style position in file.
578 */
579 renderOrder?: number | JsonExpr;
580 /**
581 * Minimal zoom level. If the current zoom level is smaller, the technique will not be used.
582 */
583 minZoomLevel?: number | JsonExpr;
584 /**
585 * Maximum zoom level. If the current zoom level is larger, the technique will not be used.
586 */
587 maxZoomLevel?: number | JsonExpr;
588 /**
589 * Optional. If `true`, no IDs will be saved for the geometry this style creates. Default is
590 * `false`.
591 */
592 transient?: boolean;
593 /**
594 * Optional: If `true`, the objects with matching `when` statement will be printed to the
595 * console.
596 */
597 debug?: boolean;
598 /**
599 * Units in which different size properties are specified. Either `Meter` (default) or `Pixel`.
600 *
601 * @deprecated use "string encoded numerals" as documented in TODO, wher eis the doc ?
602 */
603 metricUnit?: "Meter" | "Pixel";
604 /**
605 * XYZ defines the property to display as text label of a feature in the styles.
606 */
607 labelProperty?: string;
608 attr?: Partial<Params>;
609};
610
611/**
612 * Common attributes or all [[Technique]]s.
613 */
614export declare interface BaseTechniqueParams {
615 /**
616 * The name used to identify materials created from this technique.
617 */
618 id?: string;
619 /**
620 * The render order of the objects created using this technique.
621 *
622 * If not specified in style file, [[StyleSetEvaluator]] will assign monotonically increasing
623 * values according to style position in file.
624 */
625 renderOrder?: DynamicProperty<number>;
626 /**
627 * The category of this technique.
628 *
629 * The category is used in conjunction with [[Theme.priorities]]
630 * to assign render orders to the objects created by this [[Style]].
631 */
632 category?: DynamicProperty<string>;
633 /**
634 * Optional. If `true`, no IDs will be saved for the geometry this technique creates.
635 */
636 transient?: boolean;
637 /**
638 * Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the object start
639 * fading out (opacity decreases).
640 */
641 fadeNear?: DynamicProperty<number>;
642 /**
643 * Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the object has zero
644 * opacity and stops fading out. An undefined value disables fading.
645 */
646 fadeFar?: DynamicProperty<number>;
647 /**
648 * Specified kind of geometry. One kind is set as default in the technique, and can be
649 * overridden in the style.
650 *
651 * @deprecated Use [[enabled]] with expressions based on `['dynamic-properties']` operator.
652 */
653 kind?: GeometryKind | GeometryKindSet;
654 /**
655 * Runtime filtering of techniques.
656 *
657 * Use with `['dynamic-properties']` operator for dynamic feature highlight, highlighig etc.
658 *
659 * @see Picking example - [[PickingExample]]
660 */
661 enabled?: DynamicProperty<boolean>;
662}
663
664/** @internal */
665export declare const baseTechniqueParamsDescriptor: TechniqueDescriptor<BaseTechniqueParams>;
666
667/**
668 * Value definition commons.
669 */
670export declare interface BaseValueDefinition {
671 /**
672 * The type of the definition.
673 */
674 type?: string;
675 /**
676 * The description of the definition.
677 */
678 description?: string;
679}
680
681export declare type BasicExtrudedLineStyle = BaseStyle<"extruded-line", BasicExtrudedLineTechniqueParams>;
682
683/**
684 * Runtime representation of [[BasicExtrudedLineStyle]] as parsed by [[StyleSetEvaluator]].
685 * For technique parameters see [[BasicExtrudedLineTechniqueParams]].
686 */
687export declare interface BasicExtrudedLineTechnique extends MakeTechniqueAttrs<BasicExtrudedLineTechniqueParams> {
688 name: "extruded-line";
689}
690
691/**
692 * Declares a a geometry as a basic extruded line.
693 */
694export declare interface BasicExtrudedLineTechniqueParams extends BaseTechniqueParams, PolygonalTechniqueParams {
695 /**
696 * A value determining the shading technique. Valid values are "Basic" and "Standard". Default
697 * is "Basic".
698 *
699 * `"basic"` : Simple shading, faster to render. Only simple color and opacity are effective.
700 * `"standard"`: Elaborate shading, with metalness, and roughness.
701 *
702 * TODO: is this TechniqueParams or Style prop ?
703 */
704 shading?: "basic";
705 /**
706 * Color of a line in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
707 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
708 * @format color-hex
709 */
710 color: DynamicProperty<StyleColor>;
711 /**
712 * Set to `true` if line should appear transparent. Rendering transparent lines may come with a
713 * slight performance impact.
714 */
715 transparent?: boolean;
716 /**
717 * For transparent lines, set a value between 0.0 for totally transparent, to 1.0 for totally
718 * opaque.
719 */
720 opacity?: DynamicProperty<number>;
721 /**
722 * Width of line in meters for different zoom levels.
723 */
724 lineWidth: DynamicProperty<number>;
725 /**
726 * A value of `true` creates a wireframe geometry. (May not be supported with all techniques).
727 */
728 wireframe?: boolean;
729 /**
730 * Style of both end caps. Possible values: `"None"`, `"Circle"`. A value of undefined maps to
731 * `"Circle"`.
732 */
733 caps?: DynamicProperty<"None" | "Circle">;
734}
735
736/**
737 * @internal
738 */
739export declare type BinaryOp = RelationalOp | EqualityOp;
740
741/**
742 * Boolean literal expression.
743 */
744export declare class BooleanLiteralExpr extends LiteralExpr {
745 readonly value: boolean;
746 constructor(value: boolean);
747 /** @override */
748 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
749}
750
751/**
752 * An interface representing bounding box in world coordinates.
753 */
754export declare interface Box3Like {
755 /**
756 * The minimum position in world coordinates of this bounding box.
757 */
758 readonly min: Vector3Like;
759 /**
760 * The maximum position in world coordinates of this bounding box.
761 */
762 readonly max: Vector3Like;
763}
764
765/**
766 * Boxed definition without type.
767 */
768export declare interface BoxedAnyDefinition extends BaseValueDefinition {
769 /**
770 * The value of the definition.
771 */
772 value: LiteralValue | JsonExpr;
773}
774
775/**
776 * A boxed boolean value definition.
777 */
778export declare interface BoxedBooleanDefinition extends BaseValueDefinition {
779 /**
780 * The type of the definition.
781 */
782 type: "boolean";
783 /**
784 * The value of the definition.
785 */
786 value: DynamicProperty<boolean>;
787}
788
789/**
790 * A boxed color value definition.
791 */
792export declare interface BoxedColorDefinition extends BaseValueDefinition {
793 /**
794 * The type of the definition.
795 */
796 type: "color";
797 /**
798 * The value of the definition.
799 */
800 value: DynamicProperty<string>;
801}
802
803/**
804 * A boxed value definition.
805 */
806export declare type BoxedDefinition = BoxedAnyDefinition | BoxedBooleanDefinition | BoxedNumericDefinition | BoxedStringDefinition | BoxedColorDefinition | BoxedSelectorDefinition;
807
808/**
809 * A boxed numerical value definition.
810 */
811export declare interface BoxedNumericDefinition extends BaseValueDefinition {
812 /**
813 * The type of the definition.
814 */
815 type: "number";
816 /**
817 * The value of the definition.
818 */
819 value: DynamicProperty<number>;
820}
821
822/**
823 * A boxed selector value definition.
824 */
825export declare interface BoxedSelectorDefinition extends BaseValueDefinition {
826 /**
827 * The type of the definition.
828 */
829 type: "selector";
830 /**
831 * The value of the definition.
832 *
833 * See [[BaseStyle.when]].
834 */
835 value: string | JsonExpr;
836}
837
838/**
839 * A boxed string value definition.
840 */
841export declare interface BoxedStringDefinition extends BaseValueDefinition {
842 /**
843 * The type of the definition.
844 */
845 type: "string";
846 /**
847 * The value of the definition.
848 */
849 value: DynamicProperty<string>;
850}
851
852/**
853 * Structured clone compliant WebGL buffer and its metadata.
854 */
855export declare interface BufferAttribute {
856 name: string;
857 buffer: ArrayBufferLike;
858 type: BufferElementType;
859 itemCount: number;
860 normalized?: boolean;
861}
862
863/**
864 * Abstract base class of an accessor for nonindexed geometry.
865 */
866export declare abstract class BufferedGeometryAccessor extends BufferedGeometryAccessorBase {
867 readonly object: THREE_2.Mesh;
868 readonly geometryType: GeometryType;
869 protected readonly bufferGeometry: THREE_2.BufferGeometry;
870 protected stride: number;
871 /**
872 * Create an object of type `BufferedGeometryAccessor`
873 *
874 * @param object - mesh object
875 * @param geometryType - type of geometry to be used
876 * @param bufferGeometry - which buffer geometry to use
877 * @param stride - geometry stride length
878 */
879 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry, stride: number);
880 clear(): void;
881 getVertices(): Float32Array | undefined;
882 protected checkSetUp(): boolean;
883}
884
885/**
886 * Geometry accessor for both indexed and nonindexed `BufferedGeometry`.
887 */
888export declare abstract class BufferedGeometryAccessorBase implements IGeometryAccessor {
889 readonly object: THREE_2.Mesh;
890 readonly geometryType: GeometryType;
891 protected readonly bufferGeometry: THREE_2.BufferGeometry;
892 protected start: number;
893 protected end: number;
894 protected startCapSize: number;
895 protected endCapSize: number;
896 protected position: THREE_2.BufferAttribute;
897 protected itemSize: number;
898 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry);
899 /**
900 * Get the number of accessible geometries in this buffer.
901 *
902 * @returns Number of primitives in this geometry.
903 */
904 getCount(): number;
905 /**
906 * Get `renderOrder` of object.
907 *
908 * @returns `renderOrder` of the object.
909 */
910 get renderOrder(): number;
911 setRange(start: number, end: number, startCapSize?: number, endCapSize?: number): void;
912 /**
913 * Get one or more colors from materials.
914 */
915 get color(): THREE_2.Color | undefined | Array<THREE_2.Color | undefined>;
916}
917
918/**
919 * Accessor for nonindexed line geometry.
920 */
921export declare class BufferedGeometryLineAccessor extends BufferedGeometryAccessor implements ILineAccessor {
922 readonly object: THREE_2.Mesh;
923 readonly geometryType: GeometryType;
924 readonly bufferGeometry: THREE_2.BufferGeometry;
925 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry);
926 isLineAccessor(): boolean;
927 get width(): number | undefined;
928}
929
930/**
931 * Accessor for nonindexed unspecified (`Object3D`) geometry.
932 */
933export declare class BufferedGeometryObject3dAccessor extends BufferedGeometryAccessor implements IObject3dAccessor {
934 readonly object: THREE_2.Mesh;
935 readonly geometryType: GeometryType;
936 readonly bufferGeometry: THREE_2.BufferGeometry;
937 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry);
938 isObject3dAccessor(): boolean;
939 /** @override */
940 getVertices(): Float32Array | undefined;
941}
942
943/**
944 * The data stored in Buffers' elements can be of the following elementary types: float, signed or
945 * unsigned integers (8-bit, 16-bit or 32-bit long).
946 */
947export declare type BufferElementType = "float" | "uint8" | "uint16" | "uint32" | "int8" | "int16" | "int32";
948
949/**
950 * Convert metric style property to expression that accounts {@link MapView.pixelToWorld} if
951 * `metricUnit === 'Pixel'`.
952 */
953export declare function buildMetricValueEvaluator(value: Expr | Value | undefined, metricUnit: string | undefined): string | number | boolean | object | null | undefined;
954
955/**
956 * Builds the object associated with the given technique.
957 *
958 * @param technique - The technique.
959 * @param geometry - The object's geometry.
960 * @param material - The object's material.
961 * @param tile - The tile where the object is located.
962 * @param elevationEnabled - True if elevation is enabled, false otherwise.
963 */
964export declare function buildObject(technique: Technique, geometry: THREE_2.BufferGeometry, material: THREE_2.Material | THREE_2.Material[], tile: Tile, elevationEnabled: boolean): THREE_2.Object3D;
965
966declare interface CachedResource {
967 memoryUsage: number;
968}
969
970/**
971 * Status of the elevation range calculation.
972 */
973export declare enum CalculationStatus {
974 PendingApproximate = 0,
975 FinalPrecise = 1
976}
977
978/**
979 * A node representing a `call` expression.
980 */
981export declare class CallExpr extends Expr {
982 readonly op: string;
983 readonly args: Expr[];
984 descriptor?: OperatorDescriptor;
985 constructor(op: string, args: Expr[]);
986 /**
987 * Returns the child nodes of this {@link Expr}.
988 *
989 * @deprecated Use {@link CallExpr.args} instead.
990 */
991 get children(): Expr[];
992 /** @override */
993 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
994 /** @override */
995 protected exprIsDynamic(): boolean;
996}
997
998/**
999 * The `CameraMovementDetector` class checks for changes in camera position and orientation, to
1000 * detect continuous movements without the animation mode activated in {@link MapView}. If the
1001 * interaction is not continuous enough, you can use a throttling timer to reduce the number of
1002 * callbacks.
1003 */
1004export declare class CameraMovementDetector {
1005 private m_throttlingTimeout;
1006 private m_movementStartedFunc;
1007 private m_movementFinishedFunc;
1008 private m_lastAttitude?;
1009 private m_lastCameraPos;
1010 private m_newCameraPos;
1011 private m_cameraMovedLastFrame;
1012 private m_throttlingTimerId?;
1013 private m_movementDetectorDeadline;
1014 /**
1015 * Initializes the detector with timeout value and callbacks. {@link MapView} also provides
1016 * events for client code to be notified when these cues occur.
1017 *
1018 * @param m_throttlingTimeout - The delay, in milliseconds, between the last user interaction
1019 * detected and the call to `m_movementFinishedFunc`; the default is `300`.
1020 * @param m_movementStartedFunc - Callback function, called when the user starts interacting.
1021 * @param m_movementFinishedFunc - Callback function, called when the user stops interacting.
1022 */
1023 constructor(m_throttlingTimeout: number | undefined, m_movementStartedFunc: (() => void) | undefined, m_movementFinishedFunc: (() => void) | undefined);
1024 /**
1025 * Checks if the camera has moved since the last time it was checked. The
1026 * `m_movementStartedFunc` is called when a movement starts. If no movement
1027 * is detected, a timer for `m_movementFinishedFunc` starts.
1028 *
1029 * @param mapView - [[Mapview]]'s position and camera are checked for modifications.
1030 */
1031 checkCameraMoved(mapView: MapView, now: number): boolean;
1032 /**
1033 * Reset the saved camera position. Next time checkCameraMoved is called, it will return
1034 * `false`.
1035 */
1036 clear(mapView: MapView): void;
1037 /**
1038 * Force change of camera position. Next time checkCameraMoved is called, it will return `true`.
1039 */
1040 forceMoved(): void;
1041 /**
1042 * Returns `true` if the camera of this {@link MapView} is currently moving. In this case the
1043 * `m_movementFinishedFunc` is waiting to be called after the throttling timer runs out.
1044 */
1045 get cameraIsMoving(): boolean;
1046 /**
1047 * Disposes resources and kills the throttling timer.
1048 */
1049 dispose(): void;
1050 /**
1051 * Returns `true` if the camera has moved in the last frame.
1052 */
1053 get cameraMovedLastFrame(): boolean;
1054 private movementStarted;
1055 private movementFinished;
1056 private startMovementFinishedTimer;
1057 private onDeadlineTimer;
1058 private removeMovementFinishedTimer;
1059}
1060
1061/**
1062 * A node representing a `case` expression.
1063 */
1064export declare class CaseExpr extends Expr {
1065 readonly branches: Array<[Expr, Expr]>;
1066 readonly fallback: Expr;
1067 constructor(branches: Array<[Expr, Expr]>, fallback: Expr);
1068 /** @override */
1069 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
1070 /** @override */
1071 protected exprIsDynamic(): boolean;
1072}
1073
1074/**
1075 * Point object that implements the raycasting of circles in screen space.
1076 */
1077export declare class Circles extends MapViewPoints {
1078 /** @override */
1079 testPoint(point: THREE_2.Vector3, screenPosition: THREE_2.Vector2, pickCoordinates: THREE_2.Vector2, index: number, distance: number, intersects: THREE_2.Intersection[]): void;
1080}
1081
1082/**
1083 * Render feature as set of circles rendered in screen space.
1084 *
1085 * @see [[PointTechniqueParams]].
1086 */
1087export declare type CirclesStyle = BaseStyle<"circles", PointTechniqueParams>;
1088
1089/**
1090 * Runtime representation of [[CirclesStyle]] as parsed by [[StyleSetEvaluator]].
1091 * For technique parameters see [[PointTechniqueParams]].
1092 */
1093export declare interface CirclesTechnique extends MakeTechniqueAttrs<PointTechniqueParams> {
1094 name: "circles";
1095}
1096
1097/** @internal */
1098export declare const circlesTechniquePropTypes: TechniqueDescriptor<CirclesTechnique>;
1099
1100export declare interface ClipPlanesEvaluator {
1101 /**
1102 * Minimum elevation to be rendered, values beneath the sea level are negative.
1103 */
1104 minElevation: number;
1105 /**
1106 * Set maximum elevation to be rendered, values above sea level are positive.
1107 */
1108 maxElevation: number;
1109 /**
1110 * Compute near and far clipping planes distance.
1111 *
1112 * Evaluation method should be called on every frame and camera clip planes updated.
1113 * This is related to evaluator implementation and its input data, that may suddenly change
1114 * such as camera position or angle, projection type or so.
1115 * Some evaluators may not depend on all or even any of input objects, but to preserve
1116 * compatibility with any evaluator type it is strongly recommended to update on every frame.
1117 * @note The camera clipping planes (near/far properties) aren't automatically updated
1118 * via #evaluateClipPlanes() call, user should do it manually if needed.
1119 * @param camera - The [[THREE.Camera]] in use.
1120 * @param projection - The geo-projection currently used for encoding geographic data.
1121 * @param elevationProvider - The optional elevation provider for fine tuned range calculation,
1122 * taking into account terrain variability and unevenness.
1123 *
1124 */
1125 evaluateClipPlanes(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
1126}
1127
1128declare class CollisionBox extends Math2D.Box implements IBox {
1129 constructor(box?: Math2D.Box | THREE_2.Box2 | IBox);
1130 copy(box: Math2D.Box | THREE_2.Box2 | IBox): CollisionBox;
1131 get minX(): number;
1132 set minX(minX: number);
1133 get maxX(): number;
1134 set maxX(maxX: number);
1135 get minY(): number;
1136 set minY(minY: number);
1137 get maxY(): number;
1138 set maxY(maxY: number);
1139}
1140
1141/**
1142 * Use `ColorCache` to reuse a color specified by name and save allocation as well as
1143 * setup time.
1144 *
1145 * Implemented as a singleton. Do not modify colors after getting them from the `ColorCache`.
1146 */
1147export declare class ColorCache {
1148 /**
1149 * Return instance of `ColorCache`.
1150 */
1151 static get instance(): ColorCache;
1152 private static m_instance;
1153 private m_map;
1154 /**
1155 * Returns the color for the given `colorCode`. This function may reuse a previously generated
1156 * color, so you cannot modify the contents of the color.
1157 *
1158 * @param colorCode - ThreeJS color code or name. You must provide a valid color code or name,
1159 * as this function does not do any validation.
1160 */
1161 getColor(colorCode: string | number): THREE_2.Color;
1162 /**
1163 * Returns the number of elements in the cache.
1164 */
1165 get size(): number;
1166 /**
1167 * Clears the cache. Only references to the THREE.Color are removed from the cache.
1168 * Consequently, clearing the cache does not cause any negative visual impact.
1169 */
1170 clear(): void;
1171}
1172
1173/**
1174 * Utilities to convert RGBA colors encoded in custom number (hex) format to THREE.Color objects.
1175 *
1176 * The functions provided allows for conversion from and to our custom number based color format,
1177 * which contains transparency, red, green and blue color channels in a way that each channel
1178 * occupies 8 bits of resulting number (color format 0xTTRRGGBB).
1179 * In order to preserve compatibility with THREE.Color class and its hexadecimal color
1180 * representation, we do not store __alpha__ channel in encoded color's number, but replace it
1181 * with __transparency__ channel, which is simply opposite to alpha:
1182 * ```transparency = 0xFF - alpha```
1183 * Such channel value is stored on the oldest bits (octet) in the integral color (numeric) value,
1184 * so it is fully compatible with THREE.Color numerical representation (@see [[THREE.Color.getHex]],
1185 * [[THREE.Color.setHex]]).
1186 * See also [[getHexFromRgba]] and [[getRgbaFromHex]] for more info about conversion.
1187 */
1188export declare namespace ColorUtils {
1189 /**
1190 * Encodes RGBA channels in custom number coded format (represented in hex as 0xTTRRGGBB).
1191 *
1192 * We do not use direct alpha channel mapping to hex in order to preserve compatibility
1193 * with THREE.js color format (0xRRGGBB). This is done by encoding transparency
1194 * (255 - alpha) instead of alpha on the oldest bits, shifted by [[SHIFT_TRANSPARENCY]].
1195 * This way simple 0xRRGGBB color is equal to 0x00RRGGBB without transparency and
1196 * color defining transparency (alpha < 255) is always recognizable by the oldest
1197 * bit set:
1198 * ```typescript
1199 * (color >> SHIFT_TRANSPARENCY) !== 0.
1200 * ```
1201 * @note All input components are floating points in <0, 1> range (inclusively).
1202 * @note Although method encodes transparency channel in single number value, it is still
1203 * compatible with THREE.js number based color coding (0xRRGGBB), so you may pass this value to
1204 * [[THREE.Color]] c-tor, but keep in mind that transparency will be silently ignored.
1205 */
1206 export function getHexFromRgba(r: number, g: number, b: number, a: number): number;
1207 /**
1208 * Encodes RGB all color channels in single number with format 0xRRGGBB.
1209 *
1210 * All input channels should be in <0, 1> range (inclusively).
1211 * See also [[getHexFromRgba]] for more information about [[THREE.Color]] compatibility.
1212 *
1213 * @note This method is fully compatible with THREE.js color encoding, so
1214 * you may pass this value directly to THREE.Color c-tor.
1215 */
1216 export function getHexFromRgb(r: number, g: number, b: number): number;
1217 /**
1218 * Encode and convert HSL value to number coded color format (0xRRGGBB).
1219 *
1220 * @see getHexFromRgb.
1221 * @param h - Hue component value between 0 and 1.
1222 * @param s - Saturation value between 0 and 1.
1223 * @param l - Lightness channel between 0 and 1.
1224 */
1225 export function getHexFromHsl(h: number, s: number, l: number): number;
1226 /**
1227 * Retrieve RGBA channels separately from number encoded custom color format.
1228 *
1229 * Provides an easy way for channels extraction (r, g, b, a) from custom number coded color
1230 * format.
1231 *
1232 * @see getHexFromRgba.
1233 * @param hex - The number encoded color value (0xRRGGBB or 0xTTRRGGBB in hex).
1234 * @returns r, g, b, a channels in simple object, where each channel value is saved as floating
1235 * point from 0 to 1 inclusively.
1236 */
1237 export function getRgbaFromHex(hex: number, target?: RGBA): RGBA;
1238 /**
1239 * Determines if number encoded color contains alpha (opacity) defined and different then 255.
1240 *
1241 * @param hex - The number encoded color (0xRRGGBB or 0xTTRRGGBB in hex).
1242 * @returns True if color has transparency defined.
1243 */
1244 export function hasAlphaInHex(hex: number): boolean;
1245 /**
1246 * Retrieves alpha color channel from hex encoded color value.
1247 *
1248 * @see getHexFromRgba.
1249 * @param hex - The number encoded color value (representable as 0xRRGGBB or 0xTTRRGGBB in hex).
1250 * @returns The floating point alpha component in <0, 1> range.
1251 */
1252 export function getAlphaFromHex(hex: number): number;
1253 /**
1254 * Remove transparency info from the number coded color, makes it compatible with external libs.
1255 *
1256 * @see getAlphaFromHex.
1257 * @param hex - The number encoded color value (representable as 0xRRGGBB or 0xTTRRGGBB in hex).
1258 * @returns number coded color value representable as 0xRRGGBB in hex.
1259 */
1260 export function removeAlphaFromHex(hex: number): number;
1261}
1262
1263/**
1264 * An [[OmvFeatureFilter]] implementation that delegates all filter decision
1265 * returning `true` for any predicate if all delegates return `true`.
1266 */
1267export declare class ComposedDataFilter implements OmvFeatureFilter {
1268 readonly filters: OmvFeatureFilter[];
1269 constructor(filters: OmvFeatureFilter[]);
1270 get hasKindFilter(): boolean;
1271 wantsLayer(layer: string, level: number): boolean;
1272 wantsPointFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
1273 wantsLineFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
1274 wantsPolygonFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
1275 wantsKind(kind: string | string[]): boolean;
1276}
1277
1278/**
1279 * Compose full texture name for given image name with technique specified.
1280 * Some techniques allows to add prefix/postfix to icons names specified, this
1281 * function uses technique information to create fully qualified texture name.
1282 * @param imageName - base name of the marker icon.
1283 * @param technique - the technique describing POI or line marker.
1284 * @returns fully qualified texture name for loading from atlas (without extension).
1285 */
1286export declare function composeTechniqueTextureName(imageName: string, technique: PoiTechnique | LineMarkerTechnique): string;
1287
1288/**
1289 * Only exported for testing
1290 * @ignore
1291 *
1292 * Compute the averages for the passed in array of numbers.
1293 *
1294 * @param {number[]} samples Array containing sampled values.
1295 * @returns {(Stats | undefined)}
1296 */
1297export declare function computeArrayAverage(samples: number[]): number | undefined;
1298
1299/**
1300 * Only exported for testing
1301 * @ignore
1302 *
1303 * Compute the [[ArrayStats]] for the passed in array of numbers.
1304 *
1305 * @param {number[]} samples Array containing sampled values. Will be modified (!) by sorting the
1306 * entries.
1307 * @returns {(Stats | undefined)}
1308 */
1309export declare function computeArrayStats(samples: number[]): Stats | undefined;
1310
1311/**
1312 * Default concurrent decoder helper.
1313 *
1314 * A convenient singleton that maintains a separate [[ConcurrentWorkerSet]] for each bundle
1315 * requested. Provides easy access to {@link WorkerBasedDecoder}s for data sources.
1316 */
1317export declare class ConcurrentDecoderFacade {
1318 /**
1319 * The URL containing a script to fall back (default) to when looking for worker sets
1320 * and decoders.
1321 */
1322 static defaultScriptUrl: string;
1323 /**
1324 * The default number of workers.
1325 */
1326 static defaultWorkerCount?: number;
1327 /**
1328 * Returns a {@link WorkerBasedDecoder} instance.
1329 *
1330 * @param decoderServiceType - The name of the decoder service type.
1331 * @param scriptUrl - The optional URL with the workers' script.
1332 * @param workerCount - The number of web workers to use.
1333 */
1334 static getTileDecoder(decoderServiceType: string, scriptUrl?: string, workerCount?: number): ITileDecoder;
1335 /**
1336 * Returns a [[ConcurrentWorkerSet]] instance based on the script URL specified.
1337 *
1338 * @param scriptUrl - The optional URL with the workers' script. If not specified,
1339 * the function uses [[defaultScriptUrl]] instead.
1340 * @param workerCount - The number of web workers to use.
1341 */
1342 static getWorkerSet(scriptUrl?: string, workerCount?: number): ConcurrentWorkerSet;
1343 /**
1344 * Destroys a [[ConcurrentWorkerSet]] instance.
1345 *
1346 * @param scriptUrl - The worker script URL that was used to create the [[ConcurrentWorkerSet]].
1347 */
1348 static destroyWorkerSet(scriptUrl: string): void;
1349 /**
1350 * Destroys all managed [[ConcurrentWorkerSet]]s.
1351 */
1352 static destroy(): void;
1353 /**
1354 * The [[ConcurrentWorkerSet]] instances which are stored by the script URL.
1355 */
1356 private static workerSets;
1357}
1358
1359/**
1360 * Default concurrent tiler helper.
1361 *
1362 * A convenient singleton that maintains a separate [[ConcurrentWorkerSet]] for each bundle
1363 * requested. Provides easy access to {@link WorkerBasedTiler}s for data sources.
1364 */
1365export declare class ConcurrentTilerFacade {
1366 /**
1367 * The URL containing a script to fall back (default) to when looking for worker sets
1368 * and tilers.
1369 */
1370 static defaultScriptUrl: string;
1371 /**
1372 * The default number of workers.
1373 */
1374 static defaultWorkerCount: number;
1375 /**
1376 * Returns a {@link WorkerBasedTiler} instance.
1377 *
1378 * @param tilerServiceType - The name of the tiler service type.
1379 * @param scriptUrl - The optional URL with the workers' script.
1380 * @param workerCount - The number of web workers to use.
1381 */
1382 static getTiler(tilerServiceType: string, scriptUrl?: string, workerCount?: number): ITiler;
1383 /**
1384 * Returns a [[ConcurrentWorkerSet]] instance based on the script URL specified.
1385 *
1386 * @param scriptUrl - The optional URL with the workers' script. If not specified,
1387 * the function uses [[defaultScriptUrl]] instead.
1388 * @param workerCount - The number of web workers to use.
1389 */
1390 static getWorkerSet(scriptUrl?: string, workerCount?: number): ConcurrentWorkerSet;
1391 /**
1392 * Destroys a [[ConcurrentWorkerSet]] instance.
1393 *
1394 * @param scriptUrl - The worker script URL that was used to create the [[ConcurrentWorkerSet]].
1395 */
1396 static destroyWorkerSet(scriptUrl: string): void;
1397 /**
1398 * Destroys all managed [[ConcurrentWorkerSet]]s.
1399 */
1400 static destroy(): void;
1401 /**
1402 * The [[ConcurrentWorkerSet]] instances which are stored by the script URL.
1403 */
1404 private static workerSets;
1405}
1406
1407/**
1408 * A set of concurrent Web Workers. Acts as a Communication Peer for [[WorkerService]] instances
1409 * running in Web Workers.
1410 *
1411 * Starts and manages a certain number of web workers and provides a means to communicate
1412 * with them using various communication schemes, such as:
1413 * - [[addEventListener]] : receive a unidirectional messages
1414 * - [[broadcastMessage]] : send unidirectional broadcast message
1415 * - [[invokeRequest]] : send a request that waits for a response, with load balancing
1416 * - [[postMessage]] : send a unidirectional message, with load balancing
1417 *
1418 * The request queue holds all requests before they are stuffed into the event queue, allows for
1419 * easy (and early) cancelling of requests. The workers now only get a single new RequestMessage
1420 * when they return their previous result, or if they are idle. When they are idle, they are stored
1421 * in m_availableWorkers.
1422 */
1423declare class ConcurrentWorkerSet {
1424 private m_options;
1425 private m_workerChannelLogger;
1426 private readonly m_eventListeners;
1427 private m_workers;
1428 private m_availableWorkers;
1429 private m_workerPromises;
1430 private m_workerCount;
1431 private readonly m_readyPromises;
1432 private readonly m_requests;
1433 private m_workerRequestQueue;
1434 private m_nextMessageId;
1435 private m_stopped;
1436 private m_referenceCount;
1437 /**
1438 * Creates a new `ConcurrentWorkerSet`.
1439 *
1440 * Creates as many Web Workers as specified in `options.workerCount`, from the script provided
1441 * in `options.scriptUrl`. If `options.workerCount` is not specified, the value specified in
1442 * `navigator.hardwareConcurrency` is used instead.
1443 *
1444 * The worker set is implicitly started when constructed.
1445 */
1446 constructor(m_options: ConcurrentWorkerSetOptions);
1447 /**
1448 * Adds an external reference and increments the internal reference counter by one.
1449 *
1450 * To implement a reference-count based automatic resource cleanup, use this function with
1451 * [[removeReference]].
1452 */
1453 addReference(): void;
1454 /**
1455 * Decrements the internal reference counter by 1.
1456 *
1457 * When the internal reference counter reaches 0, this function calls [[dispose]] to clear the
1458 * resources.
1459 *
1460 * Use with [[addReference]] to implement reference-count based automatic resource cleanup.
1461 */
1462 removeReference(): void;
1463 /**
1464 * Starts workers.
1465 *
1466 * Use to start workers already stopped by [[stop]] or [[destroy]] calls.
1467 *
1468 * Note: The worker set is implicitly started on construction - no need to call [[start]] on
1469 * fresh instance.
1470 *
1471 * @param options - optional, new worker set options
1472 */
1473 start(options?: ConcurrentWorkerSetOptions): void;
1474 /**
1475 * The number of workers started for this worker set. The value is `undefined` until the workers
1476 * have been created.
1477 */
1478 get workerCount(): number | undefined;
1479 /**
1480 * Stops workers.
1481 *
1482 * Waits for all pending requests to be finished and stops all workers.
1483 *
1484 * Use [[start]] to start this worker again.
1485 *
1486 * @returns `Promise` that resolves when all workers are destroyed.
1487 */
1488 stop(): Promise<void>;
1489 /**
1490 * Destroys all workers immediately.
1491 *
1492 * Resolves all pending request promises with a `worker destroyed` error.
1493 *
1494 * Use [[start]] to start this worker again.
1495 */
1496 destroy(): void;
1497 /**
1498 * Waits for `service` to be initialized in all workers.
1499 *
1500 * Each service that starts in a worker sends an [[isInitializedMessage]] to confirm that
1501 * it has started successfully. This method resolves when all workers in a set have
1502 * `service` initialized.
1503 *
1504 * Promise is rejected if any of worker fails to start.
1505 *
1506 * @param serviceId - The service identifier.
1507 */
1508 connect(serviceId: string): Promise<void>;
1509 /**
1510 * Registers an event listener for events that originated in a web worker, for a given
1511 * `serviceId`. You can only set one event listener per `serviceId`.
1512 *
1513 * @param serviceId - The service to listen to.
1514 * @param callback - The callback to invoke for matching events.
1515 */
1516 addEventListener(serviceId: string, callback: (message: any) => void): void;
1517 /**
1518 * Removes a previously set event listener for the given `serviceId`.
1519 *
1520 * @param serviceId - The service from which to remove the event listeners.
1521 */
1522 removeEventListener(serviceId: string): void;
1523 /**
1524 * Invokes a request that expects a response from a random worker.
1525 *
1526 * Sends [[RequestMessage]] and resolves when a matching [[ResponseMessage]] is received from
1527 * workers. Use this function when interfacing with "RPC-like" calls to services.
1528 *
1529 * @param serviceId - The name of service, as registered with the [[WorkerClient]] instance.
1530 * @param request - The request to process.
1531 * @param transferList - An optional array of `ArrayBuffer`s to transfer to the worker context.
1532 * @param requestController - An optional [[RequestController]] to store state of cancelling.
1533 *
1534 * @returns A `Promise` that resolves with a response from the service.
1535 */
1536 invokeRequest<Res>(serviceId: string, request: WorkerServiceProtocol.ServiceRequest, transferList?: ArrayBuffer[], requestController?: RequestController): Promise<Res>;
1537 /**
1538 * Invokes a request that expects responses from all workers.
1539 *
1540 * Send [[RequestMessage]] to all workers and resolves when all workers have sent a matching
1541 * [[ResponseMessage]]. Use this function to wait on request that need to happen on all workers
1542 * before proceeding (like synchronous worker service creation).
1543 *
1544 * @param serviceId - The name of service, as registered with the [[WorkerClient]] instance.
1545 * @param request - The request to process.
1546 * @param transferList - An optional array of `ArrayBuffer`s to transfer to the worker context.
1547 *
1548 * @returns Array of `Promise`s that resolves with a response from each worker (unspecified
1549 * order).
1550 */
1551 broadcastRequest<Res>(serviceId: string, request: WorkerServiceProtocol.WorkerServiceManagerRequest | WorkerServiceProtocol.ServiceRequest, transferList?: ArrayBuffer[]): Promise<Res[]>;
1552 /**
1553 * Posts a message to all workers.
1554 *
1555 * @param message - The message to send.
1556 * @param buffers - Optional buffers to transfer to the workers.
1557 */
1558 broadcastMessage(message: any, buffers?: ArrayBuffer[] | undefined): void;
1559 /**
1560 * The size of the request queue for debugging and profiling.
1561 */
1562 get requestQueueSize(): number;
1563 /**
1564 * The number of workers for debugging and profiling.
1565 */
1566 get numWorkers(): number;
1567 /**
1568 * The number of workers for debugging and profiling.
1569 */
1570 get numIdleWorkers(): number;
1571 /**
1572 * Subclasses must call this function when a worker emits an event.
1573 *
1574 * @param event - The event to dispatch.
1575 */
1576 protected eventHandler(event: any): void;
1577 /**
1578 * Handles messages received from workers. This method is protected so that the message
1579 * reception can be simulated through an extended class, to avoid relying on real workers.
1580 *
1581 * @param workerId - The workerId of the web worker.
1582 * @param event - The event to dispatch.
1583 */
1584 private onWorkerMessage;
1585 /**
1586 * Posts a [[WorkerServiceProtocol.RequestMessage]] to an available worker. If no worker is
1587 * available, the request is put into a queue.
1588 *
1589 * @param message - The message to send.
1590 * @param buffers - Optional buffers to transfer to the worker.
1591 * @param requestController - An optional [[RequestController]] to store state of cancelling.
1592 */
1593 private postRequestMessage;
1594 private ensureStarted;
1595 private waitForAllResponses;
1596 private dispatchEvent;
1597 private terminateWorkers;
1598 private getReadyPromise;
1599 /**
1600 * Check the worker request queue, if there are any queued up decoding jobs and idle workers,
1601 * they will be executed with postRequestMessage. The requests in the queue are sorted before
1602 * the request with the highest priority is selected for processing.
1603 */
1604 private checkWorkerRequestQueue;
1605}
1606
1607declare interface ConcurrentWorkerSetOptions {
1608 /**
1609 * The URL of the script for each worker to start.
1610 */
1611 scriptUrl: string;
1612 /**
1613 * The number of Web Workers for processing data.
1614 *
1615 * Defaults to CLAMP(`navigator.hardwareConcurrency` - 1, 1, 4) or [[DEFAULT_WORKER_COUNT]].
1616 */
1617 workerCount?: number;
1618 /**
1619 * Timeout in milliseconds, in which each worker should set initial message.
1620 *
1621 * @default 10 seconds, see [[DEFAULT_WORKER_INITIALIZATION_TIMEOUT]]
1622 */
1623 workerConnectionTimeout?: number;
1624}
1625
1626/**
1627 * Base class to provide copyrights based on copyright coverage information, defined by geographical
1628 * bounding boxes and relevant zoom level ranges.
1629 */
1630export declare abstract class CopyrightCoverageProvider implements CopyrightProvider {
1631 /** Logger instance. */
1632 protected readonly logger: ILogger;
1633 private m_cachedTreePromise;
1634 /** Asynchronously retrieves copyright coverage data. */
1635 abstract getCopyrightCoverageData(): Promise<AreaCopyrightInfo[]>;
1636 /** @inheritdoc */
1637 getTree(): Promise<any>;
1638 /** @inheritdoc */
1639 getCopyrights(geoBox: GeoBox, level: number): Promise<CopyrightInfo[]>;
1640 /**
1641 * Initializes RBush.
1642 *
1643 * @param entries - Entries for tree.
1644 * @returns RBush instance.
1645 */
1646 initRBush(entries: AreaCopyrightInfo[]): any;
1647}
1648
1649/**
1650 * Schema of [Map Tile API copyright
1651 * endpoint](https://developer.here.com/documentation/map-tile/topics/resource-copyright.html) JSON
1652 * response.
1653 */
1654export declare interface CopyrightCoverageResponse {
1655 [scheme: string]: AreaCopyrightInfo[];
1656}
1657
1658/**
1659 * Helper class that maintains up-to-date {@link MapView} copyright information in DOM element.
1660 *
1661 * @example
1662 *
1663 * // HTML snippet
1664 * <div id="copyrightNotice" style="position:absolute; right:0; bottom:0; z-index:100"></div>
1665 *
1666 * // JavaScript
1667 * const mapView = new MapView({ ... });
1668 * CopyrightElementHandler.install("copyrightNotice", mapView);
1669 */
1670export declare class CopyrightElementHandler {
1671 /**
1672 * Install {@link CopyrightElementHandler} on DOM element and - optionally -
1673 * attach to a {@link MapView} instance.
1674 *
1675 * @param element - HTML DOM element or a HTML DOM element id
1676 * @param mapView -, optional, [[attach]] to this {@link MapView}
1677 */
1678 static install(element: string | HTMLElement, mapView?: MapView): CopyrightElementHandler;
1679 /**
1680 * Static copyright info.
1681 *
1682 * Use when {@link MapView}'s {@link DataSource}'s do not provide proper copyright information.
1683 */
1684 staticInfo: CopyrightInfo[] | undefined;
1685 private m_defaults;
1686 private m_element;
1687 private m_mapViews;
1688 /**
1689 * Creates a new `CopyrightElementHandler` that updates the DOM element with the copyright info
1690 * of the given `mapView`.
1691 *
1692 * Note: Generally, the static [[install]] method can be used to create and attach a new
1693 * `CopyrightElementHandler` to a {@link MapView}
1694 *
1695 * @param element - HTML DOM element or a HTML DOM element id
1696 * @param mapView - optional, [[attach]] to this {@link MapView} instance
1697 */
1698 constructor(element: string | HTMLElement, mapView?: MapView);
1699 /**
1700 * Destroys this object by removing all event listeners from the attached {@link MapView}s.
1701 */
1702 destroy(): void;
1703 /**
1704 * Attaches this {@link CopyrightInfo} updates from {@link MapView} instance.
1705 */
1706 attach(mapView: MapView): this;
1707 /**
1708 * Stop following {@link CopyrightInfo} updates from {@link MapView} instance.
1709 */
1710 detach(mapView: MapView): this;
1711 /**
1712 * Set {@link CopyrightInfo} defaults to be used in case
1713 * {@link DataSource} does not provide deatailed
1714 * copyright information.
1715 *
1716 * @remarks
1717 * The defaults will applied to all undefined `year`, `label` and `link` values in the copyright
1718 * information retrieved from {@link MapView}.
1719 */
1720 setDefaults(defaults: CopyrightInfo[] | undefined): this;
1721 /**
1722 * Sets the [[staticInfo]] property.
1723 *
1724 * A `CopyrightElementHandler` always displays a deduplicated sum of static copyright info and
1725 * copyright information obtained from attached {@link MapView}s.
1726 *
1727 * This information is used when {@link DataSource}
1728 * instances of given {@link MapView} do not provide
1729 * copyright information.
1730 */
1731 setStaticCopyightInfo(staticInfo: CopyrightInfo[] | undefined): this;
1732 /**
1733 * Update copyright info text in controlled HTML element.
1734 */
1735 update: () => void;
1736}
1737
1738/**
1739 * Copyright info attached to data displayed on map. Provided by {@link DataSource} and attached
1740 * to {@link Tile}s.
1741 *
1742 * In most cases, an application should display this information on {@link MapView} to conform with
1743 * licencing terms of its map data providers.
1744 *
1745 * @see {@link CopyrightElementHandler}
1746 */
1747export declare interface CopyrightInfo {
1748 /**
1749 * Unique id of the copyright holder.
1750 *
1751 * @remarks
1752 * `id`s should be unique. It is recommended to build them from unique identifiers like
1753 * registered domain names.
1754 *
1755 * Examples:
1756 *
1757 * * `openstreetmap.org` - for data originating from OpenStreetMap project
1758 * * `naturalearthdata.com` - for data originating from Natural Earth dataset
1759 *
1760 * Note: {@link DataSource} may return {@link CopyrightInfo}
1761 * with only `id`, thus defining only holder
1762 * of copyright, however, valid attribution may require proper `label` and `link`.
1763 *
1764 * Entries with same `id` are deduplicated by {@link CopyrightInfo.mergeArrays}.
1765 */
1766 id: string;
1767 /**
1768 * Copyright text to display after the copyright symbol on the map.
1769 *
1770 * If undefined, `id` is used as text label.
1771 * Set it to empty string to not render a copyright info.
1772 */
1773 label?: string;
1774 /**
1775 * Optional URL pointing to further copyright information.
1776 */
1777 link?: string;
1778 /**
1779 * Optional, copyright notice year.
1780 */
1781 year?: number;
1782}
1783
1784export declare namespace CopyrightInfo {
1785 /**
1786 * Merge {@link CopyrightInfo} arrays, removing duplicates.
1787 *
1788 * `id` and `label` are considered keys in deduplication algorithm.
1789 *
1790 * @param sources - non-duplicate elements from this array are added to `target`
1791 * @returns merge of all copyright infos in `sources`
1792 */
1793 export function mergeArrays(a: CopyrightInfo[], b?: CopyrightInfo[]): CopyrightInfo[];
1794 /**
1795 * Format copyright information to a HTML string that can be displayed in the UI.
1796 *
1797 * * Empty list returns empty string.
1798 * * Entries with empty (but defined) labels are skipped.
1799 *
1800 * @param copyrightInfo - Array of copyrights to format.
1801 */
1802 export function formatAsHtml(copyrightInfo: CopyrightInfo[]): string;
1803}
1804
1805/**
1806 * `CopyrightProvider` is an interface to retrieve copyrights information for geographic region
1807 * specified by bounding box.
1808 */
1809export declare interface CopyrightProvider {
1810 /**
1811 * Retrieves copyrights.
1812 *
1813 * @param geoBox - Bounding geo box to get copyrights for.
1814 * @param level - Zoom level to get copyrights for.
1815 * @returns Promise with an array of copyrights for this geo box.
1816 */
1817 getCopyrights(geoBox: GeoBox, level: number): Promise<CopyrightInfo[]>;
1818}
1819
1820/**
1821 * Factory function that creates default {@link ClipPlanesEvaluator}
1822 * that calculates near plane based
1823 * on ground distance and camera orientation.
1824 *
1825 * Creates {@link TiltViewClipPlanesEvaluator}.
1826 */
1827export declare const createDefaultClipPlanesEvaluator: () => TiltViewClipPlanesEvaluator;
1828
1829/**
1830 * Creates material for depth prepass.
1831 *
1832 * Creates material that writes only to the z-buffer. Updates the original material instance, to
1833 * support depth prepass.
1834 *
1835 * @param baseMaterial - The base material of mesh that is updated to work with depth prepass
1836 * and then used. This parameter is a template for depth prepass material that is returned.
1837 * @returns depth prepass material, which is a clone of `baseMaterial` with the adapted settings.
1838 */
1839export declare function createDepthPrePassMaterial(baseMaterial: THREE_2.Material): THREE_2.Material;
1840
1841/**
1842 * Clones a given mesh to render it in the depth prepass with another material. Both the original
1843 * and depth prepass meshes, when rendered in the correct order, create the proper depth prepass
1844 * effect. The original mesh material is slightly modified by [[createDepthPrePassMaterial]] to
1845 * support the depth prepass. This method is usable only if the material of this mesh has an
1846 * opacity value in the range `(0,1)`.
1847 *
1848 * The DepthPrePass object is created wis a slightly smaller `renderOrder` as the original mesh
1849 * to ensure that it's rendered first.
1850 *
1851 * @param mesh - original mesh
1852 * @returns `Mesh` depth pre pass
1853 */
1854export declare function createDepthPrePassMesh(mesh: THREE_2.Mesh): THREE_2.Mesh;
1855
1856/**
1857 * Create a material, depending on the rendering technique provided in the options.
1858 *
1859 * @param options - The material options the subsequent functions need.
1860 * @param materialUpdateCallback - Optional callback when the material gets updated,
1861 * e.g. after texture loading.
1862 *
1863 * @returns new material instance that matches `technique.name`
1864 */
1865export declare function createMaterial(options: MaterialOptions, textureReadyCallback?: (texture: THREE_2.Texture) => void): THREE_2.Material | undefined;
1866
1867/**
1868 * Interface that defines a cubemap sky.
1869 */
1870export declare interface CubemapSky {
1871 /** Sky type. */
1872 type: "cubemap";
1873 /** Positive X cube map face. */
1874 positiveX: string;
1875 /** Negative X cube map face. */
1876 negativeX: string;
1877 /** Positive Y cube map face. */
1878 positiveY: string;
1879 /** Negative Y cube map face. */
1880 negativeY: string;
1881 /** Positive Z cube map face. */
1882 positiveZ: string;
1883 /** Negative Z cube map face. */
1884 negativeZ: string;
1885}
1886
1887/**
1888 * Interface for all `DataProvider` subclasses. The `DataProvider` is an abstraction of the tile
1889 * loader which is only responsible for loading the binary data of a specific tile, without any
1890 * relation to displaying or even decoding the data.
1891 */
1892export declare interface DataProvider {
1893 /**
1894 * Connect to the data source. Returns a promise to wait for successful (or failed) connection.
1895 *
1896 * @returns A promise which is resolved when the connection has been established.
1897 */
1898 connect(): Promise<void>;
1899 /**
1900 * Returns `true` if it has been connected successfully.
1901 */
1902 ready(): boolean;
1903 /**
1904 * Load the data of a [[Tile]] asynchronously in form of an [[ArrayBufferLike]].
1905 *
1906 * @param tileKey - Address of a tile.
1907 * @param abortSignal - Optional AbortSignal to cancel the request.
1908 * @returns A promise delivering the data as an [[ArrayBufferLike]], or any object.
1909 */
1910 getTile(tileKey: TileKey, abortSignal?: AbortSignal): Promise<ArrayBufferLike | {}>;
1911}
1912
1913/**
1914 * Derive a class from `DataSource` to contribute data and geometries to the {@link MapView}.
1915 */
1916export declare abstract class DataSource extends THREE_2.EventDispatcher {
1917 /**
1918 * A counter to generate unique names for each `DataSource`, if no name is provided in the
1919 * constructor.
1920 */
1921 private static uniqueNameCounter;
1922 /**
1923 * Set to `true` if this `DataSource` is enabled; `false` otherwise.
1924 */
1925 enabled: boolean;
1926 /**
1927 * Set to `true` if the {@link MapView} can cache tiles produced by this `DataSource`.
1928 */
1929 cacheable: boolean;
1930 /**
1931 * Set to `true` if the loader should be used to get the tile contents.
1932 */
1933 useGeometryLoader: boolean;
1934 /**
1935 * The unique name of a `DataSource` instance.
1936 */
1937 name: string;
1938 /**
1939 * Whether the datasource should have a ground plane (this plane covers the tile entirely and
1940 * has the minimum possible renderOrder), this can be required in some cases when fallback
1941 * parent tiles need to be covered by the children, otherwise the content will overlap.
1942 * Default is false
1943 */
1944 addGroundPlane: boolean;
1945 /**
1946 * The minimum zoom level at which data is available.
1947 */
1948 minDataLevel: number;
1949 /**
1950 * The maximum zoom level at which data is available.
1951 */
1952 maxDataLevel: number;
1953 /**
1954 * The minimum zoom level at which {@link DataSource} is displayed.
1955 */
1956 minDisplayLevel: number;
1957 /**
1958 * The maximum zoom level at which {@link DataSource} is displayed.
1959 */
1960 maxDisplayLevel: number;
1961 allowOverlappingTiles: boolean;
1962 /**
1963 * @internal
1964 * @hidden
1965 */
1966 readonly exprPool: ExprPool;
1967 /**
1968 * The {@link MapView} instance holding a reference to this `DataSource`.
1969 */
1970 private m_mapView?;
1971 /**
1972 * The name of the [[StyleSet]] to evaluate for the decoding.
1973 */
1974 private m_styleSetName?;
1975 /**
1976 * Current value of [[maxGeometryHeight]] property.
1977 */
1978 private m_maxGeometryHeight;
1979 /**
1980 * Storage level offset applied to this `DataSource`.
1981 */
1982 private m_storageLevelOffset;
1983 private readonly m_featureStateMap;
1984 /**
1985 * Constructs a new `DataSource`.
1986 *
1987 * @param options - The options to create the data source.
1988 */
1989 constructor(options?: DataSourceOptions);
1990 /**
1991 * Gets the state of the given feature id.
1992 *
1993 * @param featureId - The id of the feature.
1994 */
1995 getFeatureState(featureId: number): ValueMap | undefined;
1996 /**
1997 * Clears the state of all the features of this {@link DataSource}.
1998 */
1999 clearFeatureState(): void;
2000 /**
2001 * Sets the state of the given feature id.
2002 *
2003 * ```typescript
2004 * dataSource.setFeatureState(featureId, { enabled: true });
2005 * ```
2006 *
2007 * @param featureId - The id of the feature.
2008 * @param state - The new state of the feature.
2009 */
2010 setFeatureState(featureId: number, state: ValueMap): void;
2011 /**
2012 * Removes the state associated to the given feature.
2013 *
2014 * @param featureId - The id of the feature.
2015 */
2016 removeFeatureState(featureId: number): void;
2017 /**
2018 * Returns the name of the [[StyleSet]] to use for the decoding.
2019 */
2020 get styleSetName(): string | undefined;
2021 /**
2022 * Sets the name of the [[StyleSet]] to use for the decoding.
2023 * If this {@link DataSource} is already
2024 * attached to a {@link MapView}, this setter then reapplies
2025 * [[StyleSet]] with this name found in
2026 * {@link MapView}s theme.
2027 */
2028 set styleSetName(styleSetName: string | undefined);
2029 /**
2030 * Destroys this `DataSource`.
2031 */
2032 dispose(): void;
2033 /**
2034 * Purges all the caching done by this `DataSource`
2035 */
2036 clearCache(): void;
2037 /**
2038 * Boolean which says whether a {@link DataSource} produces
2039 * tiles that fully cover the tile, i.e.
2040 * tiles underneath are completely hidden. Must be
2041 * overriden for {@link DataSource}'s that don't
2042 * have a ground plane, but which still fully
2043 * cover the tile, e.g. web tiles.
2044 */
2045 isFullyCovering(): boolean;
2046 /**
2047 * Returns `true` if this `DataSource` is ready
2048 * and the {@link MapView} can invoke `getTile()` to
2049 * start requesting data.
2050 */
2051 ready(): boolean;
2052 /**
2053 * The {@link MapView} that is holding this `DataSource`.
2054 */
2055 get mapView(): MapView;
2056 /**
2057 * The {@link @here/harp-geoutils#Projection} used by
2058 * the {@link MapView} that is holding this `DataSource`.
2059 *
2060 * An `Error` is thrown if you call this method
2061 * before this `DataSource` has been added
2062 * to a {@link MapView}.
2063 */
2064 get projection(): Projection;
2065 /**
2066 * This method is called when the `DataSource` is added to a {@link MapView}. Reimplement this
2067 * method to provide any custom initialization, such as, to establish a network connection,
2068 * or to initialize complex data structures.
2069 */
2070 connect(): Promise<void>;
2071 /**
2072 * Returns the {@link @here/harp-geoutils#TilingScheme} used by this `DataSource`.
2073 */
2074 abstract getTilingScheme(): TilingScheme;
2075 /**
2076 * This method is called when this `DataSource` is added to a {@link MapView}.
2077 *
2078 * Reimplementations of this method must invoke the definition of the super class.
2079 *
2080 * @param mapView - The instance of the {@link MapView}.
2081 */
2082 attach(mapView: MapView): void;
2083 /**
2084 * This method is called when this `DataSource` is removed from a {@link MapView}.
2085 *
2086 * Reimplementations of this method must invoke the definition of the super class.
2087 *
2088 * @param mapView - The instance of the {@link MapView}.
2089 */
2090 detach(mapView: MapView): void;
2091 /**
2092 * Invoked by {@link MapView} to notify when the
2093 * {@link @here/harp-datasource-protocol#Theme} has been changed.
2094 *
2095 * @remarks
2096 * If `DataSource` depends on a `styleSet` or `languages`, it must update its tiles' geometry.
2097 *
2098 * @deprecated Use [[setTheme]].
2099 *
2100 * @param styleSet - The new theme that {@link MapView} uses.
2101 * @param languages - An optional list of languages for the `DataSource`.
2102 */
2103 setStyleSet(styleSet?: StyleSet, definitions?: Definitions, languages?: string[]): void;
2104 /**
2105 * Apply the {@link @here/harp-datasource-protocol#Theme} to this data source.
2106 *
2107 * If `DataSource` depends on a `styleSet` defined by this theme or `languages`, it must update
2108 * its tiles' geometry.
2109 *
2110 * @param languages -
2111 */
2112 setTheme(theme: Theme, languages?: string[]): void;
2113 /**
2114 * Used to configure the languages used by the `DataSource` according to priority;
2115 * the first language in the array has the highest priority.
2116 *
2117 * @param languages - An array of ISO 639-1 language codes.
2118 */
2119 setLanguages(languages?: string[]): void;
2120 /**
2121 * Used to express different country point of view (political view).
2122 *
2123 * @note Set to `undefined` (or empty string) if you want to reset to default point of view.
2124 * @param pov - The country code which point of view should be presented in lower-case
2125 * ISO 3166-1 alpha-2 format.
2126 */
2127 setPoliticalView(pov?: string): void;
2128 /**
2129 * This method is called when {@link MapView} needs to visualize or preload the content of a
2130 * {@link @here/harp-geoutils#TileKey}.
2131 *
2132 * @param tileKey - The unique identifier for a map tile.
2133 */
2134 abstract getTile(tileKey: TileKey): Tile | undefined;
2135 /**
2136 * This method is called by {@link MapView} before the
2137 * tile needs to be updated, for example after
2138 * a theme change.
2139 *
2140 * @param tile - The {@link Tile} to update.
2141 */
2142 updateTile(tile: Tile): void;
2143 /**
2144 * This method is called by the {@link MapView} to determine if the content of the surrounding
2145 * tiles must be preloaded.
2146 *
2147 * @returns `true` if the {@link MapView} should try to preload tiles surrounding the visible
2148 * tiles; `false` otherwise. The default is `false`.
2149 */
2150 shouldPreloadTiles(): boolean;
2151 /**
2152 * The minimum zoom level at which data is available or displayed at
2153 * (depending on {@link DataSource} subclass).
2154 * @deprecated Use [[minDataLevel]] and [[minDisplayLevel]] instead.
2155 */
2156 get minZoomLevel(): number;
2157 set minZoomLevel(level: number);
2158 /**
2159 * The maximum zoom level at which data is available or displayed at
2160 * (depending on {@link DataSource} subclass).
2161 * @deprecated Use [[maxDataLevel]] and [[maxDisplayLevel]] instead.
2162 */
2163 get maxZoomLevel(): number;
2164 set maxZoomLevel(level: number);
2165 /**
2166 * Maximum geometry height above ground level this `DataSource` can produce.
2167 *
2168 * Used in first stage of frustum culling before
2169 * {@link Tile.maxGeometryHeight} data is available.
2170 *
2171 * @default 0.
2172 */
2173 get maxGeometryHeight(): number;
2174 set maxGeometryHeight(value: number);
2175 /**
2176 * The difference between storage level and display level of tile.
2177 *
2178 * Storage level offset is a value applied (added) to current zoom level giving
2179 * a final tile level being displayed. This way we may differentate current
2180 * zoom level from the storage level that is displayed, giving fine grained
2181 * control over the tiles being decoded an displayed.
2182 */
2183 get storageLevelOffset(): number;
2184 /**
2185 * Setup the relative offset between storage level and display level of tile.
2186 *
2187 * @param levelOffset - Difference between zoom level and display level.
2188 */
2189 set storageLevelOffset(levelOffset: number);
2190 /**
2191 * Enables or disables overlay of geometry on elevation. It must be overloaded by data sources
2192 * supporting this feature.
2193 *
2194 * @param value - True to enable, false to disable.
2195 */
2196 setEnableElevationOverlay(enable: boolean): void;
2197 /**
2198 * Computes the data zoom level to use.
2199 *
2200 * @param zoomLevel - The zoom level of the {@link MapView}.
2201 * @returns The data zoom level to use.
2202 */
2203 getDataZoomLevel(zoomLevel: number): number;
2204 /**
2205 * Returns `true` if {@link DataSource} should be displayed for the zoom level.
2206 * @param zoomLevel - The zoom level of the {@link MapView}.
2207 */
2208 isVisible(zoomLevel: number): boolean;
2209 /**
2210 * Returns `true` if {@link DataSource} can load tile with
2211 * given {@link @here/harp-geoutils#TileKey} and zoom level.
2212 *
2213 * @param zoomLevel - The zoom level of the {@link MapView}.
2214 * @param tileKey - The unique identifier for a map tile.
2215 * @returns `true` if the tile for the given {@link @here/harp-geoutils#TileKey} can be loaded.
2216 */
2217 canGetTile(zoomLevel: number, tileKey: TileKey): boolean;
2218 /**
2219 * Returns `true` if {@link MapView} should traverse tiles
2220 * further with given {@link @here/harp-geoutils#TileKey} and
2221 * zoom level.
2222 *
2223 * @param zoomLevel - The zoom level of the {@link MapView}.
2224 * @param tileKey - The unique identifier for a map tile.
2225 * @returns `true` if the subtiles of the given {@link @here/harp-geoutils#TileKey} should be
2226 * checked for collisions.
2227 */
2228 shouldSubdivide(zoomLevel: number, tileKey: TileKey): boolean;
2229 /**
2230 * Returns `true` if {@link MapView} should render the text
2231 * elements with the given {@link @here/harp-geoutils#TileKey} and
2232 * zoom level.
2233 *
2234 * @remarks
2235 * This is an additional check for the tiles that are already selected for rendering so the
2236 * default implementation returns `true`.
2237 *
2238 * @param zoomLevel - The zoom level.
2239 * @param tileKey - The unique identifier for a map tile.
2240 * @returns `true` if the text elements created for the
2241 * given {@link @here/harp-geoutils#TileKey} should be rendered.
2242 */
2243 shouldRenderText(zoomLevel: number, tileKey: TileKey): boolean;
2244 /**
2245 * Sends a request to the {@link MapView} to redraw the scene.
2246 */
2247 requestUpdate(): void;
2248}
2249
2250/**
2251 * Options for a {@link DataSource}.
2252 */
2253export declare interface DataSourceOptions {
2254 /**
2255 * The unique name of a {@link DataSource} instance.
2256 */
2257 name?: string;
2258 /**
2259 * The name of the [[StyleSet]] to evaluate for the decoding.
2260 */
2261 styleSetName?: string;
2262 /**
2263 * The minimum zoom level at which data is available or displayed at
2264 * (depending on {@link DataSource} subclass).
2265 * @deprecated Use [[minDataLevel]] and [[minDisplayLevel]] instead.
2266 */
2267 minZoomLevel?: number;
2268 /**
2269 * The maximum zoom level at which data is available or displayed at
2270 * (depending on {@link DataSource} subclass).
2271 * @deprecated Use [[maxDataLevel]] and [[maxDisplayLevel]] instead.
2272 */
2273 maxZoomLevel?: number;
2274 /**
2275 * The minimum zoom level at which data is available.
2276 */
2277 minDataLevel?: number;
2278 /**
2279 * The maximum zoom level at which data is available.
2280 */
2281 maxDataLevel?: number;
2282 /**
2283 * The minimum zoom level at which {@link DataSource} is displayed.
2284 */
2285 minDisplayLevel?: number;
2286 /**
2287 * The maximum zoom level at which {@link DataSource} is displayed.
2288 */
2289 maxDisplayLevel?: number;
2290 /**
2291 * Storage level offset applied to this `DataSource`.
2292 */
2293 storageLevelOffset?: number;
2294 /**
2295 * Whether the datasource can overlap tiles. Such overlapping is necessary when zooming out and
2296 * waiting for the tiles to load, in this case, we use cached tiles to fill the missing gaps if
2297 * available (and in some cases, the tiles can overlap, i.e. for example when a child is next
2298 * to a parent, the parent is rendered beneath the child), however for some datasources (those
2299 * that produce transparent tiles for example), this gives bad results, and as such, it should
2300 * be disabled to reduce flickening. Another way to put it is that loading tiles are replaced
2301 * with cached tiles and we then fall (back/forward) to the next appropriate zoom level.
2302 * @default true
2303 */
2304 allowOverlappingTiles?: boolean;
2305}
2306
2307/**
2308 * List of visible tiles for a {@link DataSource}.
2309 */
2310export declare interface DataSourceTileList {
2311 /**
2312 * The datasource that was producing the tiles.
2313 */
2314 dataSource: DataSource;
2315 /**
2316 * The current {@link MapView} zoom level.
2317 */
2318 zoomLevel: number;
2319 /**
2320 * The storage level of the visibleTiles.
2321 * Note: renderedTiles might contain tiles from different levels.
2322 */
2323 storageLevel: number;
2324 /**
2325 * True if all [[visibleTiles]] are loaded.
2326 */
2327 allVisibleTileLoaded: boolean;
2328 /**
2329 * The number of tiles which are still loading.
2330 */
2331 numTilesLoading: number;
2332 /**
2333 * List of tiles we want to render (i.e. the tiles computed from the zoom level and view
2334 * frustum). However some might not be renderable yet (e.g. loading). See [[renderedTiles]] for
2335 * the actual list of tiles that the user will see.
2336 */
2337 visibleTiles: Tile[];
2338 /**
2339 * Map of tiles that will be rendered, key is the the combination of tile key and offset, see
2340 * [[getKeyForTileKeyAndOffset]]. This includes tiles that are not in the [[visibleTiles]]
2341 * list but that are used as fallbacks b/c they are still in the cache.
2342 */
2343 renderedTiles: Map<number, Tile>;
2344}
2345
2346/**
2347 * Properties of a DataTexture (https://threejs.org/docs/#api/en/textures/DataTexture).
2348 */
2349export declare interface DataTextureProperties {
2350 width: number;
2351 height: number;
2352 format?: PixelFormat;
2353 type?: TextureDataType;
2354}
2355
2356export declare class DebugTile extends Tile {
2357 private readonly geometry;
2358 private readonly m_labelPositions;
2359 private m_textRenderStyle;
2360 private readonly m_textLayoutStyle;
2361 constructor(dataSource: DataSource, tileKey: TileKey);
2362}
2363
2364export declare class DebugTileDataSource extends DataSource {
2365 private m_tilingScheme;
2366 maxDbgZoomLevel: number;
2367 constructor(m_tilingScheme: TilingScheme, name?: string, maxDbgZoomLevel?: number);
2368 /** @override */
2369 getTilingScheme(): TilingScheme;
2370 /** @override */
2371 getTile(tileKey: TileKey): DebugTile;
2372 /** @override */
2373 canGetTile(zoomLevel: number, tileKey: TileKey): boolean;
2374}
2375
2376/**
2377 * This object has geometry data in the form of geometries buffers ready to be used by WebGL.
2378 * These geometries are not `three.js` objects. They are pure data stored as `ArrayBuffer`s and
2379 * metadata describing these buffers.
2380 */
2381export declare interface DecodedTile {
2382 techniques: IndexedTechnique[];
2383 geometries: Geometry[];
2384 pathGeometries?: PathGeometry[];
2385 textPathGeometries?: TextPathGeometry[];
2386 textGeometries?: TextGeometry[];
2387 poiGeometries?: PoiGeometry[];
2388 tileInfo?: TileInfo;
2389 decodeTime?: number;
2390 /**
2391 * The default bounding box in [[Tile]] is based on the geo box of the tile.
2392 * For data-sources that have 3d data this is not sufficient so the data-source can provide a
2393 * more accurate bounding box once the data is decoded.
2394 */
2395 boundingBox?: OrientedBox3;
2396 /**
2397 * Data sources not defining a bounding box may define alternatively a maximum geometry height
2398 * in meters. The bounding box of the resulting tile will be extended to encompass this height.
2399 */
2400 maxGeometryHeight?: number;
2401 /**
2402 * Tile data Copyright holder identifiers.
2403 *
2404 * `id`s should be unique. It is recommended to build them from unique identifiers like
2405 * registered domain names.
2406 *
2407 * @see [[CopyrightInfo]]
2408 */
2409 copyrightHolderIds?: string[];
2410}
2411
2412export declare const DEFAULT_MAX_THEME_INTHERITANCE_DEPTH = 4;
2413
2414/**
2415 * Default distance scale. Will be applied if distanceScale is not defined in the technique.
2416 * Defines the scale that will be applied to labeled icons (icon and text) in the distance.
2417 */
2418export declare const DEFAULT_TEXT_DISTANCE_SCALE = 0.5;
2419
2420/**
2421 * Possible values for `definitions` element of [Theme].
2422 */
2423export declare type Definition = LiteralValue | JsonExpr | BoxedDefinition | StyleDeclaration;
2424
2425/**
2426 * An array of [[Definition]]s.
2427 */
2428export declare interface Definitions {
2429 [name: string]: Definition;
2430}
2431
2432/**
2433 * Bitmask used for the depth pre-pass to prevent multiple fragments in the same screen position
2434 * from rendering color.
2435 */
2436export declare const DEPTH_PRE_PASS_STENCIL_MASK = 1;
2437
2438/**
2439 * Property identifying a material that is being used as a DepthPrePass material.
2440 */
2441export declare interface DepthPrePassProperties {
2442 /**
2443 * This material is a special depth prepass material.
2444 */
2445 isDepthPrepassMaterial?: true;
2446}
2447
2448/**
2449 * Collision box with additional boxes defining tighter bounds for the enclosed feature
2450 * (e.g.glyph bounds for text).
2451 */
2452declare class DetailedCollisionBox extends CollisionBox {
2453 readonly detailBoxes: CollisionBox[];
2454 constructor(box: Math2D.Box | THREE_2.Box2 | IBox, detailBoxes: CollisionBox[]);
2455}
2456
2457/**
2458 * Light type: directional.
2459 *
2460 * @remarks
2461 *
2462 * @defaultSnippets [
2463 * {
2464 * "label": "New Directional Light",
2465 * "description": "Adds a new Directional Light",
2466 * "body": {
2467 * "type": "directional",
2468 * "name": "${1:directional-light$:1}",
2469 * "color": "#${2:fff}",
2470 * "intensity": "^${3:1}",
2471 * "direction": {
2472 * "x": "^${4:1}",
2473 * "y": "^${5:0}",
2474 * "z": "^${6:0}"
2475 * }
2476 * }
2477 * }
2478 * ]
2479 */
2480export declare interface DirectionalLight extends BaseLight {
2481 type: "directional";
2482 /**
2483 * @format color-hex
2484 */
2485 color: string;
2486 intensity: number;
2487 direction: Vector3Like;
2488 castShadow?: boolean;
2489}
2490
2491export declare interface DisplacementMap {
2492 xCountVertices: number;
2493 yCountVertices: number;
2494 buffer: Float32Array;
2495}
2496
2497/**
2498 * Decorate property type with possible dynamic variants.
2499 */
2500export declare type DynamicProperty<T> = T | JsonExpr | InterpolatedPropertyDefinition<T>;
2501
2502export declare class EarthConstants {
2503 /** The equatorial circumference in meters. */
2504 static EQUATORIAL_CIRCUMFERENCE: number;
2505 /** The equatorial radius in meters. */
2506 static EQUATORIAL_RADIUS: number;
2507 /** The lowest point on earth (Dead Sea) in meters. */
2508 static MIN_ELEVATION: number;
2509 /** The highest point on earth (Mt. Everest) in meters. */
2510 static MAX_ELEVATION: number;
2511 /** The highest artificial structure (building) on earth, Burj Khalifa tower in Dubai */
2512 static MAX_BUILDING_HEIGHT: number;
2513}
2514
2515/**
2516 * Abstract evaluator class that adds support for elevation constraints.
2517 *
2518 * Classes derived from this should implement algorithms that takes into account rendered
2519 * features height (elevations), such as ground plane is no more flat (or spherical), but
2520 * contains geometry that should be overlapped by frustum planes.
2521 */
2522export declare abstract class ElevationBasedClipPlanesEvaluator implements ClipPlanesEvaluator {
2523 private m_maxElevation;
2524 private m_minElevation;
2525 constructor(maxElevation: number, minElevation: number);
2526 abstract evaluateClipPlanes(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
2527 /**
2528 * Set maximum elevation above sea level to be rendered.
2529 *
2530 * @param elevation - the elevation (altitude) value in world units (meters).
2531 * @note If you set this exactly to the maximum rendered feature height (altitude above
2532 * the sea, you may notice some flickering or even polygons disappearing related to rounding
2533 * errors or depth buffer precision. In such cases increase [[nearFarMargin]] or add a little
2534 * bit offset to your assumed maximum elevation.
2535 * @note Reasonable values are in between (-DeadSeeDepression, MtEverestHeight>, both values
2536 * are defined in [[EarthConstant]] as [[EarthConstant.MIN_ELEVATION]] and
2537 * [[EarthConstant.MAX_ELEVATION]] respectively.
2538 * @see minElevation for more information about precision and rounding errors.
2539 */
2540 set maxElevation(elevation: number);
2541 /**
2542 * Get maximum elevation to be covered by camera frustum.
2543 */
2544 get maxElevation(): number;
2545 /**
2546 * Set minimum elevation to be rendered, values beneath the sea level are negative.
2547 *
2548 * @param elevation - the minimum elevation (depression) in world units (meters).
2549 * @note If you set this parameter to zero you may not see any features rendered if they are
2550 * just below the sea level more than half of [[nearFarMargin]] assumed. Similarly if set to
2551 * -100m and rendered features lays exactly in such depression, you may notice that problem.
2552 * The errors usually come from projection precision loss and depth buffer nature (significant
2553 * precision loss closer to far plane). Thus is such cases either increase the margin (if you
2554 * are sure features are just at this elevation, or setup bigger offset for [[minElevation]].
2555 * Reasonable values are between <-DeadSeaDepression, MtEverestHeight), where the first denotes
2556 * lowest depression on the Earth defined as [[EarthConstants.MIN_ELEVATION]] and the second is
2557 * the highest point our planet.
2558 * @see https://developer.nvidia.com/content/depth-precision-visualized
2559 */
2560 set minElevation(elevation: number);
2561 /**
2562 * Get minimum elevation to be covered by camera frustum.
2563 */
2564 get minElevation(): number;
2565}
2566
2567export declare interface ElevationProvider {
2568 /**
2569 * Get elevation for a given geo point.
2570 *
2571 * @param geoPoint - geo position to query height for.
2572 * @param level - Optional data level that should be used for getting the elevation.
2573 * If undefined, the view's visible tile containing the point will be used.
2574 * @returns The height at geoPoint or undefined if no tile was found that covers the geoPoint.
2575 */
2576 getHeight(geoPoint: GeoCoordinates, level?: number): number | undefined;
2577 /**
2578 * Samples elevation for a given geo point from the specified displacement map.
2579 *
2580 * @param geoPoint - geo position to query height for.
2581 * @param tileDisplacementMap - Displacement map where the height will be sampled.
2582 * @returns The height at geoPoint.
2583 */
2584 sampleHeight(geoPoint: GeoCoordinates, tileDisplacementMap: TileDisplacementMap): number;
2585 /**
2586 * Cast a ray through the given screen position x, y.
2587 *
2588 * @param x - The X position in css/client coordinates (without applied display ratio).
2589 * @param y - The Y position in css/client coordinates (without applied display ratio).
2590 * @returns World coordinate of the intersection or undefined if no intersection detected.
2591 */
2592 rayCast(x: number, y: number): THREE.Vector3 | undefined;
2593 /**
2594 * Get the displacement map for a given tile key. If the displacement map for the given tileKey
2595 * is not in the cache a lower level tile will be returned.
2596 *
2597 * @param tileKey - The tile to get the displacement map for.
2598 * @returns Returns the DisplacmentMap for the given tileKey or a lower level tile. Undefined
2599 * if the tile or no parent is in the cache.
2600 */
2601 getDisplacementMap(tileKey: TileKey): TileDisplacementMap | undefined;
2602 /**
2603 * @returns the TilingScheme used for the DisplacementMaps returned by [[getDisplacementMap]] or
2604 * undefined if there is no elevation {@link DataSource} attached to the {@link MapView}.
2605 */
2606 getTilingScheme(): TilingScheme | undefined;
2607 /**
2608 * Clears the internal cache.
2609 */
2610 clearCache(): void;
2611}
2612
2613/**
2614 * Elevation range with an optional calculation status.
2615 */
2616export declare interface ElevationRange {
2617 minElevation: number;
2618 maxElevation: number;
2619 calculationStatus?: CalculationStatus;
2620}
2621
2622/**
2623 * Source for elevation ranges per tile. The returned elevation ranges will be used in the visible
2624 * tile computation to calculate proper bounding boxes.
2625 */
2626export declare interface ElevationRangeSource {
2627 /**
2628 * Compute the elevation range for a given {@link @here/harp-geoutils#TileKey}.
2629 * @param tileKey - The tile for which the elevation range should be computed.
2630 */
2631 getElevationRange(tileKey: TileKey): ElevationRange;
2632 /**
2633 * The tiling scheme of this {@link ElevationRangeSource}.
2634 *
2635 * @remarks
2636 * {@link MapView} will only apply the elevation
2637 * ranges returned by [[getElevationRange]] that have
2638 * the same {@link @here/harp-geoutils#TilingScheme}.
2639 */
2640 getTilingScheme(): TilingScheme;
2641 /**
2642 * Connects to the underlying data.
2643 */
2644 connect(): Promise<void>;
2645 /**
2646 * Returns `true` if this `ElevationRangeSource` is ready and the {@link MapView} can invoke
2647 * `getElevationRange()` to start requesting data.
2648 */
2649 ready(): boolean;
2650}
2651
2652/**
2653 * A class used to lookup properties by name.
2654 *
2655 * @remarks
2656 * Concrete implementation of `Env` like {@link MapEnv} are used
2657 * to resolve the property names used in {@link Expr | style expressions}.
2658 *
2659 * @example
2660 * ```typescript
2661 * const env = new MapEnv({
2662 * kind: "landuse",
2663 * });
2664 *
2665 * const expr = Expr.fromJson(["get", "kind"]);
2666 *
2667 * const value = expr.evaluate(env);
2668 *
2669 * console.log(`kind is '${value}`);
2670 * ```
2671 */
2672export declare class Env {
2673 /**
2674 * Returns `true` if the given object is an instance of {@link Env}.
2675 *
2676 * @param object - The object to test.
2677 */
2678 static isEnv(object: any): object is Env;
2679 /**
2680 * Returns property in {@link Env} by name.
2681 *
2682 * @param name - Name of property.
2683 */
2684 lookup(name: string): Value | undefined;
2685 /**
2686 * Return an object containing all properties of this environment. (Here: empty object).
2687 */
2688 unmap(): ValueMap;
2689}
2690
2691/**
2692 * @internal
2693 */
2694export declare type EqualityOp = "~=" | "^=" | "$=" | "==" | "!=";
2695
2696/**
2697 * Equirectangular {@link Projection} used to convert geo coordinates to world coordinates and vice
2698 * versa.
2699 */
2700export declare const equirectangularProjection: Projection;
2701
2702/**
2703 * Allows to easy parse/encode technique's base color property value as number coded color.
2704 *
2705 * Function takes care about property parsing, interpolation and encoding if neccessary.
2706 *
2707 * @see ColorUtils
2708 * @param technique - the technique where we search for base (transparency) color value
2709 * @param env - {@link @here/harp-datasource-protocol#Env} instance
2710 * used to evaluate {@link @here/harp-datasource-protocol#Expr}
2711 * based properties of [[Technique]]
2712 * @returns [[number]] encoded color value (in custom #TTRRGGBB) format or `undefined` if
2713 * base color property is not defined in the technique passed.
2714 */
2715export declare function evaluateBaseColorProperty(technique: Technique, env: Env): number | undefined;
2716
2717/**
2718 * Calculates the numerical value of the technique defined color property.
2719 *
2720 * Function takes care about color interpolation (when @param `env is set) as also parsing
2721 * string encoded colors.
2722 *
2723 * @note Use with care, because function does not recognize property type.
2724 * @param value - the value of color property defined in technique
2725 * @param env - {@link @here/harp-datasource-protocol#Env} instance used to evaluate
2726 * {@link @here/harp-datasource-protocol#Expr} based properties of [[Technique]]
2727 */
2728export declare function evaluateColorProperty(value: Value, env?: Env): number | undefined;
2729
2730/**
2731 * Map interaction events' names.
2732 */
2733export declare enum EventNames {
2734 Update = "update",
2735 BeginInteraction = "begin-interaction",
2736 EndInteraction = "end-interaction"
2737}
2738
2739/**
2740 * Abstract class representing the
2741 * {@link https://github.com/heremaps/harp.gl/blob/master/%40here/harp-datasource-protocol/StyleExpressions.md | style expressions}
2742 * used in {@link Theme}.
2743 */
2744export declare abstract class Expr {
2745 /**
2746 * Tests of given value is an {@link Expr}.
2747 *
2748 * @param value - The object to test.
2749 */
2750 static isExpr(value: any): value is Expr;
2751 /**
2752 * Creates an expression from the given `code`.
2753 *
2754 * @param code - The code to parse.
2755 * @returns The parsed {@link Expr}.
2756 * @deprecated `string` encoded expression are deprecated. Use {@link Expr.fromJSON} instead.
2757 */
2758 static parse(code: string): Expr | never;
2759 /**
2760 * Creates a style expression from JSON.
2761 *
2762 * @remarks
2763 * The optional set of {@link Theme.definitions | definitions} is used
2764 * to resolve the {@link https://github.com/heremaps/harp.gl/blob/master/%40here/harp-datasource-protocol/StyleExpressions.md#ref | ref expressions}.
2765 *
2766 * @param json - JSON object representing the expression to parse.
2767 * @param definitions - Optional set of definitions used to expand references.
2768 * @param definitionExprCache - Optional cache of `Expr` instances
2769 *
2770 * @example
2771 * ```typescript
2772 * const expr = Expr.fromJSON(["all",
2773 * ["==", ["geometry-type"], "LineString"],
2774 * ["has", "text"]
2775 * ]);
2776 * ```
2777 */
2778 static fromJSON(json: JsonValue, definitions?: Definitions, definitionExprCache?: Map<string, Expr>): Expr;
2779 private m_dependencies?;
2780 private m_isDynamic?;
2781 /**
2782 * Evaluate an expression returning a {@link Value} object.
2783 *
2784 * @param env - The {@link Env} used to lookup symbols.
2785 * @param scope - The evaluation scope. Defaults to [[ExprScope.Value]].
2786 * @param cache - A cache of previously computed results.
2787 */
2788 evaluate(env: Env, scope?: ExprScope, cache?: Map<Expr, Value>): Value | never;
2789 /**
2790 * Instantiates this {@link Expr}.
2791 *
2792 * @remarks
2793 * references to the `get` and `has` operator using the given instantiation context.
2794 *
2795 * @param context - The [[InstantationContext]] used to resolve names.
2796 */
2797 instantiate(context: InstantiationContext): Expr;
2798 /**
2799 * Gets the dependencies of this {@link Expr}.
2800 */
2801 dependencies(): ExprDependencies;
2802 /**
2803 * Create a unique object that is structurally equivalent to this {@link Expr}.
2804 *
2805 * @param pool - The [[ExprPool]] used to create a unique
2806 * equivalent object of this {@link Expr}.
2807 */
2808 intern(pool: ExprPool): Expr;
2809 toJSON(): JsonValue;
2810 /**
2811 * Returns `true` if a dynamic execution context is required to evaluate this {@link Expr}.
2812 */
2813 isDynamic(): boolean;
2814 /**
2815 * Visits this expression.
2816 *
2817 * @param visitor The visitor used to visit the expression.
2818 * @param context The context passed to the vistor.
2819 */
2820 abstract accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
2821 /**
2822 * Update the dynamic state of this {@link Expr}.
2823 *
2824 * `exprIsDynamic` must never be called directly.
2825 * @internal
2826 */
2827 protected abstract exprIsDynamic(): boolean;
2828}
2829
2830/**
2831 * The dependencies of an {@link Expr}.
2832 */
2833export declare class ExprDependencies {
2834 /**
2835 * The properties needed to evaluate the {@link Expr}.
2836 */
2837 readonly properties: Set<string>;
2838 /**
2839 * `true` if the expression depends on the feature state.
2840 */
2841 featureState?: boolean;
2842 /**
2843 * `true` if this expression cannot be cached.
2844 */
2845 volatile?: boolean;
2846}
2847
2848/**
2849 * [[ExprEvaluator]] is used to evaluate {@link Expr} in a given environment.
2850 *
2851 * @hidden
2852 */
2853declare class ExprEvaluator implements ExprVisitor<Value, ExprEvaluatorContext> {
2854 static defineOperator(op: string, builtin: OperatorDescriptor): void;
2855 static defineOperators(builtins: OperatorDescriptorMap): void;
2856 /**
2857 * Returns the [[OperatorDescriptor]] for the given operator name.
2858 * @hidden
2859 */
2860 static getOperator(op: string): OperatorDescriptor | undefined;
2861 visitVarExpr(expr: VarExpr, context: ExprEvaluatorContext): Value;
2862 visitNullLiteralExpr(expr: NullLiteralExpr, context: ExprEvaluatorContext): Value;
2863 visitBooleanLiteralExpr(expr: BooleanLiteralExpr, context: ExprEvaluatorContext): Value;
2864 visitNumberLiteralExpr(expr: NumberLiteralExpr, context: ExprEvaluatorContext): Value;
2865 visitStringLiteralExpr(expr: StringLiteralExpr, context: ExprEvaluatorContext): Value;
2866 visitObjectLiteralExpr(expr: ObjectLiteralExpr, context: ExprEvaluatorContext): Value;
2867 visitHasAttributeExpr(expr: HasAttributeExpr, context: ExprEvaluatorContext): Value;
2868 visitMatchExpr(match: MatchExpr, context: ExprEvaluatorContext): Value;
2869 visitCaseExpr(match: CaseExpr, context: ExprEvaluatorContext): Value;
2870 visitCallExpr(expr: CallExpr, context: ExprEvaluatorContext): Value;
2871 visitStepExpr(expr: StepExpr, context: ExprEvaluatorContext): Value;
2872 visitInterpolateExpr(expr: InterpolateExpr, context: ExprEvaluatorContext): Value;
2873}
2874
2875declare class ExprEvaluatorContext {
2876 readonly evaluator: ExprEvaluator;
2877 readonly env: Env;
2878 readonly scope: ExprScope;
2879 readonly cache?: Map<Expr, Value> | undefined;
2880 constructor(evaluator: ExprEvaluator, env: Env, scope: ExprScope, cache?: Map<Expr, Value> | undefined);
2881 /**
2882 * Evaluate the given expression.
2883 *
2884 * @param expr - The {@link Expr} to evaluate.
2885 */
2886 evaluate(expr: Expr | undefined): Value;
2887 /**
2888 * Wraps the given value in an {@link Expr} if needed.
2889 *
2890 * @param value -
2891 */
2892 wrapValue(value: Value | Expr): Expr;
2893}
2894
2895/**
2896 * [[ExprPool]] maintains a set of unique interned {@link Expr} objects.
2897 *
2898 * @hidden
2899 */
2900declare class ExprPool implements ExprVisitor<Expr, void> {
2901 private readonly m_booleanLiterals;
2902 private readonly m_numberLiterals;
2903 private readonly m_stringLiterals;
2904 private readonly m_objectLiterals;
2905 private readonly m_arrayLiterals;
2906 private readonly m_varExprs;
2907 private readonly m_hasAttributeExprs;
2908 private readonly m_matchExprs;
2909 private readonly m_caseExprs;
2910 private readonly m_interpolateExprs;
2911 private readonly m_stepExprs;
2912 private readonly m_callExprs;
2913 /**
2914 * Add `expr` to this [[ExprPool]] and return a unique {@link Expr}
2915 * object that is structurally equivalent to `expr`.
2916 *
2917 * @param expr - The {@link Expr} to add to this [[ExprPool]].
2918 * @returns A unique {@link Expr} that is structurally equivalent to `expr`.
2919 */
2920 add(expr: Expr): Expr;
2921 visitNullLiteralExpr(expr: NullLiteralExpr, context: void): Expr;
2922 visitBooleanLiteralExpr(expr: BooleanLiteralExpr, context: void): Expr;
2923 visitNumberLiteralExpr(expr: NumberLiteralExpr, context: void): Expr;
2924 visitStringLiteralExpr(expr: StringLiteralExpr, context: void): Expr;
2925 visitObjectLiteralExpr(expr: ObjectLiteralExpr, context: void): Expr;
2926 visitVarExpr(expr: VarExpr, context: void): Expr;
2927 visitHasAttributeExpr(expr: HasAttributeExpr, context: void): Expr;
2928 visitMatchExpr(expr: MatchExpr, context: void): Expr;
2929 visitCaseExpr(expr: CaseExpr, context: void): Expr;
2930 visitCallExpr(expr: CallExpr, context: void): Expr;
2931 visitStepExpr(expr: StepExpr, context: void): Expr;
2932 visitInterpolateExpr(expr: InterpolateExpr, context: void): Expr;
2933}
2934
2935/**
2936 * The evaluation scope of an {@link Expr}.
2937 */
2938export declare enum ExprScope {
2939 /**
2940 * The scope of an {@link Expr} used as value of an attribute.
2941 */
2942 Value = 0,
2943 /**
2944 * The scope of an {@link Expr} used in a [[Technique]] `when` condition.
2945 */
2946 Condition = 1,
2947 /**
2948 * The scope of an {@link Expr} used as dynamic property attribute value.
2949 */
2950 Dynamic = 2
2951}
2952
2953/**
2954 * A visitor for {@link Expr} nodes.
2955 */
2956export declare interface ExprVisitor<Result, Context> {
2957 visitNullLiteralExpr(expr: NullLiteralExpr, context: Context): Result;
2958 visitBooleanLiteralExpr(expr: BooleanLiteralExpr, context: Context): Result;
2959 visitNumberLiteralExpr(expr: NumberLiteralExpr, context: Context): Result;
2960 visitStringLiteralExpr(expr: StringLiteralExpr, context: Context): Result;
2961 visitObjectLiteralExpr(expr: ObjectLiteralExpr, context: Context): Result;
2962 visitVarExpr(expr: VarExpr, context: Context): Result;
2963 visitHasAttributeExpr(expr: HasAttributeExpr, context: Context): Result;
2964 visitCallExpr(expr: CallExpr, context: Context): Result;
2965 visitMatchExpr(expr: MatchExpr, context: Context): Result;
2966 visitCaseExpr(expr: CaseExpr, context: Context): Result;
2967 visitStepExpr(expr: StepExpr, context: Context): Result;
2968 visitInterpolateExpr(expr: InterpolateExpr, context: Context): Result;
2969}
2970
2971export declare type ExtendedMesh = THREE_2.Mesh & {
2972 /**
2973 * Distance of this object from the Tile's center.
2974 */
2975 displacement?: THREE_2.Vector3;
2976};
2977
2978/**
2979 * Style used to draw a geometry as an extruded polygon, for example extruded buildings.
2980 */
2981export declare type ExtrudedPolygonStyle = BaseStyle<"extruded-polygon", ExtrudedPolygonTechniqueParams>;
2982
2983/**
2984 * Runtime representation of [[ExtrudedPolygonStyle]] as parsed by [[StyleSetEvaluator]].
2985 * For technique parameters see [[ExtrudedPolygonTechniqueParams]].
2986 */
2987export declare interface ExtrudedPolygonTechnique extends MakeTechniqueAttrs<ExtrudedPolygonTechniqueParams> {
2988 name: "extruded-polygon";
2989}
2990
2991/**
2992 * Technique used to draw a geometry as an extruded polygon, for example extruded buildings.
2993 */
2994export declare interface ExtrudedPolygonTechniqueParams extends StandardTechniqueParams {
2995 /**
2996 * Renders the footprint lines if set to 'true'.
2997 */
2998 footprint?: boolean;
2999 /**
3000 * Set to a negative value to remove all the vertical lines, and to a value between 0.0 and 1.0
3001 * to modulate the amount of vertical lines rendered.
3002 */
3003 maxSlope?: number;
3004 /**
3005 * Width of the lines. Currently limited to the [0, 1] range.
3006 */
3007 lineWidth: DynamicProperty<number>;
3008 /**
3009 * Fill color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
3010 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
3011 * @format color-hex
3012 */
3013 lineColor?: DynamicProperty<StyleColor>;
3014 /**
3015 * Mix value between the lineColor(0.0) and the geometry's vertex colors(1.0).
3016 */
3017 lineColorMix?: number;
3018 /**
3019 * Distance to the camera (0.0 = nearPlane, 1.0 = farPlane) at which the object edges start
3020 * fading out.
3021 */
3022 lineFadeNear?: DynamicProperty<number>;
3023 /**
3024 * Distance to the camera (0.0 = nearPlane, 1.0 = farPlane) at which the object edges become
3025 * transparent. A value of <= 0.0 disables fading.
3026 */
3027 lineFadeFar?: DynamicProperty<number>;
3028 /**
3029 * Height above ground in world units of extruded polygon.
3030 *
3031 * Usually, unique per feature, so defaults to `["get", "height"]`.
3032 */
3033 height?: DynamicProperty<number>;
3034 /**
3035 * Height of "floor" of extruded polygon in world units of extruded polygon.
3036 *
3037 * Usually, unique per feature, so defaults to `["number", ["get", "min_height"], 0]`.
3038 */
3039 floorHeight?: DynamicProperty<number>;
3040 /**
3041 * In some data sources, for example Tilezen, building extrusion information might be missing.
3042 * This attribute allows to define a default height of an extruded polygon in the theme.
3043 *
3044 * @deprecated use [[height]]
3045 */
3046 defaultHeight?: number;
3047 /**
3048 * Default color used if feature doesn't provide color attribute
3049 * and [[MapEnv]] did not return it too.
3050 * @format color-hex
3051 */
3052 defaultColor?: DynamicProperty<StyleColor>;
3053 /**
3054 * If `true`, the height of the extruded buildings will not be modified by the mercator
3055 * projection distortion that happens around the poles.
3056 *
3057 * @default `false`
3058 */
3059 constantHeight?: boolean;
3060 /**
3061 * If `true`, wall geometry will is added along the tile boundaries. Note, this causes artifacts
3062 * when used with shadows, so it should be known in advance that shadows won't be enabled.
3063 * @default `false`
3064 */
3065 boundaryWalls?: boolean;
3066 /**
3067 * Animate the extrusion of the buildings if set to `true`.
3068 */
3069 animateExtrusion?: DynamicProperty<boolean>;
3070 /**
3071 * Duration of the building's extrusion in milliseconds
3072 */
3073 animateExtrusionDuration?: number;
3074 /**
3075 * Control rendering of depth prepass before the actual geometry.
3076 *
3077 * Depth prepass is a method to render translucent meshes, hence only the visible front faces of
3078 * a mesh are actually rendered, removing artifacts caused by blending with internal faces of
3079 * the mesh. This method is used for drawing translucent buildings over map background.
3080 *
3081 * By default, each [[DataSource]] determines how/if enable the depth pre-pass. A value of
3082 * `false` forcefully disables depth prepass.
3083 */
3084 enableDepthPrePass?: boolean;
3085}
3086
3087export declare const FALLBACK_RENDER_ORDER_OFFSET = 20000;
3088
3089/**
3090 * Represents "Feature" GeoJSON object.
3091 */
3092export declare interface Feature {
3093 type: "Feature";
3094 bbox?: number[];
3095 id?: string;
3096 geometry: FeatureGeometry | GeometryCollection;
3097 properties?: any;
3098 title?: string;
3099}
3100
3101/**
3102 * Represents "FeatureCollection" GeoJSON object.
3103 */
3104export declare interface FeatureCollection {
3105 type: "FeatureCollection";
3106 features: Feature[];
3107}
3108
3109/**
3110 * Options for [[FeaturesDataSource]].
3111 */
3112export declare interface FeatureDataSourceOptions extends OmvDataSourceParameters, GeoJsonDataProviderOptions {
3113 /**
3114 * Initial set of features for new instance of [[FeaturesDataSource]].
3115 *
3116 * Shortcut for calling [[FeaturesDataSource.add]] after construction.
3117 */
3118 features?: MapViewFeature[];
3119 /**
3120 * Initial GeoJSON load for new instance of [[FeaturesDataSource]].
3121 *
3122 * Shortcut for calling [[FeaturesDataSource.setFromGeojson]] after construction.
3123 */
3124 geojson?: FeatureCollection | GeometryCollection | Feature;
3125}
3126
3127/**
3128 * Feature details contains `feature.id`, `feature.properties.featureClass` which provides
3129 * possibility to define style in theme for particular feature.
3130 */
3131export declare interface FeatureDetails {
3132 featureId?: string;
3133 featureClass?: string;
3134}
3135
3136/**
3137 * Represents "geometry" property of "Feature" GeoJSON object.
3138 */
3139export declare type FeatureGeometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon;
3140
3141/**
3142 * Feature Modifier ids to choose which OmvFeatureModifer should be used in OmvDecoder.
3143 */
3144export declare enum FeatureModifierId {
3145 /**
3146 * Generic feature modifier used when no other modifiers are defined.
3147 *
3148 * @note You do not need to specify it in [[OmvDataSourceParameters]] as it is added by default
3149 * if no other feature modifier is used.
3150 */
3151 default = 0,
3152 /**
3153 * Identifier to use the OmvTomTomFeatureModifier in the OmvDecoder.
3154 */
3155 tomTom = 1
3156}
3157
3158/**
3159 * [[DataSource]] implementation to use for the addition of custom features.
3160 */
3161export declare class FeaturesDataSource extends OmvDataSource {
3162 private m_isAttached;
3163 private m_featureCollection;
3164 /**
3165 * Builds a `FeaturesDataSource`.
3166 *
3167 * @param options - specify custom options using [[FeatureDataSourceOptions]] interface.
3168 */
3169 constructor(options?: FeatureDataSourceOptions);
3170 /**
3171 * This method allows to directly add a GeoJSON without using [[MapViewFeature]] instances. It
3172 * also overwrites existing features in this data source. To add a GeoJSON without overwriting
3173 * the data source, one should loop through it to create [[MapViewFeature]] and add them with
3174 * the `add` method.
3175 *
3176 * @param geojson - A javascript object matching the GeoJSON specification.
3177 */
3178 setFromGeojson(geojson: FeatureCollection | GeometryCollection | Feature): this;
3179 /**
3180 * Adds a custom feature in the datasource.
3181 *
3182 * @param features - The features to add in the datasource.
3183 */
3184 add(...features: MapViewFeature[]): this;
3185 /**
3186 * Removes a custom feature in the datasource.
3187 *
3188 * @param features - The features to add in the datasource.
3189 */
3190 remove(...features: MapViewFeature[]): this;
3191 /**
3192 * Removes all the custom features in this `FeaturesDataSource`.
3193 */
3194 clear(): void;
3195 /** @override */
3196 connect(): Promise<void>;
3197 /**
3198 * Override [[DataSource.attach]] to know if we're really connected to [[MapView]].
3199 * @param mapView -
3200 * @override
3201 */
3202 attach(mapView: MapView): void;
3203 /**
3204 * Override [[DataSource.detach]] to know if we're really connected to [[MapView]].
3205 * @param mapView -
3206 * @override
3207 */
3208 detach(mapView: MapView): void;
3209 /**
3210 * Get [[GeoBox]] containing all the points in datasource.
3211 *
3212 * Returns undefined if there were no features added to this DS.
3213 */
3214 getGeoBox(): GeoBox | undefined;
3215 private addFeature;
3216 private removeFeature;
3217 private update;
3218 private emptyGeojson;
3219}
3220
3221export declare type FillStyle = BaseStyle<"fill", FillTechniqueParams>;
3222
3223/**
3224 * Runtime representation of [[FillStyle]] as parsed by [[StyleSetEvaluator]].
3225 * For technique parameters see [[FillTechniqueParams]].
3226 */
3227export declare interface FillTechnique extends MakeTechniqueAttrs<FillTechniqueParams> {
3228 name: "fill";
3229}
3230
3231/**
3232 * Technique used to draw filled polygons.
3233 */
3234export declare interface FillTechniqueParams extends BaseTechniqueParams, PolygonalTechniqueParams {
3235 /**
3236 * Fill color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
3237 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
3238 * @format color-hex
3239 */
3240 color?: DynamicProperty<StyleColor>;
3241 /**
3242 * Set to `true` if line should appear transparent. Rendering transparent lines may come with a
3243 * slight performance impact.
3244 */
3245 transparent?: boolean;
3246 /**
3247 * For transparent lines, set a value between `0.0` for fully transparent, to `1.0` for fully
3248 * opaque.
3249 */
3250 opacity?: DynamicProperty<number>;
3251 /**
3252 * A value of `true` creates a wireframe geometry. (May not be supported with all techniques).
3253 */
3254 wireframe?: boolean;
3255 /**
3256 * Width of the lines. Currently limited to the [0, 1] range.
3257 */
3258 lineWidth?: DynamicProperty<number>;
3259}
3260
3261/**
3262 * Provides the most basic evaluation concept giving fixed values with some constraints.
3263 */
3264export declare class FixedClipPlanesEvaluator implements ClipPlanesEvaluator {
3265 readonly minNear: number;
3266 readonly minFarOffset: number;
3267 readonly minFar: number;
3268 private m_nearPlane;
3269 private m_farPlane;
3270 constructor(minNear?: number, minFarOffset?: number);
3271 get nearPlane(): number;
3272 set nearPlane(fixedNear: number);
3273 get farPlane(): number;
3274 set farPlane(fixedFar: number);
3275 set minElevation(elevation: number);
3276 get minElevation(): number;
3277 set maxElevation(elevation: number);
3278 get maxElevation(): number;
3279 /** @override */
3280 evaluateClipPlanes(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
3281 private invalidatePlanes;
3282}
3283
3284/**
3285 * A type representing HARP themes with all the styleset declarations
3286 * grouped in one [[Array]].
3287 *
3288 * @internal This type will merge with {@link Theme}.
3289 */
3290export declare type FlatTheme = Omit<Theme, "styles"> & {
3291 /**
3292 * The style rules used to render the map.
3293 */
3294 styles?: StyleSet;
3295};
3296
3297/**
3298 * `FlatTileBoundingBoxGenerator` generates bounding boxes in world and geo coordinates for a given
3299 * TilingScheme.
3300 */
3301export declare class FlatTileBoundingBoxGenerator {
3302 readonly tilingScheme: TilingScheme;
3303 readonly minElevation: number;
3304 readonly maxElevation: number;
3305 private readonly m_tilingScheme;
3306 private readonly m_worldDimensions;
3307 private readonly m_worldBox;
3308 /**
3309 * Creates a new `FlatTileBoundingBoxGenerator` that can generate bounding boxes for the given
3310 * TilingScheme.
3311 *
3312 * @param tilingScheme - The {@link TilingScheme} used to compute bounding boxes.
3313 * @param minElevation - The minimum elevation in meters.
3314 * @param maxElevation - The maximum elevation in meters.
3315 */
3316 constructor(tilingScheme: TilingScheme, minElevation?: number, maxElevation?: number);
3317 /**
3318 * Returns the {@link Projection} of the {@link TilingScheme}.
3319 */
3320 get projection(): Projection;
3321 /**
3322 * Returns the {@link SubdivisionScheme} of the {@link TilingScheme}.
3323 */
3324 get subdivisionScheme(): SubdivisionScheme;
3325 /**
3326 * Returns the bounding box in world coordinates of the given {@link TileKey}.
3327 *
3328 * Example:
3329 * ```typescript
3330 * const worldBounds = new THREE.Box3();
3331 * generator.getWorldBox(geoBox, worldBounds);
3332 * console.log(worldBounds.getCenter());
3333 * ```
3334 *
3335 * @param tileKey - The TileKey.
3336 * @param result - The optional object used to store the resulting bounding box in world
3337 * coordinates.
3338 */
3339 getWorldBox(tileKey: TileKey, result?: Box3Like): Box3Like;
3340 /**
3341 * Returns the bounding box in geo coordinates for the given {@link TileKey}.
3342 *
3343 * Example:
3344 * ```typescript
3345 * const geoBox = generator.getGeoBox(worldBounds);
3346 * console.log(geoBox.center);
3347 * ```
3348 *
3349 * @param tileKey - The {@link TileKey}.
3350 */
3351 getGeoBox(tileKey: TileKey): GeoBox;
3352}
3353
3354/**
3355 * Interface that defines the options to configure fog.
3356 */
3357export declare interface Fog {
3358 /** Fog's color. */
3359 color: string;
3360 /** Distance ratio to far plane at which the linear fog begins. */
3361 startRatio: number;
3362}
3363
3364/**
3365 * Description of all assets, charset and metrics that define a font inside a [[FontCatalog]].
3366 */
3367declare interface Font {
3368 name: string;
3369 metrics: FontMetrics;
3370 charset: string;
3371 bold?: string;
3372 italic?: string;
3373 boldItalic?: string;
3374}
3375
3376/**
3377 * Collection of font assets used to render glyphs when using a [[TextCanvas]].
3378 *
3379 * @summary A `FontCatalog` works as a stack of SDF bitmap fonts (using the BMFont format) designed
3380 * to cover the widest Unicode code point range possible. In order to manage all these assets
3381 * elegantly, the assets inside the `FontCatalog` are stored on a per-Unicode-Block basis, and
3382 * assets for a block are only loaded once a glyph belonging to that block is requested.
3383 *
3384 * Bitmap information coming from all different fonts is then stored in a unified WebGL GPU Texture
3385 * resource, which can be sampled to render all currently loaded glyphs.
3386 *
3387 */
3388declare class FontCatalog {
3389 readonly url: string;
3390 readonly name: string;
3391 readonly type: string;
3392 readonly size: number;
3393 readonly maxWidth: number;
3394 readonly maxHeight: number;
3395 readonly distanceRange: number;
3396 readonly fonts: Font[];
3397 readonly unicodeBlocks: UnicodeBlock[];
3398 readonly maxCodePointCount: number;
3399 private m_replacementGlyph;
3400 /**
3401 * Loads a `FontCatalog`.
3402 *
3403 * @param url - Asset url.
3404 * @param maxCodePointCount - Maximum number of unique code points bitmaps this `FontCatalog`'s
3405 * internal texture can store simultaneously.
3406 *
3407 * @returns `FontCatalog` Promise.
3408 */
3409 static load(path: string, maxCodePointCount: number): Promise<FontCatalog>;
3410 static loadTexture(url: string): Promise<THREE_2.Texture>;
3411 static loadJSON(url: string): Promise<any>;
3412 private m_glyphTextureCache;
3413 private m_loadingJson;
3414 private m_loadingPages;
3415 private m_loadingGlyphs;
3416 private m_loadedJson;
3417 private m_loadedPages;
3418 private m_loadedGlyphs;
3419 /**
3420 * @hidden
3421 * Creates a new FontCatalog.
3422 *
3423 * @param url - FontCatalog's URL.
3424 * @param name - FontCatalog's name.
3425 * @param type - FontCatalog's type (sdf or msdf).
3426 * @param size - FontCatalog's glyph size (pixels).
3427 * @param maxWidth - FontCatalog's maximum glyph width (pixels).
3428 * @param maxHeight - FontCatalog's maximum glyph height (pixels).
3429 * @param distanceRange - Distance range used to generate the SDF bitmaps.
3430 * @param fonts - Array of supported fonts.
3431 * @param unicodeBlocks - Array of supported Unicode blocks.
3432 * @param maxCodePointCount - Maximum number of unique code points bitmaps this `FontCatalog`'s
3433 * internal texture can store simultaneously.
3434 * @param m_replacementGlyph - [[GlyphData]] to be used whenever a Unicode code point is not
3435 * supported by this `FontCatalog`.
3436 *
3437 * @returns New FontCatalog.
3438 */
3439 private constructor();
3440 /**
3441 * Release all allocated resources.
3442 */
3443 dispose(): void;
3444 /**
3445 * Removes all loaded (and loading) assets.
3446 */
3447 clear(): void;
3448 /**
3449 * Updates the internal WebGLRenderTarget.
3450 * The update will copy the newly introduced glyphs since the previous update.
3451 *
3452 * @param renderer - WebGLRenderer.
3453 */
3454 update(renderer: THREE_2.WebGLRenderer): void;
3455 /**
3456 * Internal WebGL Texture.
3457 */
3458 get texture(): THREE_2.Texture;
3459 /**
3460 * Internal WebGL Texture size.
3461 */
3462 get textureSize(): THREE_2.Vector2;
3463 /**
3464 * Current internal loading state.
3465 */
3466 get isLoading(): boolean;
3467 /**
3468 * Loads the description file for a specific [[UnicodeBlock]]. This speeds up consequent calls
3469 * to `FontCatalog`.loadCharset() that require glyphs from this block to be loaded.
3470 *
3471 * @param block - Requested [[UnicodeBlock]].
3472 * @param font - [[Font]] to retrieve this Unicode block from.
3473 * @param fontStyle - [[FontStyle]] assets to load.
3474 * @param loadPages - If `true`, all pages in this Unicode block will also be loaded.
3475 *
3476 * @returns Loaded Unicode Block json.
3477 */
3478 loadBlock(block: UnicodeBlock, font: Font, fontStyle: FontStyle, loadPages?: boolean): Promise<any>;
3479 /**
3480 * Releases the description file for a specific [[UnicodeBlock]] (and all downloaded pages).
3481 * Safe to call when no assets for this block have been loaded.
3482 *
3483 * @param block - Requested [[UnicodeBlock]].
3484 * @param font - [[Font]] to remove this Unicode block from.
3485 * @param fontStyle - [[FontStyle]] assets to remove.
3486 */
3487 removeBlock(block: UnicodeBlock, font: Font, fontStyle: FontStyle): void;
3488 /**
3489 * Loads all the required glyphs needed to render the input text. Character repetition will not
3490 * be considered, and only styled assets (with applied font selection, style and variants) will
3491 * be loaded.
3492 *
3493 * @param input - Input text.
3494 * @param style - Specific [[TextRenderStyle]] for which glyphs will be loaded.
3495 *
3496 * @returns Promise containing an array of all loaded [[GlyphData]] for the input text.
3497 */
3498 loadCharset(input: string, style: TextRenderStyle): Promise<GlyphData[]>;
3499 /**
3500 * Retrieves the loaded [[GlyphData]] for a specific character.
3501 * Returns `undefined` if the assets for this glyph haven't been loaded yet.
3502 *
3503 * @param codePoint - Character's Unicode code point.
3504 * @param font - [[Font]] to get this glyph from.
3505 * @param fontStyle - Specific [[FontStyle]] to get glyphs for.
3506 *
3507 * @returns [[GlyphData]] for this code point.
3508 */
3509 getGlyph(codePoint: number, font: Font, fontStyle: FontStyle): GlyphData | undefined;
3510 /**
3511 * Retrieves the loaded [[GlyphData]] for the specified text.
3512 * Returns `undefined` if the assets for these glyphs haven't been loaded yet.
3513 *
3514 * @param input - Input text.
3515 * @param style - Specific [[TextRenderStyle]] to get glyphs for.
3516 * @param letterCaseArray - Array containing the original letter case for the requested glyphs.
3517 *
3518 * @returns Array containing [[GlyphData]] for each character of the input text.
3519 */
3520 getGlyphs(input: string, style: TextRenderStyle, letterCaseArray?: boolean[]): GlyphData[] | undefined;
3521 /**
3522 * Gets the best matched font for a specific character.
3523 *
3524 * @param codePoint - Character's Unicode code point.
3525 * @param fontName - Font name suggestion.
3526 *
3527 * @returns Best matched font.
3528 */
3529 getFont(codePoint: number, fontName?: string): Font;
3530 /**
3531 * Update the info with the memory footprint caused by objects owned by the `FontCatalog`.
3532 *
3533 * @param info - The info object to increment with the values from this `FontCatalog`.
3534 */
3535 updateMemoryUsage(info: MemoryUsage): void;
3536 private createReplacementGlyph;
3537 private loadAssets;
3538 private loadPage;
3539 private getAssetsPath;
3540}
3541
3542declare type FontCatalogCallback = (name: string, catalog: FontCatalog) => void;
3543
3544/**
3545 * Fonts used for all text related rendering.
3546 */
3547export declare interface FontCatalogConfig {
3548 url: string;
3549 name: string;
3550}
3551
3552declare class FontCatalogLoader {
3553 private readonly m_theme;
3554 private m_catalogsLoading;
3555 constructor(m_theme: Theme);
3556 /**
3557 * Initializes font catalog loader.
3558 * @param defaultFontCatalogUrl - Url of the font catalog that will be used by default if the
3559 * theme doesn't define any font catalog.
3560 * @returns Name of the default font catalog.
3561 */
3562 initialize(defaultFontCatalogUrl: string): string;
3563 loadCatalogs(catalogCallback: FontCatalogCallback): Promise<void[]>;
3564 get loading(): boolean;
3565}
3566
3567/**
3568 * Metrics defining the placement and rendering of all glyphs in a given [[Font]].
3569 */
3570declare interface FontMetrics {
3571 size: number;
3572 distanceRange: number;
3573 base: number;
3574 lineHeight: number;
3575 lineGap: number;
3576 capHeight: number;
3577 xHeight: number;
3578}
3579
3580/**
3581 * Pair of unit and size specifying a font's size.
3582 */
3583declare interface FontSize {
3584 unit: FontUnit;
3585 size: number;
3586 backgroundSize: number;
3587}
3588
3589/**
3590 * Style to be used when rendering glyphs.
3591 */
3592declare enum FontStyle {
3593 Regular = 0,
3594 Bold = 1,
3595 Italic = 2,
3596 BoldItalic = 3
3597}
3598
3599/**
3600 * Unit of measurement used to specify a font's size.
3601 */
3602declare enum FontUnit {
3603 Em = 0,
3604 Pixel = 1,
3605 Point = 2,
3606 Percent = 3
3607}
3608
3609/**
3610 * Variant to be used when rendering.
3611 */
3612declare enum FontVariant {
3613 Regular = 0,
3614 AllCaps = 1,
3615 SmallCaps = 2
3616}
3617
3618/**
3619 * Specifies how the FOV (Field of View) should be calculated.
3620 */
3621export declare interface FovCalculation {
3622 /**
3623 * How to interpret the [[fov]], can be either `fixed` or `dynamic`.
3624 *
3625 * `fixed` means that the FOV is fixed regardless of the [[viewportHeight]], such that shrinking
3626 * the height causes the map to shrink to keep the content in view. The benefit is that,
3627 * regardless of any resizes, the field of view is constant, which means there is no change in
3628 * the distortion of buildings near the edges. However the trade off is that the zoom level
3629 * changes, which means that the map will pull in new tiles, hence causing some flickering.
3630 *
3631 * `dynamic` means that the focal length is calculated based on the supplied [[fov]] and
3632 * [[viewportHeight]], this means that the map doesn't scale (the image is essentially cropped
3633 * but not shrunk) when the [[viewportHeight]] or [[viewportWidth]] is changed. The benefit is
3634 * that the zoom level is (currently) stable during resize, because the focal length is used,
3635 * however the tradeoff is that changing from a small to a big height will cause the fov to
3636 * change a lot, and thus introduce distortion.
3637 */
3638 type: "fixed" | "dynamic";
3639 /**
3640 * If [[type]] is `fixed` then the supplied [[fov]] is fixed regardless of
3641 * [[viewportHeight]] or [[viewportWidth]].
3642 *
3643 * If [[type]] is `dynamic` then the supplied [[fov]] is applied to the
3644 * first frame, and the focal length calculated. Changes to the viewport
3645 * height no longer shrink the content because the field of view is updated
3646 * dynamically.
3647 */
3648 fov: number;
3649}
3650
3651/**
3652 * Class containing all counters, timers and events of the current frame.
3653 */
3654export declare class FrameStats {
3655 readonly entries: Map<string, number>;
3656 messages?: string[];
3657 /**
3658 * Retrieve the value of the performance number.
3659 *
3660 * @param name - Name of the performance number.
3661 * @returns The value of the performance number or `undefined` if it has not been declared by
3662 * `setValue` before.
3663 */
3664 getValue(name: string): number | undefined;
3665 /**
3666 * Set the value of the performance number.
3667 *
3668 * @param name - Name of the performance number.
3669 * @param name - New value of the performance number.
3670 */
3671 setValue(name: string, value: number): void;
3672 /**
3673 * Add a value to the current value of the performance number. If the performance is not known,
3674 * it will be initialized with `value`.
3675 *
3676 * @param name - Name of the performance number.
3677 * @param name - Value to be added to the performance number.
3678 */
3679 addValue(name: string, value: number): void;
3680 /**
3681 * Add a text message to the frame, like "Font XYZ has been loaded"
3682 *
3683 * @param message - The message to add.
3684 */
3685 addMessage(message: string): void;
3686 /**
3687 * Reset all known performance values to `0` and the messages to `undefined`.
3688 */
3689 reset(): void;
3690}
3691
3692/**
3693 * @ignore
3694 * Only exported for testing.
3695 *
3696 * Instead of passing around an array of objects, we store the frame statistics as an object of
3697 * arrays. This allows convenient computations from {@link RingBuffer},
3698 */
3699export declare class FrameStatsArray {
3700 readonly capacity: number;
3701 readonly frameEntries: Map<string, RingBuffer<number>>;
3702 readonly messages: RingBuffer<string[] | undefined>;
3703 constructor(capacity?: number);
3704 get length(): number;
3705 reset(): void;
3706 addFrame(frameStats: FrameStats): void;
3707 /**
3708 * Prints all values to the console.
3709 */
3710 log(): void;
3711}
3712
3713/**
3714 * Computes the tiles intersected by the frustum defined by the current camera setup.
3715 */
3716declare class FrustumIntersection {
3717 private readonly m_camera;
3718 readonly mapView: MapView;
3719 private readonly m_extendedFrustumCulling;
3720 private readonly m_tileWrappingEnabled;
3721 private readonly m_enableMixedLod;
3722 private readonly m_frustum;
3723 private readonly m_viewProjectionMatrix;
3724 private readonly m_mapTileCuller;
3725 private m_rootTileKeys;
3726 private readonly m_tileKeyEntries;
3727 constructor(m_camera: THREE_2.PerspectiveCamera, mapView: MapView, m_extendedFrustumCulling: boolean, m_tileWrappingEnabled: boolean, m_enableMixedLod: boolean);
3728 /**
3729 * Return camera used for generating frustum.
3730 */
3731 get camera(): THREE_2.PerspectiveCamera;
3732 /**
3733 * Return projection used to convert geo coordinates to world coordinates.
3734 */
3735 get projection(): Projection;
3736 /**
3737 * Updates the frustum to match the current camera setup.
3738 */
3739 updateFrustum(projectionMatrixOverride?: THREE_2.Matrix4): void;
3740 /**
3741 * Computes the tiles intersected by the updated frustum, see [[updateFrustum]].
3742 *
3743 * @param tilingScheme - The tiling scheme used to generate the tiles.
3744 * @param elevationRangeSource - Source of elevation range data if any.
3745 * @param zoomLevels - A list of zoom levels to render.
3746 * @param dataSources - A list of data sources to render.
3747 * @returns The computation result, see [[FrustumIntersection.Result]].
3748 */
3749 compute(tilingScheme: TilingScheme, elevationRangeSource: ElevationRangeSource | undefined, zoomLevels: number[], dataSources: DataSource[]): IntersectionResult;
3750 private getTileKeyEntry;
3751 /**
3752 * Estimate screen space area of tile and distance to center of tile
3753 * @param tileBounds - The bounding volume of a tile
3754 * @return Area estimate and distance to tile center in clip space
3755 */
3756 private computeTileAreaAndDistance;
3757 /**
3758 * Create a list of root nodes to test against the frustum. The root nodes each start at level 0
3759 * and have an offset (see {@link Tile}) based on:
3760 * - the current position [[worldCenter]].
3761 * - the height of the camera above the world.
3762 * - the field of view of the camera (the maximum value between the horizontal / vertical
3763 * values)
3764 * - the tilt of the camera (because we see more tiles when tilted).
3765 *
3766 * @param worldCenter - The center of the camera in world space.
3767 */
3768 private computeRequiredInitialRootTileKeys;
3769}
3770
3771/**
3772 * `GeoBox` is used to represent a bounding box in geo coordinates.
3773 */
3774export declare class GeoBox implements GeoBoxExtentLike {
3775 readonly southWest: GeoCoordinates;
3776 readonly northEast: GeoCoordinates;
3777 /**
3778 * Returns a `GeoBox` with the given geo coordinates.
3779 *
3780 * @param southWest - The south west position in geo coordinates.
3781 * @param northEast - The north east position in geo coordinates.
3782 */
3783 static fromCoordinates(southWest: GeoCoordinates, northEast: GeoCoordinates): GeoBox;
3784 /**
3785 * Returns a `GeoBox` with the given center and dimensions.
3786 *
3787 * @param center - The center position of geo box.
3788 * @param extent - Box latitude and logitude span
3789 */
3790 static fromCenterAndExtents(center: GeoCoordinates, extent: GeoBoxExtentLike): GeoBox;
3791 /**
3792 * Constructs a new `GeoBox` with the given geo coordinates.
3793 *
3794 * @param southWest - The south west position in geo coordinates.
3795 * @param northEast - The north east position in geo coordinates.
3796 */
3797 constructor(southWest: GeoCoordinates, northEast: GeoCoordinates);
3798 /**
3799 * Returns the minimum altitude or `undefined`.
3800 */
3801 get minAltitude(): number | undefined;
3802 /**
3803 * Returns the maximum altitude or `undefined`.
3804 */
3805 get maxAltitude(): number | undefined;
3806 /**
3807 * Returns the south latitude in degrees of this `GeoBox`.
3808 */
3809 get south(): number;
3810 /**
3811 * Returns the north altitude in degrees of this `GeoBox`.
3812 */
3813 get north(): number;
3814 /**
3815 * Returns the west longitude in degrees of this `GeoBox`.
3816 */
3817 get west(): number;
3818 /**
3819 * Returns the east longitude in degrees of this `GeoBox`.
3820 */
3821 get east(): number;
3822 /**
3823 * Returns the center of this `GeoBox`.
3824 */
3825 get center(): GeoCoordinates;
3826 /**
3827 * Returns the latitude span in radians.
3828 */
3829 get latitudeSpanInRadians(): number;
3830 /**
3831 * Returns the longitude span in radians.
3832 */
3833 get longitudeSpanInRadians(): number;
3834 /**
3835 * Returns the latitude span in degrees.
3836 */
3837 get latitudeSpan(): number;
3838 get altitudeSpan(): number | undefined;
3839 /**
3840 * Returns the longitude span in degrees.
3841 */
3842 get longitudeSpan(): number;
3843 /**
3844 * Returns the latitude span in degrees.
3845 * @deprecated Use [[latitudeSpan]] instead.
3846 */
3847 get latitudeSpanInDegrees(): number;
3848 /**
3849 * Returns the longitude span in degrees.
3850 * @deprecated Use [[longitudeSpan]] instead.
3851 */
3852 get longitudeSpanInDegrees(): number;
3853 /**
3854 * Returns `true` if the given geo coordinates are contained in this `GeoBox`.
3855 *
3856 * @param point - The geo coordinates.
3857 */
3858 contains(point: GeoCoordinates): boolean;
3859 /**
3860 * Clones this `GeoBox` instance.
3861 */
3862 clone(): GeoBox;
3863 /**
3864 * Update the bounding box by considering a given point.
3865 *
3866 * @param point - The point that may expand the bounding box.
3867 */
3868 growToContain(point: GeoCoordinates): void;
3869 private containsHelper;
3870}
3871
3872/**
3873 * Represents an object that carry {@link GeoBox} extents like interface.
3874 */
3875export declare interface GeoBoxExtentLike {
3876 /**
3877 * Latitude span in degrees.
3878 */
3879 readonly latitudeSpan: number;
3880 /**
3881 * Longitude span in degrees
3882 */
3883 readonly longitudeSpan: number;
3884}
3885
3886/**
3887 * `GeoCoordinates` is used to represent geo positions.
3888 */
3889export declare class GeoCoordinates implements GeoCoordinatesLike {
3890 latitude: number;
3891 longitude: number;
3892 altitude?: number | undefined;
3893 /**
3894 * Returns a `GeoCoordinates` from the given latitude, longitude, and optional altitude.
3895 *
3896 * @param latitude - Latitude in degrees.
3897 * @param longitude - Longitude in degrees.
3898 * @param altitude - Altitude in meters.
3899 */
3900 static fromDegrees(latitude: number, longitude: number, altitude?: number): GeoCoordinates;
3901 /**
3902 * Returns a `GeoCoordinates` from the given latitude, longitude, and optional altitude.
3903 *
3904 * @param latitude - Latitude in radians.
3905 * @param longitude - Longitude in radians.
3906 * @param altitude - Altitude in meters.
3907 */
3908 static fromRadians(latitude: number, longitude: number, altitude?: number): GeoCoordinates;
3909 /**
3910 * Creates a {@link GeoCoordinates} from a {@link LatLngLike} literal.
3911 * ```typescript
3912 * const center = { lat: 53.3, lng: 13.4 };
3913 * mapView.geoCenter = GeoCoordinates.fromLatLng(center);
3914 * ```
3915 * @param latLng - A {@link LatLngLike} object literal.
3916 */
3917 static fromLatLng(latLng: LatLngLike): GeoCoordinates;
3918 /**
3919 * Creates a {@link GeoCoordinates} from a [[GeoPointLike]] tuple.
3920 *
3921 * Example:
3922 * ```typescript
3923 * mapView.geoCenter = GeoCoordinates.fromGeoPoint([longitude, latitude]);
3924 *
3925 * let geoCoords: number[] = ...;
3926 *
3927 * if (isGeoPointLike(geoCoords)) {
3928 * const p = GeoCoordinates.fromGeoPoint(geoCoords);
3929 * }
3930 * ```
3931 * @param geoPoint - An [[Array]] of at least two elements following the order
3932 * longitude, latitude, altitude.
3933 */
3934 static fromGeoPoint(geoPoint: GeoPointLike): GeoCoordinates;
3935 /**
3936 * Creates a {@link GeoCoordinates} from different types of geo coordinate objects.
3937 *
3938 * Example:
3939 * ```typescript
3940 * const fromGeoPointLike = GeoCoordinates.fromObject([longitude, latitude]);
3941 * const fromGeoCoordinateLike = GeoCoordinates.fromObject({ longitude, latitude });
3942 * const fromGeoCoordinate = GeoCoordinates.fromObject(new GeoCoordinates(latitude, longitude));
3943 * const fromLatLngLike = GeoCoordinates.fromObject({ lat: latitude , lng: longitude });
3944 * ```
3945 *
3946 * @param geoPoint - Either [[GeoPointLike]], {@link GeoCoordinatesLike}
3947 * or {@link LatLngLike} object literal.
3948 */
3949 static fromObject(geoPoint: GeoCoordLike): GeoCoordinates;
3950 /**
3951 * Creates a `GeoCoordinates` from the given latitude, longitude, and optional altitude.
3952 *
3953 * @param latitude - Latitude in degrees.
3954 * @param longitude - Longitude in degrees.
3955 * @param altitude - Altitude in meters.
3956 */
3957 constructor(latitude: number, longitude: number, altitude?: number | undefined);
3958 /**
3959 * Returns the latitude in radians.
3960 */
3961 get latitudeInRadians(): number;
3962 /**
3963 * Returns the longitude in radians.
3964 */
3965 get longitudeInRadians(): number;
3966 /**
3967 * Returns the latitude in degrees.
3968 * @deprecated Use the [[latitude]] property instead.
3969 */
3970 get latitudeInDegrees(): number;
3971 /**
3972 * Returns the longitude in degrees.
3973 * @deprecated Use the [[longitude]] property instead.
3974 */
3975 get longitudeInDegrees(): number;
3976 /**
3977 * The latitude in the degrees.
3978 */
3979 get lat(): number;
3980 /**
3981 * The longitude in the degrees.
3982 */
3983 get lng(): number;
3984 /**
3985 * Returns `true` if this `GeoCoordinates` is valid; returns `false` otherwise.
3986 */
3987 isValid(): boolean;
3988 /**
3989 * Returns the normalized `GeoCoordinates`.
3990 */
3991 normalized(): GeoCoordinates;
3992 /**
3993 * Returns `true` if this `GeoCoordinates` is equal to the other.
3994 *
3995 * @param other - GeoCoordinatesLike to compare to.
3996 */
3997 equals(other: GeoCoordinatesLike): boolean;
3998 /**
3999 * Copy values from the other.
4000 *
4001 * @param other - GeoCoordinatesLike to copy all values from.
4002 */
4003 copy(other: GeoCoordinatesLike): GeoCoordinates;
4004 /**
4005 * Clones this `GeoCoordinates`.
4006 */
4007 clone(): GeoCoordinates;
4008 /**
4009 * Returns this {@link GeoCoordinates} as {@link LatLngLike} literal.
4010 */
4011 toLatLng(): LatLngLike;
4012 /**
4013 * Converts this {@link GeoCoordinates} to a [[GeoPointLike]].
4014 */
4015 toGeoPoint(): GeoPointLike;
4016}
4017
4018/**
4019 * Represents an object with `GeoCoordinates` like interface.
4020 */
4021export declare interface GeoCoordinatesLike {
4022 /** The latitude in degrees. */
4023 latitude: number;
4024 /** The longitude in degrees. */
4025 longitude: number;
4026 /** The optional altitude in meters. */
4027 altitude?: number;
4028}
4029
4030/**
4031 * Represents an object in different geo coordinate formats
4032 */
4033export declare type GeoCoordLike = GeoPointLike | GeoCoordinatesLike | LatLngLike;
4034
4035/**
4036 * Represents a GeoJSON object.
4037 */
4038export declare type GeoJson = FeatureGeometry | GeometryCollection | Feature | FeatureCollection;
4039
4040/**
4041 * GeoJson [[DataProvider]]. Automatically handles tiling and simplification of static GeoJson.
4042 */
4043export declare class GeoJsonDataProvider implements DataProvider {
4044 readonly name: string;
4045 input: URL | GeoJson;
4046 private m_tiler;
4047 private m_registered;
4048 /**
4049 * Constructs a new `GeoJsonDataProvider`.
4050 *
4051 * @param name - Name to be used to reference this `DataProvider`
4052 * @param input - URL of the GeoJSON, or a GeoJSON.
4053 * @param options - Optional
4054 * @returns New `GeoJsonDataProvider`.
4055 */
4056 constructor(name: string, input: URL | GeoJson, options?: GeoJsonDataProviderOptions);
4057 connect(): Promise<void>;
4058 updateInput(input: URL | GeoJson): void;
4059 ready(): boolean;
4060 getTile(tileKey: TileKey): Promise<{}>;
4061}
4062
4063export declare interface GeoJsonDataProviderOptions {
4064 /**
4065 * Worker script hosting [[Tiler Service]]
4066 * @default `./decoder.bundle.ts`
4067 */
4068 workerTilerUrl?: string;
4069 /**
4070 * Custom tiler instance.
4071 * If not provided, [[GeoJsonDataProvider]] will obtain [[WorkerBasedTiler]]
4072 * from [[ConcurrentTilerFacade]].
4073 */
4074 tiler?: ITiler;
4075}
4076
4077/**
4078 * `GeoJsonDataSource` is used for the visualization of geometric objects provided in the GeoJSON
4079 * format. To be able to render GeoJSON data, a `GeoJsonDataSource` instance must be added to the
4080 * [[MapView]] instance.
4081 *
4082 * ```typescript
4083 * const geoJsonDataProvider = new GeoJsonDataProvider(
4084 * "italy",
4085 * new URL("resources/italy.json", window.location.href)
4086 * );
4087 * const geoJsonDataSource = new GeoJsonDataSource({
4088 * dataProvider: geoJsonDataProvider,
4089 * styleSetName: "geojson"
4090 * });
4091 * mapView.addDataSource(geoJsonDataSource);
4092 * ```
4093 */
4094export declare class GeoJsonDataSource extends OmvDataSource {
4095 /**
4096 * Default constructor.
4097 *
4098 * @param params - Data source configuration's parameters.
4099 */
4100 constructor(params: OmvWithRestClientParams | OmvWithCustomDataProvider);
4101}
4102
4103/**
4104 * Structured clone compliant version of a `three.js` geometry object, consisting of buffers with
4105 * metadata for map features and objects for example roads, trees or parks.
4106 */
4107export declare interface Geometry {
4108 type: GeometryType;
4109 vertexAttributes?: BufferAttribute[];
4110 interleavedVertexAttributes?: InterleavedBufferAttribute[];
4111 index?: BufferAttribute;
4112 edgeIndex?: BufferAttribute;
4113 groups: Group[];
4114 uuid?: string;
4115 /**
4116 * Optional sorted list of feature start indices. The indices point into the index attribute.
4117 * Feature i starts at featureStarts[i] and ends at featureStarts[i+1]-1, except for the last
4118 * feature, which ends at index[index.length-1].
4119 */
4120 featureStarts?: number[];
4121 /**
4122 * Optional array of objects. It can be used to pass user data from the geometry to the mesh.
4123 */
4124 objInfos?: AttributeMap[];
4125 /**
4126 * Optional [[Array]] of [[Attachment]]s.
4127 */
4128 attachments?: Attachment[];
4129}
4130
4131/**
4132 * Represents "GeometryCollection" GeoJSON geometry object.
4133 */
4134export declare interface GeometryCollection {
4135 type: "GeometryCollection";
4136 geometries: FeatureGeometry[];
4137}
4138
4139/**
4140 * Geometry kind used for use by [[BaseTechniqueParams.kind]].
4141 *
4142 * @remarks
4143 * The kind of geometry is used to group objects together,
4144 * allowing the group to be hidden or displayed.
4145 *
4146 * Any string can be used to specify the kind of the technique in a style in the theme file. Is is
4147 * suggested to specify multiple kinds for specific types of data. For a highway, the following list
4148 * of kinds is suggested:
4149 *```json
4150 * ["line", "road", "road:highway"]
4151 *```
4152 * If it is a tunnel for a highway:
4153 *```json
4154 * ["line", "road", "road:highway", "tunnel", "road:tunnel", "road:highway:tunnel"]
4155 *```
4156 * If specified in this way, specific types of data (here: highway roads) can be enabled and/or
4157 * disabled.
4158 */
4159export declare type GeometryKind = string | StandardGeometryKind;
4160
4161export declare const GeometryKind: typeof StandardGeometryKind;
4162
4163/**
4164 * A set of [[GeometryKind]]s.
4165 */
4166export declare class GeometryKindSet extends Set {
4167 /**
4168 * Return `true` if the Set is a superset of the set 'subset'.
4169 */
4170 isSuperset(subset: Set<any>): boolean;
4171 /**
4172 * Return `true` if the Set intersects Set 'set'.
4173 */
4174 hasIntersection(set: any): boolean;
4175 /**
4176 * Return `true` if the Set either intersects Set 'set' (if set is a Set), of has element 'set'
4177 * if set is not a Set.
4178 */
4179 hasOrIntersects(set: any): boolean;
4180 /**
4181 * Return `true` if this set and the array of elements share at least a single element.
4182 */
4183 hasOrIntersectsArray(subset: any[]): boolean;
4184}
4185
4186/**
4187 * Geometry types supported by [[Geometry]] objects.
4188 */
4189export declare enum GeometryType {
4190 Unspecified = 0,
4191 Point = 1,
4192 Line = 2,
4193 SolidLine = 3,
4194 Text = 4,
4195 TextPath = 5,
4196 ExtrudedLine = 6,
4197 Polygon = 7,
4198 ExtrudedPolygon = 8,
4199 Object3D = 9,
4200 Other = 1000
4201}
4202
4203/**
4204 * An [[Array]] following the order longitude, latitude, altitude.
4205 */
4206export declare type GeoPointLike = [number, number, number?];
4207
4208/**
4209 * Returns an array with the data type specified as parameter.
4210 *
4211 * @param attr - specifies which type of data is being stored in the array
4212 */
4213export declare function getArrayConstructor(attr: BufferElementType): Float32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor;
4214
4215/**
4216 * Returns a [[THREE.BufferAttribute]] created from a provided
4217 * {@link @here/harp-datasource-protocol#BufferAttribute} object.
4218 *
4219 * @param attribute - BufferAttribute a WebGL compliant buffer
4220 */
4221export declare function getBufferAttribute(attribute: BufferAttribute): THREE_2.BufferAttribute;
4222
4223/**
4224 * Compute the memory footprint of `TileFeatureData`.
4225 */
4226export declare function getFeatureDataSize(featureData: TileFeatureData): number;
4227
4228/**
4229 * @returns Feature id from the provided attribute map.
4230 */
4231export declare function getFeatureId(attributeMap: AttributeMap | undefined): number;
4232
4233/**
4234 * Determine the name of (OMV) feature. It implements the special handling required
4235 * to determine the text content of a feature from its tags, which are passed in as the `env`.
4236 *
4237 * @param env - Environment containing the tags from the (OMV) feature.
4238 * @param useAbbreviation - `true` to use the abbreviation if available.
4239 * @param useIsoCode - `true` to use the tag "iso_code".
4240 * @param languages - List of languages to use, for example: Specify "en" to use the tag "name_en"
4241 * as the text of the string. Order reflects priority.
4242 */
4243export declare function getFeatureName(env: Env, basePropName: string | undefined, useAbbreviation?: boolean, useIsoCode?: boolean, languages?: string[]): string | undefined;
4244
4245/**
4246 * Determine the text string of the map feature. It implements the special handling required
4247 * to determine the text content of a feature from its tags, which are passed in as the `env`.
4248 *
4249 * @param feature - Feature, including properties from the (OMV) feature.
4250 * @param technique - technique defining how text should be created from feature
4251 * @param languages - List of languages to use, for example: Specify "en" to use the tag "name_en"
4252 * as the text of the string. Order reflects priority.
4253 */
4254export declare function getFeatureText(context: Env | AttrEvaluationContext, technique: Technique, languages?: string[]): string | undefined;
4255
4256/**
4257 * Returns a [[MaterialConstructor]] basing on provided technique object.
4258 *
4259 * @param technique - [[Technique]] object which the material will be based on.
4260 * @param shadowsEnabled - Whether the material can accept shadows, this is required for some
4261 * techniques to decide which material to create.
4262 */
4263export declare function getMaterialConstructor(technique: Technique, shadowsEnabled: boolean): MaterialConstructor | undefined;
4264
4265/**
4266 * Returns the projection object specified in the parameter.
4267 *
4268 * @param projectionName - string describing projection to be used
4269 */
4270export declare function getProjection(projectionName: string): Projection | never;
4271
4272/**
4273 * String with the projection's name.
4274 *
4275 * @param projection - `Projection` object containing the name of the projection to retrieve
4276 */
4277export declare function getProjectionName(projection: Projection): string | never;
4278
4279/**
4280 * Get the value of the specified property in given `env`.
4281 *
4282 * @param property - Property of a technique.
4283 * @param env - The {@link Env} used to evaluate the property
4284 * @param cache - An optional expression cache.
4285 */
4286export declare function getPropertyValue(property: Value | undefined, env: Env, cache?: Map<Expr, Value>): any;
4287
4288/**
4289 * Structure containing all the required information necessary to render a BMFont glyph using
4290 * [[TextCanvas]].
4291 */
4292declare class GlyphData {
4293 readonly codePoint: number;
4294 readonly block: string;
4295 readonly width: number;
4296 readonly height: number;
4297 readonly advanceX: number;
4298 readonly offsetX: number;
4299 readonly offsetY: number;
4300 readonly texture: THREE_2.Texture;
4301 readonly font: Font;
4302 /**
4303 * Unicode character represented by this glyph.
4304 */
4305 readonly character: string;
4306 /**
4307 * Glyph' direction.
4308 */
4309 readonly direction: UnicodeUtils.Direction;
4310 /**
4311 * Array containing the positions for all corners of this glyph.
4312 */
4313 positions: THREE_2.Vector3[];
4314 /**
4315 * Array containing the source texture coordinates for all corners of this glyph.
4316 * Used to sample the original texture atlas pages.
4317 */
4318 sourceTextureCoordinates: THREE_2.Vector2[];
4319 /**
4320 * Array containing the dynamic texture coordinates for all corners of this glyph.
4321 * Used to sample the dynamic texture atlas page.
4322 */
4323 dynamicTextureCoordinates: THREE_2.Vector2[];
4324 /**
4325 * Source texture atlas' page copy index.
4326 */
4327 copyIndex: number;
4328 /**
4329 * Flag indicating if glyph can be currently rendered.
4330 */
4331 isInCache: boolean;
4332 /**
4333 * Creates a new `GlyphData` object.
4334 *
4335 * @param codePoint - Unicode code point.
4336 * @param block - Unicode block.
4337 * @param width - Glyph' width.
4338 * @param height - Glyph' height.
4339 * @param advanceX - Amount of pixel to move after placing this glyph.
4340 * @param offsetX - Horizontal offset from the glyph' origin.
4341 * @param offsetY - Vertical offset from the glyph' origin.
4342 * @param u0 - Glyph' left texture coordinate.
4343 * @param v0 - Glyph' bottom texture coordinate.
4344 * @param u1 - Glyph' right texture coordinate.
4345 * @param v1 - Glyph' top texture coordinate.
4346 * @param texture - Glyph' source texture atlas page.
4347 * @param font - Glyph' font.
4348 *
4349 * @returns New `GlyphData`.
4350 */
4351 constructor(codePoint: number, block: string, width: number, height: number, advanceX: number, offsetX: number, offsetY: number, u0: number, v0: number, u1: number, v1: number, texture: THREE_2.Texture, font: Font);
4352 /**
4353 * Clone this `GlyphData`.
4354 *
4355 * @returns Cloned `GlyphData`.
4356 */
4357 clone(): GlyphData;
4358}
4359
4360/**
4361 * Interface that defines a procedural gradient sky.
4362 */
4363export declare interface GradientSky {
4364 /** Sky type. */
4365 type: "gradient";
4366 /**
4367 * Color of the upper part of the gradient.
4368 * @format color-hex
4369 */
4370 topColor: string;
4371 /**
4372 * Color of bottom part of the gradient.
4373 * @format color-hex
4374 */
4375 bottomColor: string;
4376 /**
4377 * Color of the ground plane.
4378 * @format color-hex
4379 */
4380 groundColor: string;
4381 /** Texture's gradient power. */
4382 monomialPower?: number;
4383}
4384
4385/**
4386 * Structured clone compliant WebGL group object and its metadata.
4387 * Its purpose is to make working with groups of objects easier.
4388 */
4389export declare interface Group {
4390 start: number;
4391 count: number;
4392 technique: number;
4393 /**
4394 * Contains tile offsets if its [[Geometry]] has been created.
4395 */
4396 createdOffsets?: number[];
4397}
4398
4399/**
4400 * The `GroupedPriorityList` contains a [[PriorityListGroupMap]] to manage a larger number of items
4401 * in priority groups.
4402 */
4403declare class GroupedPriorityList<T extends PriorityListElement> {
4404 readonly groups: PriorityListGroupMap<T>;
4405 /**
4406 * Add an element to the `GroupedPriorityList`. Selects group based on the elements priority.
4407 *
4408 * @param element - Element to be added.
4409 */
4410 add(element: T): void;
4411 /**
4412 * Remove an element from the `GroupedPriorityList`.
4413 *
4414 * Note: It is required that the priority is the same as it was when the element has been added.
4415 * Otherwise, the removal will fail.
4416 *
4417 * @param element - Element to be removed.
4418 * @returns `True` if the element was removed, `false` otherwise.
4419 */
4420 remove(element: T): boolean;
4421 /**
4422 * Remove all internal {@link PriorityListGroup}s.
4423 */
4424 clear(): void;
4425 /**
4426 * Merge another {@link GroupedPriorityList} into this one.
4427 *
4428 * @param other - Other group to merge.
4429 */
4430 merge(other: GroupedPriorityList<T>): GroupedPriorityList<T>;
4431 clone(): GroupedPriorityList<T>;
4432 /**
4433 * Apply function to all elements in this `GroupedPriorityList`.
4434 *
4435 * @param {(element: T) => void} fun Function to apply.
4436 */
4437 forEach(fun: (element: T) => void): void;
4438 /**
4439 * Count the number of elements in this `GroupedPriorityList`.
4440 */
4441 count(): number;
4442 /**
4443 * Get group of elements that have the same (integer) priority.
4444 *
4445 * @param priority - The priority to retrieve all elements from.
4446 */
4447 private findGroup;
4448 /**
4449 * Get group of elements that have the same (integer) priority.
4450 *
4451 * @param priority - The priority to retrieve all elements from.
4452 */
4453 private getGroup;
4454}
4455
4456/**
4457 * A {@link SubdivisionScheme} used to represent half quadtrees.
4458 * This particular subdivision scheme is
4459 * used by the HERE tiling scheme.
4460 */
4461export declare const halfQuadTreeSubdivisionScheme: SubdivisionScheme;
4462
4463/**
4464 * A node reperesenting a `has` expression.
4465 */
4466export declare class HasAttributeExpr extends Expr {
4467 readonly name: string;
4468 constructor(name: string);
4469 /** @override */
4470 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
4471 /** @override */
4472 protected exprIsDynamic(): boolean;
4473}
4474
4475/**
4476 * Interface containing the definition of different colors to be used at different heights with the
4477 * [[TerrainTechnique]].
4478 */
4479export declare interface HeightBasedColors {
4480 heightArray: number[];
4481 colorArray: string[];
4482}
4483
4484/**
4485 * {@link TilingScheme} used by most of the data published by HERE.
4486 *
4487 * The `hereTilingScheme` features a half quadtree subdivision scheme and an equirectangular
4488 * projection.
4489 */
4490export declare const hereTilingScheme: TilingScheme;
4491
4492/**
4493 * Horizontal alignment to be used when placing text.
4494 */
4495declare enum HorizontalAlignment {
4496 Left = 0,
4497 Center = -0.5,
4498 Right = -1
4499}
4500
4501/**
4502 * Horizontal position of text element relative to the placement context (point, line).
4503 *
4504 * @note [[HorizontalPlacement]] value is exactly opposite to [[HorizontalAlignment]] value,
4505 * cause when you place text on the right side of point (or icon) it will be left-aligned.
4506 */
4507declare enum HorizontalPlacement {
4508 Left = -1,
4509 Center = -0.5,
4510 Right = 0
4511}
4512
4513export declare interface IBloomEffect {
4514 strength: number;
4515 /**
4516 * Pixel's brightness threshold between 0 and 1, from which the bloom should apply.
4517 */
4518 threshold: number;
4519 radius: number;
4520 enabled: boolean;
4521}
4522
4523declare interface IBox {
4524 minX: number;
4525 minY: number;
4526 maxX: number;
4527 maxY: number;
4528}
4529
4530/**
4531 * Interface for the Channel classes.
4532 */
4533declare interface IChannel {
4534 trace(message?: any, ...optionalParams: any[]): void;
4535 debug(message?: any, ...optionalParams: any[]): void;
4536 log(message?: any, ...optionalParams: any[]): void;
4537 info(message?: any, ...optionalParams: any[]): void;
4538 warn(message?: any, ...optionalParams: any[]): void;
4539 error(message?: any, ...optionalParams: any[]): void;
4540}
4541
4542/**
4543 * Identity {@link Projection} used to convert geo coordinates to unit coordinates and vice versa.
4544 */
4545export declare const identityProjection: Projection;
4546
4547/**
4548 * Basic interface for geometry accessors.
4549 */
4550export declare interface IGeometryAccessor {
4551 /**
4552 * Get the number of primitives (vertices of triangles).
4553 *
4554 * @returns Number of primitives.
4555 */
4556 getCount(): number;
4557 /**
4558 * Set range of primitives in this object related to one or more buffers.
4559 *
4560 * @param start - Start index in buffers.
4561 * @param end - End index in buffers (+1).
4562 */
4563 setRange(start: number, end: number): void;
4564}
4565
4566/**
4567 * Interface to access lines. Allows read access for some important attributes.
4568 */
4569export declare interface ILineAccessor {
4570 /**
4571 * Hint for the original type of geometry.
4572 */
4573 geometryType: GeometryType;
4574 /**
4575 * Get the color from materials.
4576 */
4577 color: THREE_2.Color | undefined | Array<THREE_2.Color | undefined>;
4578 /**
4579 * Get the width. May have to be reconstructed from triangulated line mesh.
4580 */
4581 width: number | undefined;
4582 /**
4583 * Render order.
4584 */
4585 renderOrder: number;
4586 /**
4587 * Helper for function `isLineAccessor`.
4588 *
4589 * @returns `true` if it is a line accessor.
4590 */
4591 isLineAccessor(): boolean;
4592 /**
4593 * Clear the object from the mesh.
4594 */
4595 clear(): void;
4596 /**
4597 * Get vertices from the object.
4598 */
4599 getVertices(): Float32Array | undefined;
4600}
4601
4602/**
4603 * Public interface for Logger class.
4604 */
4605declare interface ILogger extends IChannel {
4606 readonly name: string;
4607 enabled: boolean;
4608 level: LogLevel;
4609 /**
4610 * Update logger options
4611 *
4612 * @param {LoggerOptions} options Set logger options and configure internal logger.
4613 */
4614 update(options: LoggerOptions): void;
4615}
4616
4617/**
4618 * `ImageCache` is a singleton, so it can be used with multiple MapViews on a single page. This
4619 * allows to have an image loaded only once for multiple views. THREE is doing something similar,
4620 * but does not allow to share images that have been loaded from a canvas (which we may need to do
4621 * if we use SVG images for textures).
4622 *
4623 * One application that makes our own cache necessary is the generation of our own textures from
4624 * data that is not an URL.
4625 *
4626 * The `ImageCache` can be improved by adding satistics for memory footprint as well.
4627 */
4628export declare class ImageCache {
4629 /**
4630 * Returns the singleton `instance` of the `ImageCache`.
4631 */
4632 static get instance(): ImageCache;
4633 /**
4634 * Dispose the singleton object. Not normally implemented for singletons, but good for
4635 * debugging.
4636 */
4637 static dispose(): void;
4638 private static m_instance;
4639 private m_images;
4640 /**
4641 * Add an image definition to the global cache. Useful when the image data is already loaded.
4642 *
4643 * @param mapView - Specifiy which {@link MapView} requests the image.
4644 * @param url - URL of image.
4645 * @param imageData - Optional [ImageData]] containing the image content.
4646 */
4647 registerImage(mapView: MapView, url: string, imageData: ImageData | ImageBitmap | undefined): ImageItem;
4648 /**
4649 * Add an image definition, and optionally start loading the content.
4650 *
4651 * @param mapView - {@link MapView} requesting the image.
4652 * @param url - URL of image.
4653 * @param startLoading - Optional flag. If `true` the image will be loaded in the background.
4654 */
4655 addImage(mapView: MapView, url: string, startLoading?: boolean): ImageItem | Promise<ImageItem | undefined> | undefined;
4656 /**
4657 * Find {@link ImageItem} for the specified URL.
4658 *
4659 * @param url - URL of image.
4660 * @returns `ImageItem` for the URL if the URL is registered, `undefined` otherwise.
4661 */
4662 findImage(url: string): ImageItem | undefined;
4663 /**
4664 * Clear all {@link ImageItem}s belonging to a {@link MapView}. May remove cached items if no
4665 * {@link MapView} are registered anymore.
4666 *
4667 * @param mapView - MapView to remove all {@link ImageItem}s from.
4668 */
4669 clear(mapView: MapView): void;
4670 /**
4671 * Clear all {@link ImageItem}s from all {@link MapView}s.
4672 */
4673 clearAll(): void;
4674 /**
4675 * Returns the number of all cached {@link ImageItem}s.
4676 */
4677 get size(): number;
4678 /**
4679 * Load an {@link ImageItem}. If the loading process is already running, it returns the current
4680 * promise.
4681 *
4682 * @param imageItem - `ImageItem` containing the URL to load image from.
4683 * @returns An {@link ImageItem} if the image has already been loaded, a promise otherwise.
4684 */
4685 loadImage(imageItem: ImageItem): ImageItem | Promise<ImageItem | undefined>;
4686 /**
4687 * Find the cached {@link ImageItem} by URL.
4688 *
4689 * @param url - URL of image.
4690 */
4691 private findImageCacheItem;
4692 /**
4693 * Render the `ImageItem` by using `createImageBitmap()` or by rendering the image into a
4694 * [[HTMLCanvasElement]].
4695 *
4696 * @param imageItem - {@link ImageItem} to assign image data to.
4697 * @param image - [[HTMLImageElement]] to
4698 */
4699 private renderImage;
4700}
4701
4702/**
4703 * Define an image (e.g. icon).
4704 */
4705export declare interface ImageDefinition {
4706 /** Url to load content from. */
4707 url: string;
4708 /** `true` to start loading at init tile, `false` to lazily wait until required. */
4709 preload: boolean;
4710 /** Url of JSON file containing the texture atlas */
4711 atlas?: string;
4712}
4713
4714export declare interface ImageDefinitions {
4715 /** Name of Image. */
4716 [name: string]: ImageDefinition;
4717}
4718
4719/**
4720 * `ImageItem` is used to identify an image in the {@link ImageCache}.
4721 */
4722export declare interface ImageItem {
4723 /** URL of the image, or unique identifier. */
4724 url: string;
4725 /** Pixel data. */
4726 imageData?: ImageData | ImageBitmap;
4727 /** Mip maps for image data */
4728 mipMaps?: ImageData[];
4729 /** Turns to `true` when the data has finished loading. */
4730 loaded: boolean;
4731 /** `loadingPromise` is only used during loading/generating the image. */
4732 loadingPromise?: Promise<ImageItem | undefined>;
4733}
4734
4735export declare namespace ImageItem {
4736 /**
4737 * Missing Typedoc
4738 */
4739 export function isLoading(imageItem: ImageItem): boolean;
4740}
4741
4742/**
4743 * Available rendering parameters for the POIs.
4744 */
4745export declare interface ImageOptions {
4746 /**
4747 * The point of origin of the texture as supported in [[ImageOrigin]].
4748 */
4749 origin?: ImageOrigin;
4750 /**
4751 * Missing Typedoc
4752 */
4753 width: number;
4754 /**
4755 * Missing Typedoc
4756 */
4757 height: number;
4758 /**
4759 * Missing Typedoc
4760 */
4761 xOffset?: number;
4762 /**
4763 * Missing Typedoc
4764 */
4765 yOffset?: number;
4766 /**
4767 * Missing Typedoc
4768 */
4769 flipH?: boolean;
4770 /**
4771 * Missing Typedoc
4772 */
4773 flipV?: boolean;
4774 /**
4775 * Missing Typedoc
4776 */
4777 opacity?: number;
4778}
4779
4780/**
4781 * This enum defines the possible origin points for an image.
4782 */
4783export declare enum ImageOrigin {
4784 TopLeft = 0,
4785 BottomLeft = 1
4786}
4787
4788/**
4789 * Can be used to create a texture atlas.
4790 */
4791export declare interface ImageTexture {
4792 /** Name of ImageTexture. Used to reference texture in the styles. */
4793 name: string;
4794 /** Name of ImageDefinition to use. */
4795 image: string;
4796 /** Origin of image, defaults to "topleft" */
4797 origin?: string;
4798 /** Specify sub-region: Defaults to 0. */
4799 xOffset?: number;
4800 /** Specify sub-region: Defaults to 0. */
4801 yOffset?: number;
4802 /** Specify sub-region: Defaults to 0, meaning width is taken from loaded image. */
4803 width?: number;
4804 /** Specify sub-region: Defaults to 0, meaning height is taken from loaded image. */
4805 height?: number;
4806 /** Defaults to false. */
4807 flipH?: boolean;
4808 /** Defaults to false. */
4809 flipV?: boolean;
4810 /** Defaults to 1. */
4811 opacity?: number;
4812}
4813
4814/**
4815 * Interface for the antialias settings passed when instantiating
4816 * a {@link MapView}, and transferred to
4817 * the {@link MapRenderingManager} instance.
4818 *
4819 * @remarks
4820 * These parameters can be changed at runtime as opposed to
4821 * the native WebGL antialiasing.
4822 */
4823export declare interface IMapAntialiasSettings {
4824 /**
4825 * Whether the MSAA is enabled or not.
4826 *
4827 * @default `false`
4828 */
4829 msaaEnabled: boolean;
4830 /**
4831 * The sampling level to use for MSAA during continuous rendering.
4832 *
4833 * @default `MSAASampling.Level_1`
4834 */
4835 dynamicMsaaSamplingLevel?: MSAASampling;
4836 /**
4837 * The sampling level to use for MSAA when the rendering stops.
4838 *
4839 * @default `MSAASampling.Level_4`
4840 */
4841 staticMsaaSamplingLevel?: MSAASampling;
4842}
4843
4844/**
4845 * The `MapRenderingManager` class manages the map rendering (as opposed to text) by dispatching the
4846 * {@link MapRenderingManager.render} call to a set of internal {@link Pass} instances.
4847 *
4848 * @remarks It provides an API to modify some of the rendering
4849 * processes like the antialiasing behaviour at runtime.
4850 */
4851export declare interface IMapRenderingManager extends IPassManager {
4852 /**
4853 * Bloom effect parameters.
4854 */
4855 bloom: IBloomEffect;
4856 /**
4857 * Outline effect parameters.
4858 */
4859 outline: IOutlineEffect;
4860 /**
4861 * Vignette effect parameters.
4862 */
4863 vignette: IVignetteEffect;
4864 /**
4865 * Sepia effect parameters.
4866 */
4867 sepia: ISepiaEffect;
4868 /**
4869 * Set a `pixelRatio` for dynamic rendering (i.e. during animations). If a value is specified,
4870 * the `LowResRenderPass` will be employed to used to render the scene into a lower resolution
4871 * render target, which will then be rendered to the screen.
4872 */
4873 lowResPixelRatio?: number;
4874 /**
4875 * The level of MSAA sampling while the user interacts. It should be a low level so that the
4876 * MSAA does not impact the framerate.
4877 */
4878 dynamicMsaaSamplingLevel: MSAASampling;
4879 /**
4880 * Enable or disable the MSAA. If disabled, `MapRenderingManager` will use the renderer provided
4881 * in the {@link MapRenderingManager.render} method to render the scene.
4882 */
4883 msaaEnabled: boolean;
4884 /**
4885 * The higher level of MSAA sampling for a last frame to render, when the camera is static. It
4886 * can be a high level, providing high quality renders requiring few tens of seconds, since no
4887 * frame is expected to immediately follow in the requestAnimationFrame. It is still limited by
4888 * zooming, since zooming is not requestAnimationFrame-based and can lead to stuttering if the
4889 * render time is too long, except on desktop Mac, where mouse interaction already implements
4890 * some damping. Higher levels of sampling may lead to noticeable color banding, visible in
4891 * areas with a slight color gradient, like large areas or the sky background.
4892 */
4893 staticMsaaSamplingLevel: MSAASampling;
4894 /**
4895 * The method to call to render the map. This method depends on an `isStaticFrame` boolean that
4896 * notifies the pass manager to switch to a higher level render quality for the last frame.
4897 *
4898 * @param renderer - The ThreeJS WebGLRenderer instance to render the map with.
4899 * @param isStaticFrame - Whether the frame to render is static or dynamic. Selects level of
4900 * antialiasing.
4901 * @param time - Optional time argument provided by the requestAnimationFrame, to pass to
4902 * sub-passes.
4903 */
4904 render(renderer: THREE_2.WebGLRenderer, scene: THREE_2.Scene, camera: THREE_2.PerspectiveCamera | THREE_2.OrthographicCamera, isStaticFrame: boolean, time?: number): void;
4905 /**
4906 * Updating the outline rebuilds the outline materials of every outlined mesh.
4907 *
4908 * @param options - outline options from the {@link @here/harp-datasource-protocol#Theme}.
4909 */
4910 updateOutline(options: {
4911 thickness: number;
4912 color: string;
4913 ghostExtrudedPolygons: boolean;
4914 }): void;
4915}
4916
4917/**
4918 * Abstract base class of indexed geometry.
4919 */
4920export declare abstract class IndexedBufferedGeometryAccessor extends BufferedGeometryAccessorBase {
4921 readonly object: THREE_2.Mesh;
4922 readonly geometryType: GeometryType;
4923 protected readonly bufferGeometry: THREE_2.BufferGeometry;
4924 indices: number[];
4925 /**
4926 * Creates an abstract class `IndexedBufferedGeometryAccessor`.
4927 *
4928 * @param object - mesh to be used
4929 * @param geometryType - type of geometry
4930 * @param bufferGeometry - geometry used
4931 * @param start -
4932 * @param end -
4933 */
4934 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry, start?: number, end?: number);
4935 /**
4936 * Returns number of primitives, which is not known in this base class, so we return the number
4937 * of indices.
4938 *
4939 * @returns The number of indices in the geometry.
4940 * @override
4941 */
4942 getCount(): number;
4943 protected checkSetUp(): boolean;
4944}
4945
4946/**
4947 * Accessor for lines in an indexed geometry.
4948 */
4949export declare class IndexedBufferedGeometryLineAccessor extends IndexedBufferedGeometryAccessor implements ILineAccessor {
4950 readonly object: THREE_2.Mesh;
4951 readonly geometryType: GeometryType;
4952 readonly bufferGeometry: THREE_2.BufferGeometry;
4953 constructor(object: THREE_2.Mesh, geometryType: GeometryType, bufferGeometry: THREE_2.BufferGeometry);
4954 isLineAccessor(): boolean;
4955 /**
4956 * Reconstructs line width from triangulated geometry.
4957 *
4958 * @returns Line width.
4959 */
4960 get width(): number | undefined;
4961 clear(): void;
4962 getVertices(): Float32Array | undefined;
4963}
4964
4965/**
4966 * For efficiency, [[StyleSetEvaluator]] returns [[Techniques]] additional params as defined in
4967 * [[IndexedTechniqueParams]].
4968 */
4969export declare type IndexedTechnique = Technique & IndexedTechniqueParams;
4970
4971/**
4972 * Additional params used for optimized usage of `Techniques`.
4973 */
4974export declare interface IndexedTechniqueParams {
4975 /**
4976 * Optimization: Index into table in [[StyleSetEvaluator]] or in [[DecodedTile]].
4977 * @hidden
4978 */
4979 _index: number;
4980 /**
4981 * Optimization: Unique [[Technique]] index of [[Style]] from which technique was derived.
4982 * @hidden
4983 */
4984 _styleSetIndex: number;
4985 /**
4986 * The styleSet associated to this [[Technique]].
4987 * @hidden
4988 */
4989 _styleSet?: string;
4990 /**
4991 * The category used to assign render orders to objects created using this [[Technique]].
4992 * @hidden
4993 */
4994 _category?: string;
4995 /**
4996 * The category used to assign render orders to secondary objects
4997 * created using this [[Technique]].
4998 * @hidden
4999 */
5000 _secondaryCategory?: string;
5001 /**
5002 * `true` if any of the properties of this technique needs to access
5003 * the feature's state.
5004 *
5005 * @hidden
5006 */
5007 _usesFeatureState?: boolean;
5008 /**
5009 * Last computed state derived from [[Technique.kind]].
5010 */
5011 _kindState?: boolean;
5012}
5013
5014declare interface InstantiationContext {
5015 /**
5016 * The {@link Env} used to lookup for names.
5017 */
5018 env: Env;
5019 /**
5020 * The names to preserve during the instantiation.
5021 */
5022 preserve?: Set<string>;
5023}
5024
5025/**
5026 * Structured clone compliant WebGL interleaved buffer with its metadata attached.
5027 */
5028export declare interface InterleavedBufferAttribute {
5029 buffer: ArrayBufferLike;
5030 stride: number;
5031 type: BufferElementType;
5032 attributes: Array<{
5033 name: string;
5034 itemSize: number;
5035 offset: number;
5036 }>;
5037}
5038
5039/**
5040 * Simplest camera clip planes evaluator, interpolates near/far planes based on ground distance.
5041 *
5042 * At general ground distance to camera along the surface normal is used as reference point for
5043 * planes evaluation, where near plane distance is set as fraction of this distance refereed as
5044 * [[nearMultiplier]]. Far plane equation has its own multiplier - [[nearFarMultiplier]],
5045 * which is applied to near plane and offset giving finally far plane distance.
5046 * This evaluator supports both planar and spherical projections, although it's behavior is
5047 * slightly different in each case. General algorithm sets near plane between camera and
5048 * ground level, while far plane is just calculated using scale and bias approach with far offset
5049 * and multiplier.
5050 * @deprecated Class contains the legacy (first and original) clip planes evaluation method, which
5051 * is widely used in examples thus is still kept for backward compatibility and comparisons.
5052 */
5053export declare class InterpolatedClipPlanesEvaluator implements ClipPlanesEvaluator {
5054 readonly nearMin: number;
5055 readonly nearMultiplier: number;
5056 readonly nearFarMultiplier: number;
5057 readonly farOffset: number;
5058 readonly farMin: number;
5059 protected m_tmpVectors: THREE_2.Vector3[];
5060 protected m_tmpQuaternion: THREE_2.Quaternion;
5061 constructor(nearMin?: number, nearMultiplier?: number, nearFarMultiplier?: number, farOffset?: number);
5062 set minElevation(elevation: number);
5063 get minElevation(): number;
5064 set maxElevation(elevation: number);
5065 get maxElevation(): number;
5066 evaluateClipPlanes(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
5067}
5068
5069/**
5070 * Interpolated property could have its value (some initial value should be provided) changed
5071 * according to an interpolation type.
5072 *
5073 * Here is an example of an interpolated property from a map style:
5074 * "lineWidth": {
5075 * "interpolation": "Linear",
5076 * "zoomLevels": [13, 14, 15],
5077 * "values": [ 1.5, 1.2, 0.9]
5078 * }
5079 * @internal
5080 */
5081export declare interface InterpolatedPropertyDefinition<T> {
5082 interpolation?: "Discrete" | "Linear" | "Cubic" | "Exponential";
5083 zoomLevels: number[];
5084 values: T[];
5085 exponent?: number;
5086}
5087
5088/**
5089 * Converts an [[InterpolatedPropertyDefinition]] to a [[JsonExpr]].
5090 *
5091 * @param property - A valid [[InterpolatedPropertyDefinition]]
5092 */
5093export declare function interpolatedPropertyDefinitionToJsonExpr(property: InterpolatedPropertyDefinition<any>): JsonExpr;
5094
5095/**
5096 * A node representing an `interpolate` expression.
5097 */
5098export declare class InterpolateExpr extends Expr {
5099 readonly mode: InterpolateMode;
5100 readonly input: Expr;
5101 readonly stops: Array<[number, Expr]>;
5102 constructor(mode: InterpolateMode, input: Expr, stops: Array<[number, Expr]>);
5103 /** @override */
5104 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
5105 /** @override */
5106 protected exprIsDynamic(): boolean;
5107}
5108
5109/**
5110 * The type of the interpolation mode.
5111 */
5112export declare type InterpolateMode = ["discrete"] | ["linear"] | ["cubic"] | ["exponential", number];
5113
5114/**
5115 * Interpolation mode used when computing a [[InterpolatedProperty]] value for a given zoom level.
5116 * @internal
5117 */
5118export declare enum InterpolationMode {
5119 Discrete = 0,
5120 Linear = 1,
5121 Cubic = 2,
5122 Exponential = 3
5123}
5124
5125/**
5126 * Result of frustum intersection
5127 */
5128declare interface IntersectionResult {
5129 /**
5130 * Tiles intersected by the frustum per zoom level.
5131 */
5132 readonly tileKeyEntries: ZoomLevelTileKeyMap;
5133 /**
5134 * True if the intersection was calculated using precise elevation data, false if it's an
5135 * approximation.
5136 */
5137 calculationFinal: boolean;
5138}
5139
5140/**
5141 * Accessor for unspecified 3D objects, like landmarks.
5142 */
5143export declare interface IObject3dAccessor {
5144 /**
5145 * Hint for the original type of geometry.
5146 */
5147 geometryType: GeometryType;
5148 /**
5149 * Get the color from materials.
5150 */
5151 color: THREE_2.Color | undefined | Array<THREE_2.Color | undefined>;
5152 /**
5153 * Render order.
5154 */
5155 renderOrder: number;
5156 /**
5157 * Helper for function `isObject3dAccessor`.
5158 *
5159 * @returns `true` if it is a line accessor.
5160 */
5161 isObject3dAccessor(): boolean;
5162 /**
5163 * Clear the object from the mesh.
5164 */
5165 clear(): void;
5166 getVertices(): Float32Array | undefined;
5167}
5168
5169export declare interface IOutlineEffect {
5170 enabled: boolean;
5171 /**
5172 * Make the extruded polygon disappear.
5173 */
5174 ghostExtrudedPolygons: boolean;
5175 thickness: number;
5176 color: string;
5177}
5178
5179/**
5180 * The interface for the {@link Pass} class.
5181 */
5182export declare interface IPass {
5183 /**
5184 * Whether the {@link Pass} instance is active or not.
5185 * @default `true`.
5186 */
5187 enabled: boolean;
5188 /**
5189 * Whether the render method should target a WebGLRenderTarget instance, or the frame buffer.
5190 * @default `false`.
5191 */
5192 renderToScreen: boolean;
5193 /**
5194 * The resize method to extend in {@link Pass} implementations.
5195 *
5196 * @remarks
5197 * It resizes the render targets. Call on resize events.
5198 *
5199 * @param width - Width to resize to.
5200 * @param height - Height to resize to.
5201 */
5202 setSize(width: number, height: number): void;
5203 /**
5204 * The render method to extend in {@link Pass} implementations.
5205 *
5206 * @remarks
5207 * This is the place where the desired
5208 * effects or render operations are executed.
5209 *
5210 * @param renderer - The WebGLRenderer instance in use.
5211 * @param scene - The scene to render.
5212 * @param camera - The camera to render the scene through.
5213 * @param writeBuffer - The optional WebGLRenderTarget instance to write to.
5214 * @param readBuffer - The optional WebGLRenderTarget instance of a previous pass to write onto.
5215 * @param delta - The time argument from the requestAnimationFrame.
5216 */
5217 render(renderer: THREE_2.WebGLRenderer, scene: THREE_2.Scene, camera: THREE_2.Camera, writeBuffer: THREE_2.WebGLRenderTarget | null, readBuffer: THREE_2.WebGLRenderTarget | null, delta?: number): void;
5218}
5219
5220/**
5221 * `IPassManager` provides a base interface for {@link Pass}
5222 * managers like {@link MapRenderingManager}.
5223 */
5224export declare interface IPassManager {
5225 /**
5226 * The render method to extend in `IPassManager`'s implementations. This is the place where the
5227 * desired setups and effect composing and chaining happen.
5228 */
5229 render(renderer: THREE_2.WebGLRenderer, ...args: any[]): void;
5230 /**
5231 * The resize method to extend in {@link Pass} implementations
5232 * to resize the render targets to match
5233 * the size of the visible canvas. It should be called on resize events.
5234 *
5235 * @param width - Width to resize to.
5236 * @param height - Height to resize to.
5237 */
5238 setSize(width: number, height: number): void;
5239}
5240
5241export declare function isActualSelectorDefinition(def: Definition): def is Style & StyleSelector;
5242
5243/**
5244 * Type guard to check if an object is an instance of [[BasicExtrudedLineTechnique]].
5245 */
5246export declare function isBasicExtrudedLineTechnique(technique: Technique): technique is BasicExtrudedLineTechnique;
5247
5248/**
5249 * Returns true if the given object implements the {@link Box3Like} interface.
5250 *
5251 * @param object - A valid object.
5252 */
5253export declare function isBox3Like(object: {}): object is Box3Like;
5254
5255/**
5256 * Checks if the given definition implements the [[BoxedDefinition]] interface.
5257 */
5258export declare function isBoxedDefinition(def: Definition): def is BoxedDefinition;
5259
5260/**
5261 * Type guard to check if an object is an instance of [[CirclesTechnique]].
5262 */
5263export declare function isCirclesTechnique(technique: Technique): technique is CirclesTechnique;
5264
5265export declare interface ISepiaEffect {
5266 enabled: boolean;
5267 amount: number;
5268}
5269
5270/**
5271 * Type guard to check if an object is an instance of [[BasicExtrudedLineTechnique]]
5272 * or [[StandardExtrudedLineTechnique]].
5273 */
5274export declare function isExtrudedLineTechnique(technique: Technique): technique is BasicExtrudedLineTechnique | StandardExtrudedLineTechnique;
5275
5276/**
5277 * Type guard to check if an object is an instance of [[ExtrudedPolygonTechnique]].
5278 */
5279export declare function isExtrudedPolygonTechnique(technique: Technique): technique is ExtrudedPolygonTechnique;
5280
5281/**
5282 * Type guard to check if an object is an instance of [[FillTechnique]].
5283 */
5284export declare function isFillTechnique(technique: Technique): technique is FillTechnique;
5285
5286/**
5287 * Type guard to assert that `object` conforms to {@link GeoBoxExtentLike} interface.
5288 */
5289export declare function isGeoBoxExtentLike(obj: any): obj is GeoBoxExtentLike;
5290
5291/**
5292 * Type guard to assert that `object` conforms to {@link GeoCoordinatesLike} data interface.
5293 */
5294export declare function isGeoCoordinatesLike(object: any): object is GeoCoordinatesLike;
5295
5296/**
5297 * Type guard to assert that `object` conforms to [[GeoPointLike]] interface.
5298 */
5299export declare function isGeoPointLike(geoPoint: any): geoPoint is GeoPointLike;
5300
5301/**
5302 * Refinement of `console` interface only for important information i.e `info`, `warn` and `errors`.
5303 */
5304declare interface ISimpleChannel {
5305 info(message?: any, ...optionalParams: any[]): void;
5306 warn(message?: any, ...optionalParams: any[]): void;
5307 error(message?: any, ...optionalParams: any[]): void;
5308}
5309
5310/**
5311 * Checks if a property is interpolated.
5312 * @param p - property to be checked
5313 * @internal
5314 */
5315export declare function isInterpolatedPropertyDefinition<T>(p: any): p is InterpolatedPropertyDefinition<T>;
5316
5317export declare function isJsonExpr(v: any): v is JsonExpr;
5318
5319/**
5320 * Checks if the given value is a reference to a definition.
5321 *
5322 * @param value - The value of a technique property.
5323 */
5324export declare function isJsonExprReference(value: any): value is JsonExprReference;
5325
5326export declare function isLabelRejectionLineTechnique(technique: Technique): technique is LabelRejectionLineTechnique;
5327
5328/**
5329 * Type guard to assert that `object` conforms to {@link LatLngLike} interface.
5330 */
5331export declare function isLatLngLike(object: any): object is LatLngLike;
5332
5333/**
5334 * Helper function to check if an accessor is of type `ILineAccessor`.
5335 *
5336 * @param arg - `true` if `arg` is `ILineAccessor`.
5337 */
5338export declare function isLineAccessor(arg: any): arg is ILineAccessor;
5339
5340/**
5341 * Type guard to check if an object is an instance of [[LineMarkerTechnique]].
5342 */
5343export declare function isLineMarkerTechnique(technique: Technique): technique is LineMarkerTechnique;
5344
5345/**
5346 * Type guard to check if an object is an instance of [[LineTechnique]].
5347 */
5348export declare function isLineTechnique(technique: Technique): technique is LineTechnique;
5349
5350export declare function isLiteralDefinition(def: Definition): def is LiteralValue;
5351
5352/**
5353 * Helper function to check if an accessor is of type `IObject3dAccessor`.
5354 *
5355 * @param arg - `true` if `arg` is `IObject3dAccessor`.
5356 */
5357export declare function isObject3dAccessor(arg: any): arg is IObject3dAccessor;
5358
5359/**
5360 * Returns true if the given object implements the interface {@link OrientedBox3Like}.
5361 *
5362 * @param object - The object.
5363 */
5364export declare function isOrientedBox3Like(object: {}): object is OrientedBox3Like;
5365
5366/**
5367 * Type guard to check if an object is an instance of [[PoiTechnique]].
5368 */
5369export declare function isPoiTechnique(technique: Technique): technique is PoiTechnique;
5370
5371/**
5372 * Check if technique requires (and not disables) use of depth prepass.
5373 *
5374 * Depth prepass is enabled if correct opacity is specified (in range `(0,1)`) _and_ not explicitly
5375 * disabled by `enableDepthPrePass` option.
5376 *
5377 * @param technique - [[BaseStandardTechnique]] instance to be checked
5378 * @param env - {@link @here/harp-datasource-protocol#Env} instance used
5379 * to evaluate {@link @here/harp-datasource-protocol#Expr}
5380 * based properties of [[Technique]]
5381 */
5382export declare function isRenderDepthPrePassEnabled(technique: ExtrudedPolygonTechnique, env: Env): boolean;
5383
5384/**
5385 * Type guard to check if an object is an instance of [[SegmentsTechnique]].
5386 */
5387export declare function isSegmentsTechnique(technique: Technique): technique is SegmentsTechnique;
5388
5389/**
5390 * Type guard to check if an object is an instance of [[ShaderTechnique]].
5391 */
5392export declare function isShaderTechnique(technique: Technique): technique is ShaderTechnique;
5393
5394/**
5395 * Type guard to check if an object is an instance of [[SolidLineTechnique]].
5396 */
5397export declare function isSolidLineTechnique(technique: Technique): technique is SolidLineTechnique;
5398
5399/**
5400 * Type guard to check if an object is an instance of [[SolidLineTechnique]] and is a kind that
5401 * has special dashes.
5402 * @note Lines with special dashes need line caps to render properly.
5403 */
5404export declare function isSpecialDashesLineTechnique(technique: Technique): technique is SolidLineTechnique;
5405
5406/**
5407 * Type guard to check if an object is an instance of [[SquaresTechnique]].
5408 */
5409export declare function isSquaresTechnique(technique: Technique): technique is SquaresTechnique;
5410
5411/**
5412 * Type guard to check if an object is an instance of [[StandardExtrudedLineTechnique]].
5413 */
5414export declare function isStandardExtrudedLineTechnique(technique: Technique): technique is StandardExtrudedLineTechnique;
5415
5416/**
5417 * Type guard to check if an object is an instance of [[StandardTechnique]].
5418 */
5419export declare function isStandardTechnique(technique: Technique): technique is StandardTechnique;
5420
5421/**
5422 * Type guard to check if an object is an instance of [[TerrainTechnique]].
5423 */
5424export declare function isTerrainTechnique(technique: Technique): technique is TerrainTechnique;
5425
5426/**
5427 * Type guard to check if an object is an instance of [[TextTechnique]].
5428 */
5429export declare function isTextTechnique(technique: Technique): technique is TextTechnique;
5430
5431/**
5432 * Type guard to check if an object is an instance of `TextureBuffer`.
5433 */
5434export declare function isTextureBuffer(object: any): object is TextureBuffer;
5435
5436/**
5437 * Returns true if the given object implements the interface {@link TransformLike}.
5438 *
5439 * @param object - The object.
5440 */
5441export declare function isTransformLike(object: {}): object is TransformLike;
5442
5443export declare function isVector3Like(v: any): v is Vector3Like;
5444
5445/**
5446 * Interface for a client visitor that is used to visit all `THREE.Object`s in a tile.
5447 */
5448export declare interface ITileDataVisitor {
5449 tile: Tile;
5450 /**
5451 * Should return `true` if the visitor wants to visit the object with the specified
5452 * `featureId`. This function is called before the type of the object is even known.
5453 */
5454 wantsFeature(featureId: number | undefined): boolean;
5455 /**
5456 * Should return `true` if the visitor wants to visit the point with the specified
5457 * `featureId`.
5458 */
5459 wantsPoint(featureId: number | undefined): boolean;
5460 /**
5461 * Should return `true` if the visitor wants to visit the line with the specified
5462 * `featureId`.
5463 */
5464 wantsLine(featureId: number | undefined): boolean;
5465 /**
5466 * Should return `true` if the visitor wants to visit the area object with the specified
5467 * `featureId`.
5468 */
5469 wantsArea(featureId: number | undefined): boolean;
5470 /**
5471 * Should return `true` if the visitor wants to visit the object with the specified
5472 * `featureId`.
5473 */
5474 wantsObject3D(featureId: number | undefined): boolean;
5475 /**
5476 * Visits a point object with the specified `featureId`; use `pointAccessor` to get the
5477 * object's properties.
5478 */
5479 visitPoint(featureId: number | undefined): void;
5480 /**
5481 * Visits a line object with the specified `featureId`; use `pointAccessor` to get the
5482 * object's properties.
5483 */
5484 visitLine(featureId: number | undefined, lineAccessor: ILineAccessor): void;
5485 /**
5486 * Visit an area object with the specified `featureId`; use `pointAccessor` to get the
5487 * object's properties.
5488 */
5489 visitArea(featureId: number | undefined): void;
5490 /**
5491 * Visits a 3D object with the specified `featureId`; use `pointAccessor` to get the
5492 * object's properties.
5493 */
5494 visitObject3D(featureId: number | undefined, object3dAccessor: IObject3dAccessor): void;
5495}
5496
5497/**
5498 * General type decoder which can be used to provide decoded tile data.
5499 */
5500export declare interface ITileDecoder {
5501 /**
5502 * Connect to decoder.
5503 *
5504 * Should be implemented by implementations that use special resources that decode jobs like
5505 * WebWorkers.
5506 */
5507 connect(): Promise<void>;
5508 /**
5509 * Decode tile into transferrable geometry.
5510 *
5511 * Decode raw tile data (encoded with datasource specific encoding) into transferrable
5512 * representation of tile's geometry.
5513 *
5514 * See [[DecodedTile]].
5515 */
5516 decodeTile(data: ArrayBufferLike | {}, tileKey: TileKey, projection: Projection, requestController?: RequestController): Promise<DecodedTile>;
5517 /**
5518 * Get tile info.
5519 *
5520 * Get map features metadata associated with tile. See [[TileInfo]].
5521 */
5522 getTileInfo(data: ArrayBufferLike | {}, tileKey: TileKey, projection: Projection, requestController?: RequestController): Promise<TileInfo | undefined>;
5523 /**
5524 * Set decoder configuration.
5525 *
5526 * Configuration will take effect for next calls to results of [[decodeTile]],
5527 * [[decodeThemedTile]].
5528 *
5529 * Non-existing (`undefined`) options (including styleSet) are not changed.
5530 *
5531 * @param styleSet - optional, new style set.
5532 * @param definitions - optional, definitions used to resolve references in `styleSet`
5533 * @param languages - optional, language list
5534 * @param options - optional, new options - shape is specific for each decoder
5535 */
5536 configure(styleSet?: StyleSet, definitions?: Definitions, languages?: string[], options?: OptionsMap): void;
5537 /**
5538 * Free all resources associated with this decoder.
5539 *
5540 * Called by users when decoder is no longer used and all resources must be freed.
5541 */
5542 dispose(): void;
5543}
5544
5545export declare interface ITileLoader {
5546 state: TileLoaderState;
5547 payload?: ArrayBufferLike | {};
5548 decodedTile?: DecodedTile;
5549 isFinished: boolean;
5550 loadAndDecode(): Promise<TileLoaderState>;
5551 waitSettled(): Promise<TileLoaderState>;
5552 updatePriority(area: number): void;
5553 cancel(): void;
5554}
5555
5556/**
5557 * General type tiler which can be used to provide tile untiled payloads.
5558 */
5559export declare interface ITiler {
5560 /**
5561 * Connect to tiler.
5562 *
5563 * Should be implemented by implementations that use special resources that decode jobs like
5564 * WebWorkers.
5565 */
5566 connect(): Promise<void>;
5567 /**
5568 * Register index in the tiler. Indexes registered in the tiler can be later used to retrieved
5569 * tiled payloads using `getTile`.
5570 *
5571 * @param indexId - Index identifier.
5572 * @param indexUrl - Url to the index payload, or direct GeoJson.
5573 */
5574 registerIndex(indexId: string, indexUrl: URL | GeoJson): Promise<void>;
5575 /**
5576 * Update index in the tiler. Indexes registered in the tiler can be later used to retrieved
5577 * tiled payloads using `getTile`.
5578 *
5579 * @param indexId - Index identifier.
5580 * @param indexUrl - Url to the index payload, or direct GeoJson.
5581 */
5582 updateIndex(indexId: string, indexUrl: URL | GeoJson): Promise<void>;
5583 /**
5584 * Retrieves a tile for a previously registered index.
5585 *
5586 * @param indexId - Index identifier.
5587 * @param tileKey - The [[TileKey]] that identifies the tile.
5588 */
5589 getTile(indexId: string, tileKey: TileKey): Promise<{}>;
5590 /**
5591 * Free all resources associated with this tiler.
5592 *
5593 * Called by users when decoder is no longer used and all resources must be freed.
5594 */
5595 dispose(): void;
5596}
5597
5598/**
5599 * Abstract interface for a transfer manager.
5600 *
5601 * Provides functionality for downloading JSON or ArrayBuffers.
5602 * Implementations typically implement retry on server congestion,
5603 * limit the maximum amount of parallel downloads or merge duplicate
5604 * downloads.
5605 */
5606declare interface ITransferManager {
5607 /**
5608 * Downloads a JSON object.
5609 * @param url - The URL to download
5610 * @param init - Optional extra parameters for the download.
5611 */
5612 downloadJson<T>(url: RequestInfo, init?: RequestInit): Promise<T>;
5613 /**
5614 * Downloads a binary object.
5615 * @param url - The URL to download
5616 * @param init - Optional extra parameters for the download
5617 */
5618 downloadArrayBuffer(url: RequestInfo, init?: RequestInit): Promise<ArrayBuffer>;
5619 /**
5620 * Downloads a URL and returns the response.
5621 * @param url - The URL to download.
5622 * @param init - Optional extra parameters for the download.
5623 */
5624 download(url: RequestInfo, init?: RequestInit): Promise<Response>;
5625}
5626
5627export declare interface IVignetteEffect {
5628 enabled: boolean;
5629 offset: number;
5630 darkness: number;
5631}
5632
5633/**
5634 * A type representing JSON arrays.
5635 */
5636export declare interface JsonArray extends Array<JsonValue> {
5637}
5638
5639/**
5640 * The JSON representation of an {@link Expr} object.
5641 */
5642export declare type JsonExpr = JsonArray;
5643
5644export declare type JsonExprReference = ["ref", string];
5645
5646/**
5647 * A type representing JSON objects.
5648 */
5649export declare interface JsonObject {
5650 [name: string]: JsonValue;
5651}
5652
5653/**
5654 * A type represeting JSON values.
5655 */
5656export declare type JsonValue = null | boolean | number | string | JsonObject | JsonArray;
5657
5658export declare type LabelRejectionLineStyle = BaseStyle<"label-rejection-line", BaseTechniqueParams>;
5659
5660/**
5661 * Technique to avoid label rendering on top of certain line geometries.
5662 * For technique parameters see [[BaseTechniqueParams]].
5663 */
5664export declare interface LabelRejectionLineTechnique extends MakeTechniqueAttrs<BaseTechniqueParams> {
5665 name: "label-rejection-line";
5666}
5667
5668/**
5669 * Represents an object with `LatLng` like interface.
5670 */
5671export declare interface LatLngLike {
5672 /** The latitude in degrees. */
5673 lat: number;
5674 /** The longitude in degrees. */
5675 lng: number;
5676}
5677
5678/**
5679 * Possible lights used for light the map.
5680 */
5681export declare type Light = AmbientLight | DirectionalLight;
5682
5683/**
5684 * Available line caps types(`"None"`, `"Round"`, `"Square"`, `"TriangleOut"`, `"TriangleIn"`).
5685 * Default is `"Round"`.
5686 */
5687export declare type LineCaps = "Square" | "Round" | "None" | "TriangleOut" | "TriangleIn";
5688
5689/**
5690 * Available line dash types(`"Round"`, `"Square"`, `"Diamond"`).
5691 * Default is `"Square"`.
5692 */
5693export declare type LineDashes = "Square" | "Round" | "Diamond";
5694
5695/**
5696 * Class used to render groups (or batches) of width-variable lines (in the same tile).
5697 */
5698declare class LineGroup {
5699 readonly hasNormalsAndUvs: boolean;
5700 readonly highPrecision: boolean;
5701 readonly isSimple: boolean;
5702 /**
5703 * Adds all the attribute data needed to a [[BufferGeometry]] object for rendering `Lines`.
5704 *
5705 * @param vertices - Array of vertex attributes.
5706 * @param colors - Array of vertex colors.
5707 * @param indices - Array of vertex indices.
5708 * @param geometry - [[BufferGeometry]] object which will store all the `Lines` attribute data.
5709 * @param hasNormalsAnUvs - Whether vertices have normal and uv coordinates as attributes.
5710 * @param highPrecision - If `true` will create high-precision vertex information.
5711 * @param isSimple - `true` to create simple (nonsolid, nonextruded) lines. Defaults to `false`.
5712 */
5713 static createGeometry(vertices: ArrayLike<number>, colors: ArrayLike<number>, indices: ArrayLike<number>, geometry: THREE_2.BufferGeometry, hasNormalsAndUvs?: boolean, highPrecision?: boolean, isSimple?: boolean): THREE_2.BufferGeometry;
5714 private readonly m_geometry;
5715 constructor(hasNormalsAndUvs?: boolean, highPrecision?: boolean, isSimple?: boolean);
5716 /**
5717 * Clears the list of line strips.
5718 */
5719 clear(): void;
5720 /**
5721 * Add the given points to this line group.
5722 *
5723 * @param center - World center of the provided points.
5724 * @param points - Sequence of (x,y,z) coordinates.
5725 * @param offsets - Sequence of line segment offsets.
5726 * @param uvs - Sequence of (u,v) texture coordinates.
5727 * @param colors - Sequence of (r,g,b) color components.
5728 */
5729 add(center: THREE_2.Vector3, points: ArrayLike<number>, projection: Projection, offsets?: ArrayLike<number>, uvs?: ArrayLike<number>, colors?: ArrayLike<number>): this;
5730 /**
5731 * Returns the list of vertices.
5732 */
5733 get vertices(): number[];
5734 /**
5735 * Returns the list of vertex colors.
5736 */
5737 get vertexColors(): number[];
5738 /**
5739 * Returns the list of indices.
5740 */
5741 get indices(): number[];
5742 /**
5743 * Returns the list of [[VertexAttributeDescriptor]]s.
5744 */
5745 get vertexAttributes(): VertexAttributeDescriptor[];
5746 /**
5747 * Returns the vertex attribute stride.
5748 */
5749 get stride(): number;
5750 /**
5751 * Creates a three.js geometry.
5752 */
5753 createGeometry(geometry?: THREE_2.BufferGeometry): THREE_2.BufferGeometry;
5754}
5755
5756/**
5757 * Render feature as line markers, which is a recurring marker along a line (usually road).
5758 *
5759 * @see [[MarkerTechniqueParams]].
5760 */
5761export declare type LineMarkerStyle = BaseStyle<"line-marker", MarkerTechniqueParams>;
5762
5763/**
5764 * Runtime representation of [[LineMarkerStyle]] as parsed by [[StyleSetEvaluator]].
5765 * For technique parameters see [[MarkerTechniqueParams]].
5766 */
5767export declare interface LineMarkerTechnique extends MakeTechniqueAttrs<MarkerTechniqueParams> {
5768 name: "line-marker";
5769}
5770
5771export declare interface LinesGeometry {
5772 type: GeometryType;
5773 lines: LineGroup;
5774 technique: number;
5775 /**
5776 * Optional array of objects. It can be used to pass user data from the geometry to the mesh.
5777 */
5778 objInfos?: AttributeMap[];
5779 /**
5780 * Optional list of feature start indices. The indices point into the index attribute.
5781 */
5782 featureStarts?: number[];
5783}
5784
5785/**
5786 * Represents "LineString" GeoJSON geometry object.
5787 */
5788export declare interface LineString {
5789 type: "LineString";
5790 coordinates: number[][];
5791}
5792
5793/**
5794 * Render feature as line.
5795 */
5796export declare type LineStyle = BaseStyle<"line", LineTechniqueParams>;
5797
5798/**
5799 * Runtime representation of [[LineStyle]] as parsed by [[StyleSetEvaluator]].
5800 * For technique parameters see [[LineTechniqueParams]].
5801 */
5802export declare interface LineTechnique extends MakeTechniqueAttrs<LineTechniqueParams> {
5803 name: "line";
5804}
5805
5806/** @internal */
5807export declare const lineTechniqueDescriptor: TechniqueDescriptor<LineTechnique>;
5808
5809export declare interface LineTechniqueParams extends BaseTechniqueParams {
5810 /**
5811 * Color of a line in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
5812 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
5813 * @format color-hex
5814 */
5815 color: DynamicProperty<StyleColor>;
5816 /**
5817 * Set to true if line should appear transparent. Rendering transparent lines may come with a
5818 * slight performance impact.
5819 */
5820 transparent?: boolean;
5821 /**
5822 * For transparent lines, set a value between 0.0 for totally transparent, to 1.0 for totally
5823 * opaque.
5824 */
5825 opacity?: DynamicProperty<number>;
5826 /**
5827 * Width of line in pixels. WebGL implementations will normally render all lines with 1 pixel
5828 * width, and ignore this value.
5829 */
5830 lineWidth: DynamicProperty<number>;
5831}
5832
5833/**
5834 * A node representing a `literal` expression.
5835 */
5836export declare abstract class LiteralExpr extends Expr {
5837 /**
5838 * Create a [[LiteralExpr]] from the given value.
5839 *
5840 * @param value - A constant value.
5841 */
5842 static fromValue(value: Value): Expr;
5843 abstract get value(): Value;
5844 /** @override */
5845 protected exprIsDynamic(): boolean;
5846}
5847
5848/**
5849 * Possible types of unboxed literal values carried by [[Definition]].
5850 */
5851export declare type LiteralValue = string | number | boolean;
5852
5853/**
5854 * State of loading.
5855 */
5856export declare enum LoadingState {
5857 Requested = 0,
5858 Loaded = 1,
5859 Initialized = 2
5860}
5861
5862/**
5863 * Logger options to configure logger
5864 */
5865declare class LoggerOptions {
5866 enabled?: boolean;
5867 level?: LogLevel;
5868}
5869
5870/**
5871 * Enum log levels
5872 */
5873declare enum LogLevel {
5874 Trace = 0,
5875 Debug = 1,
5876 Log = 2,
5877 Info = 3,
5878 Warn = 4,
5879 Error = 5
5880}
5881
5882/**
5883 * Parameters for {@link (MapView.lookAt:WITH_PARAMS)}.
5884 */
5885export declare interface LookAtParams {
5886 /**
5887 * Target/look at point of the MapView.
5888 *
5889 * @note If the given point is not on the ground (altitude != 0) {@link MapView} will do a
5890 * raycasting internally to find a target on the ground.
5891 *
5892 * As a consequence {@link MapView.target} and {@link MapView.zoomLevel}
5893 * will not match the values
5894 * that were passed into the {@link (MapView.lookAt:WITH_PARAMS)} method.
5895 * @default `new GeoCoordinates(25, 0)` in {@link MapView.constructor} context.
5896 * @default {@link MapView.target} in {@link (MapView.lookAt:WITH_PARAMS)} context.
5897 */
5898 target: GeoCoordLike;
5899 /**
5900 * Fit MapView to these boundaries.
5901 *
5902 * If specified, `zoomLevel` and `distance` parameters are ignored and `lookAt` calculates best
5903 * `zoomLevel` to fit given bounds.
5904 *
5905 * * if `bounds` is {@link @here/harp-geoutils#GeoBox}, then `lookAt`
5906 * use {@link LookAtParams.target} or `bounds.target` and
5907 * ensure whole box is visible
5908 *
5909 * * if `bounds` is {@link @here/harp-geoutils#GeoBoxExtentLike},
5910 * then `lookAt` will use {@link LookAtParams.target} or
5911 * current {@link MapView.target} and ensure whole extents are visible
5912 *
5913 * * if `bounds` is [[GeoCoordLike]][], then `lookAt` will use {@link LookAtParams.target} or
5914 * calculated `target` as center of world box covering given points and ensure all points are
5915 * visible
5916 *
5917 * Note in sphere projection some points are not visible if you specify bounds that span more
5918 * than 180 degreess in any direction.
5919 *
5920 * @see {@link (MapView.lookAt:WITH_PARAMS)} for defails how `bounds`
5921 * interact with `target` parameter
5922 */
5923 bounds: GeoBox | GeoBoxExtentLike | GeoCoordLike[];
5924 /**
5925 * Camera distance to the target point in world units.
5926 * @default zoomLevel defaults will be used if not set.
5927 */
5928 distance: number;
5929 /**
5930 * Zoomlevel of the MapView.
5931 * @note Takes precedence over distance.
5932 * @default 5 in {@link MapView.constructor} context.
5933 * @default {@link MapView.zoomLevel} in {@link (MapView.lookAt:WITH_PARAMS)} context.
5934 */
5935 zoomLevel: number;
5936 /**
5937 * Tilt angle in degrees. 0 is top down view.
5938 * @default 0 in {@link MapView.constructor} context.
5939 * @default {@link MapView.tilt} in {@link (MapView.lookAt:WITH_PARAMS)} context.
5940 * @note Maximum supported tilt is 89°
5941 */
5942 tilt: number;
5943 /**
5944 * Heading angle in degrees and clockwise. 0 is north-up.
5945 * @default 0 in {@link MapView.constructor} context.
5946 * @default {@link MapView.heading} in {@link (MapView.lookAt:WITH_PARAMS)} context.
5947 */
5948 heading: number;
5949}
5950
5951/**
5952 * Available texture magnification filters.
5953 */
5954export declare type MagFilter = "nearest" | "linear";
5955
5956/**
5957 * Make runtime representation of technique attributes from JSON-compatible typings.
5958 *
5959 * Translates
5960 * - InterpolatedPropertyDefinition -> InterpolatedProperty
5961 * - JsonExpr -> Expr
5962 */
5963export declare type MakeTechniqueAttrs<T> = {
5964 [P in keyof T]: T[P] | JsonExpr extends T[P] ? RemoveInterpolatedPropDef<RemoveJsonExpr<T[P]>> | Expr : T[P];
5965};
5966
5967/**
5968 * An interface describing [[THREE.Object3D]]s anchored on
5969 * given {@link @here/harp-geoutils#GeoCoordinates}.
5970 *
5971 * @remarkks
5972 * @example
5973 * Example:
5974 * ```typescript
5975 * const mesh: MapAnchor<THREE.Mesh> = new THREE.Mesh(geometry, material);
5976 * mesh.anchor = new GeoCoordinates(latitude, longitude, altitude);
5977 * mapView.mapAnchors.add(mesh);
5978 * ```
5979 */
5980export declare type MapAnchor<T extends THREE_2.Object3D = THREE_2.Object3D> = T & {
5981 /**
5982 * The position of this [[MapAnchor]] in {@link @here/harp-geoutils#GeoCoordinates}.
5983 * @deprecated Use [[anchor]] instead.
5984 */
5985 geoPosition?: GeoCoordinates;
5986 /**
5987 * The anchor of this Object3D in {@link @here/harp-geoutils#GeoCoordinates}
5988 * or world coordinates.
5989 */
5990 anchor?: GeoCoordLike | Vector3Like;
5991 /**
5992 * Flag defining if the object may be picked.
5993 *
5994 * @note By default all objects are pickable even if this flag is undefined.
5995 */
5996 pickable?: boolean;
5997 /**
5998 * The styleSet that owns this map object.
5999 *
6000 * @remarks
6001 * This property is used together with [[Theme.priorities]] to compute the render
6002 * order of this map object.
6003 */
6004 styleSet?: string;
6005 /**
6006 * The category of this style.
6007 *
6008 * @remarks
6009 * This property is used together with [[Theme.priorities]] to compute the render
6010 * order of this mao object.
6011 */
6012 category?: string;
6013 /**
6014 * Whether to draw the anchor on top of labels.
6015 * @defaultValue false
6016 */
6017 overlay?: boolean;
6018};
6019
6020/**
6021 * Container holding [[MapAnchor]] objects.
6022 */
6023export declare class MapAnchors {
6024 private m_anchors;
6025 /**
6026 * All currently added [[MapAnchor]]s.
6027 */
6028 get children(): MapAnchor<THREE_2.Object3D>[];
6029 /**
6030 * Add a [[MapAnchor]].
6031 * @param mapAnchor [[MapAnchor]] instance to add.
6032 */
6033 add(mapAnchor: MapAnchor): void;
6034 /**
6035 * Remove a [[MapAnchor]].
6036 * @param mapAnchor - [[MapAnchor]] instance to remove.
6037 *
6038 * @note This method is potentially slow when removing a lot of anchors.
6039 * [[clear]]ing and [[add]]ing anchors should be considered in that case.
6040 */
6041 remove(mapAnchor: MapAnchor): void;
6042 /**
6043 * Remove all [[MapAnchor]]s.
6044 */
6045 clear(): void;
6046 /**
6047 * Update the map anchors.
6048 * @param projection - Current projection
6049 * @param cameraPosition - Current camera position
6050 * @param rootNode - Node where normal anchors will be inserted.
6051 * @param overlayRootNode - Node where overlay anchors will be insterted.
6052 * @param priorities - Optional theme priority list
6053 *
6054 * @internal
6055 * @hidden
6056 */
6057 update(projection: Projection, cameraPosition: THREE_2.Vector3, rootNode: THREE_2.Object3D, overlayRootNode: THREE_2.Object3D, priorities?: StylePriority[]): void;
6058}
6059
6060/**
6061 * This map control provides basic map-related building blocks to interact with the map. It also
6062 * provides a default way of handling user input. Currently we support basic mouse interaction and
6063 * touch input interaction.
6064 *
6065 * Mouse interaction:
6066 * - Left mouse button + move = Panning the map.
6067 * - Right mouse button + move = Orbits the camera around the focus point.
6068 * - Middle mouse button + move = Rotating the view. Up down movement changes the pitch. Left/right
6069 * movement changes the yaw.
6070 * - Mouse wheel = Zooms up and down by one zoom level, zooms on target.
6071 *
6072 * Touch interaction:
6073 * - One finger = Panning the map.
6074 * - Two fingers = Scale, rotate and panning the map.
6075 * - Three fingers = Orbiting the map. Up down movements influences the current orbit altitude.
6076 * Left/right changes the azimuth.
6077 */
6078export declare class MapControls extends THREE_2.EventDispatcher {
6079 readonly mapView: MapView;
6080 /**
6081 * Creates MapControls object and attaches it specified [[MapView]].
6082 *
6083 * @param mapView - [[MapView]] object to which MapControls should be attached to.
6084 */
6085 static create(mapView: MapView): MapControls;
6086 /**
6087 * This factor will be applied to the delta of the current mouse pointer position and the last
6088 * mouse pointer position: The result then will be used as an offset for the rotation then.
6089 * Default value is `0.1`.
6090 */
6091 rotationMouseDeltaFactor: number;
6092 /**
6093 * This factor will be applied to the delta of the current mouse pointer position and the last
6094 * mouse pointer position: The result then will be used as an offset to orbit the camera.
6095 * Default value is `0.1`.
6096 */
6097 orbitingMouseDeltaFactor: number;
6098 /**
6099 * This factor will be applied to the delta of the current touch pointer position and the last
6100 * touch pointer position: The result then will be used as an offset to orbit the camera.
6101 * Default value is `0.1`.
6102 */
6103 orbitingTouchDeltaFactor: number;
6104 /**
6105 * Set to `true` to enable input handling through this map control, `false` to disable input
6106 * handling. Even when disabling input handling, you can manually use the public functions to
6107 * change the view to the current map.
6108 */
6109 enabled: boolean;
6110 /**
6111 * Set to `true` to enable zooming through these controls, `false` otherwise.
6112 */
6113 zoomEnabled: boolean;
6114 /**
6115 * Set to `true` to enable panning through these controls, `false` otherwise.
6116 */
6117 panEnabled: boolean;
6118 /**
6119 * Set to `true` to enable orbiting and tilting through these controls, `false` otherwise.
6120 */
6121 tiltEnabled: boolean;
6122 /**
6123 * Set to `true` to enable rotation through this map control, `false` to disable rotation.
6124 */
6125 rotateEnabled: boolean;
6126 /**
6127 * Set to `true` to enable an inertia dampening on zooming and panning. `false` cancels inertia.
6128 */
6129 inertiaEnabled: boolean;
6130 /**
6131 * Inertia damping duration for the zoom, in seconds.
6132 */
6133 zoomInertiaDampingDuration: number;
6134 /**
6135 * Inertia damping duration for the panning, in seconds.
6136 */
6137 panInertiaDampingDuration: number;
6138 /**
6139 * Duration in seconds of the camera animation when the tilt button is clicked. Independent of
6140 * inertia.
6141 */
6142 tiltToggleDuration: number;
6143 /**
6144 * Camera tilt to the target when tilting from the `toggleTilt` public method.
6145 */
6146 tiltAngle: number;
6147 /**
6148 * Duration of the animation to reset the camera to looking north, in seconds. Independent of
6149 * inertia.
6150 */
6151 northResetAnimationDuration: number;
6152 /**
6153 * Determines the zoom level delta for single mouse wheel movement. So after each mouse wheel
6154 * movement the current zoom level will be added or subtracted by this value. The default value
6155 * is `0.2` - this means that every 5th mouse wheel movement you will cross a zoom level.
6156 *
6157 * **Note**: To reverse the zoom direction, you can provide a negative value.
6158 */
6159 zoomLevelDeltaOnMouseWheel: number;
6160 /**
6161 * Zoom level delta when using the UI controls.
6162 */
6163 zoomLevelDeltaOnControl: number;
6164 /**
6165 * Determines the minimum zoom level we can zoom to.
6166 */
6167 minZoomLevel: number;
6168 /**
6169 * Determines the maximum zoom level we can zoom to.
6170 */
6171 maxZoomLevel: number;
6172 /**
6173 * Determines the minimum camera height in meter.
6174 */
6175 minCameraHeight: number;
6176 /**
6177 * Zoom level delta to apply when double clicking or double tapping. `0` disables the feature.
6178 */
6179 zoomLevelDeltaOnDoubleClick: number;
6180 /**
6181 * Double click uses the OS delay through the double click event. Tapping is implemented locally
6182 * here in `MapControls` with this duration setting the maximum delay to define a double tap.
6183 * The value is in seconds. `300ms` is picked as the default value as jQuery does.
6184 */
6185 doubleTapTime: number;
6186 /**
6187 * Three.js camera that this controller affects.
6188 */
6189 readonly camera: THREE_2.Camera;
6190 /**
6191 * Map's HTML DOM element.
6192 */
6193 readonly domElement: HTMLCanvasElement;
6194 private readonly m_currentViewDirection;
6195 private readonly m_lastMousePosition;
6196 private readonly m_mouseDelta;
6197 private m_needsRenderLastFrame;
6198 private m_panIsAnimated;
6199 private m_panDistanceFrameDelta;
6200 private m_panAnimationTime;
6201 private m_panAnimationStartTime;
6202 private m_lastAveragedPanDistanceOrAngle;
6203 private m_currentInertialPanningSpeed;
6204 private m_lastPanVector;
6205 private m_rotateGlobeQuaternion;
6206 private m_lastRotateGlobeAxis;
6207 private m_lastRotateGlobeAngle;
6208 private m_lastRotateGlobeFromVector;
6209 private m_recentPanDistancesOrAngles;
6210 private m_currentPanDistanceOrAngleIndex;
6211 private m_zoomIsAnimated;
6212 private m_zoomDeltaRequested;
6213 private m_zoomTargetNormalizedCoordinates;
6214 private m_zoomAnimationTime;
6215 private m_zoomAnimationStartTime;
6216 private m_startZoom;
6217 private m_targetedZoom?;
6218 private m_currentZoom?;
6219 private m_tiltIsAnimated;
6220 private m_tiltRequested?;
6221 private m_tiltAnimationTime;
6222 private m_tiltAnimationStartTime;
6223 private m_startTilt;
6224 private m_targetedTilt?;
6225 private m_currentTilt?;
6226 private m_tiltState?;
6227 private m_state;
6228 private m_tmpVector2;
6229 private m_tmpVector3;
6230 private m_tapStartTime;
6231 private m_lastSingleTapTime;
6232 private m_fingerMoved;
6233 private m_isDoubleTap;
6234 private m_resetNorthStartTime;
6235 private m_resetNorthIsAnimated;
6236 private m_resetNorthAnimationDuration;
6237 private m_currentAzimuth;
6238 private m_lastAzimuth;
6239 private m_startAzimuth;
6240 /**
6241 * Determines the maximum angle the camera can tilt to. It is defined in radians.
6242 */
6243 private m_maxTiltAngle;
6244 private m_cleanupMouseEventListeners?;
6245 private m_touchState;
6246 /**
6247 * Constructs a new `MapControls` object.
6248 *
6249 * @param mapView - [[MapView]] this controller modifies.Z
6250 */
6251 constructor(mapView: MapView);
6252 /**
6253 * Destroy this `MapControls` instance.
6254 *
6255 * Unregisters all global event handlers used. This is method should be called when you stop
6256 * using `MapControls`.
6257 */
6258 dispose: () => void;
6259 /**
6260 * Current viewing angles yaw/pitch/roll in degrees.
6261 */
6262 get attitude(): MapViewUtils.Attitude;
6263 /**
6264 * Moves the camera along the view direction in meters.
6265 * A positive value will move the camera further away from the point where the camera looks at.
6266 * A negative value will move the camera near to the point where the camera looks at.
6267 *
6268 * @param amount - Amount to move along the view direction in meters.
6269 */
6270 moveAlongTheViewDirection(amount: number): void;
6271 /**
6272 * Reset the camera to looking north, in an orbiting movement around the target point instead
6273 * of changing the yaw (which would be the camera rotating on itself).
6274 */
6275 pointToNorth(): void;
6276 /**
6277 * Zooms and moves the map in such a way that the given target position remains at the same
6278 * position after the zoom.
6279 *
6280 * @param targetPositionOnScreenXinNDC - Target x position in NDC space.
6281 * @param targetPositionOnScreenYinNDC - Target y position in NDC space.
6282 */
6283 zoomOnTargetPosition(targetPositionOnScreenXinNDC: number, targetPositionOnScreenYinNDC: number, zoomLevel: number): void;
6284 /**
6285 * Zooms to the desired location by the provided value.
6286 *
6287 * @param zoomLevel - Zoom level.
6288 * @param screenTarget - Zoom target on screen.
6289 */
6290 setZoomLevel(zoomLevel: number, screenTarget?: {
6291 x: number;
6292 y: number;
6293 } | THREE_2.Vector2): void;
6294 /**
6295 * Toggles the camera tilt between 0 (looking down) and the value at `this.tiltAngle`.
6296 */
6297 toggleTilt(): void;
6298 /**
6299 * Set the camera height.
6300 */
6301 set cameraHeight(height: number);
6302 /**
6303 * Get the current camera height.
6304 */
6305 get cameraHeight(): number;
6306 /**
6307 * Set camera max tilt angle. The value is clamped between 0 and 90 degrees. In sphere
6308 * projection, at runtime, the value is also clamped so that the camera does not look above the
6309 * horizon.
6310 *
6311 * @param angle - Angle in degrees.
6312 */
6313 set maxTiltAngle(angle: number);
6314 /**
6315 * Get the camera max tilt angle in degrees.
6316 */
6317 get maxTiltAngle(): number;
6318 /**
6319 * Get the zoom level targeted by `MapControls`. Useful when inertia is on, to add incremented
6320 * values to the target instead of getting the random zoomLevel value during the interpolation.
6321 */
6322 get zoomLevelTargeted(): number;
6323 /**
6324 * Handy getter to know if the view is in the process of looking down or not.
6325 */
6326 get tiltState(): TiltState;
6327 private set currentZoom(value);
6328 private get currentZoom();
6329 private set currentTilt(value);
6330 private get currentTilt();
6331 private get targetedTilt();
6332 private assignZoomAfterTouchZoomRender;
6333 private stopExistingAnimations;
6334 private resetNorth;
6335 private stopResetNorth;
6336 private tilt;
6337 private stopTilt;
6338 private easeOutCubic;
6339 private handleZoom;
6340 private stopZoom;
6341 /**
6342 * Method to flip crêpes.
6343 */
6344 private handlePan;
6345 private stopPan;
6346 private bindInputEvents;
6347 private updateMapView;
6348 private mouseDoubleClick;
6349 private mouseDown;
6350 private mouseMove;
6351 private mouseUp;
6352 private mouseWheel;
6353 /**
6354 * Calculates the angle of the vector, which is formed by two touch points in world space
6355 * against the X axis in world space on the map. The resulting angle is in radians and between
6356 * `-PI` and `PI`.
6357 */
6358 private updateCurrentRotation;
6359 /**
6360 * Calculates the difference of the current distance of two touch points against their initial
6361 * distance in world space.
6362 */
6363 private calculatePinchDistanceInWorldSpace;
6364 private convertTouchPoint;
6365 private setTouchState;
6366 private updateTouches;
6367 private zoomOnDoubleClickOrTap;
6368 private touchStart;
6369 private touchMove;
6370 private touchEnd;
6371 private handleDoubleTap;
6372 private contextMenu;
6373 private getWorldPositionWithElevation;
6374 private panFromTo;
6375 /**
6376 * Acquire mouse or touch pointer position relative to canvas for `MouseEvent` or `Touch` event.
6377 *
6378 * Function takes into account canvas position in client space (including scrolling) as also
6379 * canvas scaling factor.
6380 *
6381 * @param event - The mouse event.
6382 * @returns [[THREE.Vector2]] containing _x_, _y_ mouse pointer position.
6383 */
6384 private getPointerPosition;
6385}
6386
6387/**
6388 * Base class to handle UI overlay elements.
6389 */
6390export declare class MapControlsUI {
6391 readonly controls: MapControls;
6392 /**
6393 * The DOM node containing the UI.
6394 */
6395 readonly domElement: HTMLDivElement;
6396 private m_buttonsElement;
6397 /**
6398 * Displays zoom level if [[MapControlsUIOptions.zoomLevel]] is defined.
6399 */
6400 private m_zoomLevelElement;
6401 /**
6402 * Displays zoom level if [[MapControlsUIOptions.projectionSwitch]] is defined.
6403 */
6404 private m_projectionSwitchElement;
6405 /**
6406 * Removes focus from input element.
6407 */
6408 private m_onWindowClick;
6409 /**
6410 * Updates the display of the zoom level.
6411 */
6412 private m_onMapViewRenderEvent;
6413 /**
6414 * Constructor of the UI.
6415 *
6416 * @param controls - Controls referencing a [[MapView]].
6417 */
6418 constructor(controls: MapControls, options?: MapControlsUIOptions);
6419 /**
6420 * Destroy this [[MapControlsUI]] instance. Unregisters all event handlers used. This method
6421 * should be called when you stop using [[MapControlsUI]].
6422 */
6423 dispose(): void;
6424 private initStyle;
6425}
6426
6427/**
6428 * Option for MapControlsUI.
6429 */
6430declare interface MapControlsUIOptions {
6431 /**
6432 * If specified, turns on the zoom level display or zoom level input.
6433 */
6434 zoomLevel?: "show" | "input";
6435 /**
6436 * If specified, allows to switch between mercator and sphere projections at runtime.
6437 */
6438 projectionSwitch?: boolean;
6439 /**
6440 * Turns off default CSS styling for controls.
6441 */
6442 disableDefaultStyle?: boolean;
6443}
6444
6445/**
6446 * `MapEnv` is a concrete implementation of {@link Env} that
6447 * creates a lookup environment from a set of properties.
6448 *
6449 * @example
6450 * ```typescript
6451 * const baseEnv = new MapEnv({
6452 * $zoom: 14,
6453 * });
6454 *
6455 * // extends baseEnv with a the new binding (kind, "landuse").
6456 * const env = new MapEnv({ kind: "landuse" }, baseEnv);
6457 *
6458 * const zoom = env.lookup("$zoom"); // zoom is 14
6459 * const kind = env.lookup("kind"); // kind is is "landuse"
6460 *
6461 * const expr = Expr.fromJson(["get", "kind"]);
6462 * const value = expr.evaluate(env); // value is "landuse"
6463 * ```
6464 */
6465export declare class MapEnv extends Env {
6466 readonly entries: ValueMap;
6467 private readonly parent?;
6468 constructor(entries: ValueMap, parent?: Env | undefined);
6469 /**
6470 * Returns property in {@link Env} by name.
6471 *
6472 * @param name - Name of property.
6473 * @override
6474 */
6475 lookup(name: string): Value | undefined;
6476 /**
6477 * Return an object containing all properties of this environment, takes care of the parent
6478 * object.
6479 * @override
6480 */
6481 unmap(): ValueMap;
6482}
6483
6484/**
6485 * The implementation of {@link IMapRenderingManager} to
6486 * instantiate in {@link MapView} and manage the map
6487 * rendering.
6488 */
6489export declare class MapRenderingManager implements IMapRenderingManager {
6490 bloom: {
6491 enabled: boolean;
6492 strength: number;
6493 radius: number;
6494 threshold: number;
6495 };
6496 outline: {
6497 enabled: boolean;
6498 thickness: number;
6499 color: string;
6500 ghostExtrudedPolygons: boolean;
6501 needsUpdate: boolean;
6502 };
6503 vignette: {
6504 enabled: boolean;
6505 offset: number;
6506 darkness: number;
6507 };
6508 sepia: {
6509 enabled: boolean;
6510 amount: number;
6511 };
6512 private m_width;
6513 private m_height;
6514 private m_outlineEffect?;
6515 private m_msaaPass;
6516 private m_renderPass;
6517 private m_target1;
6518 private m_target2;
6519 private m_bloomPass?;
6520 private m_sepiaPass;
6521 private m_vignettePass;
6522 private m_readBuffer;
6523 private m_dynamicMsaaSamplingLevel;
6524 private m_staticMsaaSamplingLevel;
6525 private m_lowResPass;
6526 /**
6527 * The constructor of `MapRenderingManager`.
6528 *
6529 * @param width - Width of the frame buffer.
6530 * @param height - Height of the frame buffer.
6531 * @param lowResPixelRatio - The `pixelRatio` determines the resolution of the internal
6532 * `WebGLRenderTarget`. Values between 0.5 and `window.devicePixelRatio` can be tried to give
6533 * good results. A value of `undefined` disables the low res render pass. The value should not
6534 * be larger than`window.devicePixelRatio`.
6535 * @param antialiasSetting - The object defining the demeanor of MSAA.
6536 */
6537 constructor(width: number, height: number, lowResPixelRatio: number | undefined, antialiasSettings?: IMapAntialiasSettings | undefined);
6538 updateOutline(options: {
6539 thickness: number;
6540 color: string;
6541 ghostExtrudedPolygons: boolean;
6542 }): void;
6543 /**
6544 * The method to call to render the map with the `MapRenderingManager` instance. It contains the
6545 * chain of sub-passes that can transfer the write and read buffers, and other sheer rendering
6546 * conditions as disabling AA when a high DPI device is in use.
6547 *
6548 * @param renderer - The ThreeJS WebGLRenderer instance to render the map with.
6549 * @param scene - The ThreeJS Scene instance containing the map objects to render.
6550 * @param camera - The ThreeJS Camera instance to render the scene through.
6551 * @param isStaticFrame - Whether the frame to render is static or dynamic. Selects level of
6552 * antialiasing.
6553 */
6554 render(renderer: THREE_2.WebGLRenderer, scene: THREE_2.Scene, camera: THREE_2.PerspectiveCamera | THREE_2.OrthographicCamera, isStaticFrame: boolean): void;
6555 /**
6556 * The resize function to call on resize events to resize the render targets. It shall include
6557 * the resize methods of all the sub-passes used in `MapRenderingManager`.
6558 *
6559 * @param width - New width to use.
6560 * @param height - New height to use.
6561 */
6562 setSize(width: number, height: number): void;
6563 /**
6564 * The `lowResPixelRatio` determines the resolution of the internal `WebGLRenderTarget`. Values
6565 * between 0.5 and `window.devicePixelRatio` can be tried to give good results. A value of
6566 * `undefined` disables the low res render pass. The value should not be larger than
6567 * `window.devicePixelRatio`.
6568 */
6569 get lowResPixelRatio(): number | undefined;
6570 set lowResPixelRatio(pixelRatio: number | undefined);
6571 /**
6572 * Set the level of sampling while the user interacts.
6573 *
6574 * @param samplingLevel - The sampling level.
6575 */
6576 set dynamicMsaaSamplingLevel(samplingLevel: MSAASampling);
6577 /**
6578 * Return the sampling level defined during continuous rendering.
6579 */
6580 get dynamicMsaaSamplingLevel(): MSAASampling;
6581 /**
6582 * Enable or disable the MSAA. If disabled, `MapRenderingManager` will use the renderer provided
6583 * in the {@link MapRenderingManager.render} method to render the scene.
6584 *
6585 * @param value - If `true`, MSAA is enabled, disabled otherwise.
6586 */
6587 set msaaEnabled(value: boolean);
6588 /**
6589 * Return whether the MSAA is enabled.
6590 */
6591 get msaaEnabled(): boolean;
6592 /**
6593 * Set the sampling level for rendering static frames.
6594 *
6595 * @param samplingLevel - The sampling level.
6596 */
6597 set staticMsaaSamplingLevel(samplingLevel: MSAASampling);
6598 /**
6599 * Return the sampling level defined for rendering static frames.
6600 */
6601 get staticMsaaSamplingLevel(): MSAASampling;
6602}
6603
6604/**
6605 * The core class of the library to call in order to create a map visualization. It needs to be
6606 * linked to datasources.
6607 */
6608export declare class MapView extends THREE_2.EventDispatcher {
6609 /**
6610 * Maximum FPS (Frames Per Second). If VSync in enabled, the specified number may not be
6611 * reached, but instead the next smaller number than `maxFps` that is equal to the refresh rate
6612 * divided by an integer number.
6613 *
6614 * E.g.: If the monitors refresh rate is set to 60hz, and if `maxFps` is set to a value of `40`
6615 * (60hz/1.5), the actual used FPS may be 30 (60hz/2). For displays that have a refresh rate of
6616 * 60hz, good values for `maxFps` are 30, 20, 15, 12, 10, 6, 3 and 1. A value of `0` is ignored.
6617 */
6618 maxFps: number;
6619 /**
6620 * The instance of {@link MapRenderingManager} managing the rendering of the map. It is a public
6621 * property to allow access and modification of some parameters of the rendering process at
6622 * runtime.
6623 */
6624 readonly mapRenderingManager: IMapRenderingManager;
6625 private m_renderLabels;
6626 private m_movementFinishedUpdateTimerId?;
6627 private m_postEffects?;
6628 private m_skyBackground?;
6629 private m_createdLights?;
6630 private m_overlayCreatedLights?;
6631 private readonly m_screenProjector;
6632 private readonly m_screenCollisions;
6633 private m_visibleTiles;
6634 private m_elevationSource?;
6635 private m_elevationRangeSource?;
6636 private m_elevationProvider?;
6637 private m_visibleTileSetLock;
6638 private m_tileGeometryManager;
6639 private m_tileWrappingEnabled;
6640 private m_zoomLevel;
6641 private m_minZoomLevel;
6642 private m_maxZoomLevel;
6643 private m_minCameraHeight;
6644 private readonly m_screenCamera;
6645 private readonly m_camera;
6646 /**
6647 * Relative to eye camera.
6648 *
6649 * This camera is internal camera used to improve precision
6650 * when rendering geometries.
6651 */
6652 private readonly m_rteCamera;
6653 private m_yaw;
6654 private m_pitch;
6655 private m_roll;
6656 private m_focalLength;
6657 private m_targetDistance;
6658 private m_targetGeoPos;
6659 private m_targetWorldPos;
6660 private readonly m_viewRanges;
6661 private m_pointOfView?;
6662 private m_pixelToWorld?;
6663 private m_pixelRatio?;
6664 /** Default scene for map objects and map anchors */
6665 private readonly m_scene;
6666 /** Separate scene for overlay map anchors */
6667 private readonly m_overlayScene;
6668 private readonly m_fog;
6669 /** Root node of [[m_scene]] that get's cleared every frame. */
6670 private readonly m_sceneRoot;
6671 /** Root node of [[m_overlayScene]] that get's cleared every frame. */
6672 private readonly m_overlaySceneRoot;
6673 private readonly m_mapAnchors;
6674 private m_animationCount;
6675 private m_animationFrameHandle;
6676 private m_drawing;
6677 private m_updatePending;
6678 private m_renderer;
6679 private m_frameNumber;
6680 private m_textElementsRenderer;
6681 private m_forceCameraAspect;
6682 private readonly m_tileDataSources;
6683 private readonly m_connectedDataSources;
6684 private readonly m_failedDataSources;
6685 private m_backgroundDataSource?;
6686 private m_polarDataSource?;
6687 private m_enablePolarDataSource;
6688 private readonly m_raycaster;
6689 private readonly m_plane;
6690 private readonly m_sphere;
6691 private readonly m_options;
6692 private readonly m_visibleTileSetOptions;
6693 private m_theme;
6694 private m_uriResolver?;
6695 private m_themeIsLoading;
6696 private m_previousFrameTimeStamp?;
6697 private m_firstFrameRendered;
6698 private m_firstFrameComplete;
6699 private m_initialTextPlacementDone;
6700 private handleRequestAnimationFrame;
6701 private m_pickHandler;
6702 private m_imageCache;
6703 private m_poiManager;
6704 private m_poiTableManager;
6705 private m_collisionDebugCanvas;
6706 private m_movementDetector;
6707 private m_thisFrameTilesChanged;
6708 private m_lastTileIds;
6709 private m_languages;
6710 private m_politicalView;
6711 private m_copyrightInfo;
6712 private m_animatedExtrusionHandler;
6713 private m_env;
6714 private m_enableMixedLod;
6715 /**
6716 * Constructs a new `MapView` with the given options or canvas element.
6717 *
6718 * @param options - The `MapView` options or the HTML canvas element used to display the map.
6719 */
6720 constructor(options: MapViewOptions);
6721 /**
6722 * @returns The lights configured by the theme, this is just a convenience method, because the
6723 * lights can still be accessed by traversing the children of the [[scene]].
6724 */
6725 get lights(): THREE_2.Light[];
6726 /**
6727 * @returns Whether label rendering is enabled.
6728 */
6729 get renderLabels(): boolean;
6730 /**
6731 * Enables or disables rendering of labels.
6732 * @param value - `true` to enable labels `false` to disable them.
6733 */
6734 set renderLabels(value: boolean);
6735 /**
6736 * @returns Whether adding of new labels during interaction is enabled.
6737 */
6738 get delayLabelsUntilMovementFinished(): boolean;
6739 /**
6740 * Enables or disables adding of new labels during interaction. Has no influence on already
6741 * placed labels
6742 * @param value - `true` to enable adding `false` to disable them.
6743 */
6744 set delayLabelsUntilMovementFinished(value: boolean);
6745 /**
6746 * @hidden
6747 * The {@link TextElementsRenderer} select the visible {@link TextElement}s and renders them.
6748 */
6749 get textElementsRenderer(): TextElementsRenderer;
6750 /**
6751 * @hidden
6752 * The {@link CameraMovementDetector} detects camera movements. Made available for performance
6753 * measurements.
6754 */
6755 get cameraMovementDetector(): CameraMovementDetector;
6756 /**
6757 * The {@link AnimatedExtrusionHandler} controls animated extrusion effect
6758 * of the extruded objects in the {@link Tile}
6759 */
6760 get animatedExtrusionHandler(): AnimatedExtrusionHandler;
6761 /**
6762 * The [[TileGeometryManager]] manages geometry during loading and handles hiding geometry of
6763 * specified [[GeometryKind]]s.
6764 */
6765 get tileGeometryManager(): TileGeometryManager | undefined;
6766 get enableMixedLod(): boolean | undefined;
6767 set enableMixedLod(enableMixedLod: boolean | undefined);
6768 /**
6769 * Disposes this `MapView`.
6770 *
6771 * This function cleans the resources that are managed manually including those that exist in
6772 * shared caches.
6773 *
6774 * Note: This function does not try to clean objects that can be disposed off easily by
6775 * TypeScript's garbage collecting mechanism. Consequently, if you need to perform a full
6776 * cleanup, you must ensure that all references to this `MapView` are removed.
6777 */
6778 dispose(): void;
6779 /**
6780 * The way the cache usage is computed, either based on size in MB (mega bytes) or in number of
6781 * tiles.
6782 */
6783 get resourceComputationType(): ResourceComputationType;
6784 set resourceComputationType(value: ResourceComputationType);
6785 /**
6786 * Returns the cache size.
6787 */
6788 getCacheSize(): number;
6789 /**
6790 * Sets the cache size in number of tiles.
6791 *
6792 * @param size - The cache size in tiles.
6793 * @param numVisibleTiles - The number of tiles visible, which is size/2 by default.
6794 */
6795 setCacheSize(size: number, numVisibleTiles?: number): void;
6796 /**
6797 * Specfies whether extended frustum culling is enabled or disabled.
6798 */
6799 get extendedFrustumCulling(): boolean;
6800 /**
6801 * Enable of disable extended frustum culling.
6802 */
6803 set extendedFrustumCulling(value: boolean);
6804 /**
6805 * Returns the status of frustum culling after each update.
6806 */
6807 get lockVisibleTileSet(): boolean;
6808 /**
6809 * Enable of disable frustum culling after each update.
6810 */
6811 set lockVisibleTileSet(value: boolean);
6812 /**
6813 * Gets the optional camera used to render the scene.
6814 */
6815 get pointOfView(): THREE_2.PerspectiveCamera | undefined;
6816 /**
6817 * Sets the optional camera used to render the scene.
6818 */
6819 set pointOfView(pointOfView: THREE_2.PerspectiveCamera | undefined);
6820 /**
6821 * Loads a post effects definition file.
6822 *
6823 * @param postEffectsFile - File URL describing the post effects.
6824 */
6825 loadPostEffects(postEffectsFile: string): void;
6826 /**
6827 * The abstraction of the {@link MapRenderingManager} API for post effects.
6828 */
6829 get postEffects(): PostEffects | undefined;
6830 set postEffects(postEffects: PostEffects | undefined);
6831 /**
6832 * Gets the current `Theme` used by this `MapView` to style map elements.
6833 */
6834 get theme(): Theme;
6835 /**
6836 * Changes the `Theme` used by this `MapView` to style map elements.
6837 */
6838 set theme(theme: Theme);
6839 /**
6840 * {@link @here/harp-utils#UriResolver} used to resolve application/deployment
6841 * specific `URI`s into actual `URLs` that can be loaded with `fetch`.
6842 */
6843 get uriResolver(): UriResolver | undefined;
6844 /**
6845 * Gets the value of the forced custom camera aspect.
6846 * Every time a frame is rendered, `MapView` resets the camera aspect.
6847 *
6848 * You can disable this behavior by setting the value to `undefined`.
6849 */
6850 get forceCameraAspect(): number | undefined;
6851 /**
6852 * Sets the custom forced camera aspect ratio to use while rendering.
6853 */
6854 set forceCameraAspect(aspect: number | undefined);
6855 /**
6856 * Lists the ISO 639-1 language codes for DataSources to use.
6857 */
6858 get languages(): string[] | undefined;
6859 /**
6860 * Sets the list of ISO 639-1 language codes for DataSources to use.
6861 */
6862 set languages(languages: string[] | undefined);
6863 /**
6864 * Get currently presented political point of view - the country code.
6865 *
6866 * @note Country code is stored in lower-case ISO 3166-1 alpha-2 standard.
6867 * @return Country code or undefined if default
6868 * (majorly accepted) point of view is used.
6869 */
6870 get politicalView(): string | undefined;
6871 /**
6872 * Set the political view (country code) to be used when rendering disputed features (borders).
6873 *
6874 * @note Country code should be encoded in lower-case ISO 3166-1 alpha-2 standard.
6875 * @param pov - The code of the country which point of view should be presented,
6876 * if `undefined` or empty string is set then "defacto" or most widely accepted point of view
6877 * will be presented.
6878 */
6879 set politicalView(pov: string | undefined);
6880 get copyrightInfo(): CopyrightInfo[];
6881 /**
6882 * @hidden
6883 * Disable all fading animations (for debugging and performance measurement). Defaults to
6884 * `false`.
6885 */
6886 set disableFading(disable: boolean);
6887 get disableFading(): boolean;
6888 /**
6889 * @hidden
6890 * Return current frame number.
6891 */
6892 get frameNumber(): number;
6893 /**
6894 * @hidden
6895 * Reset the frame number to 0.
6896 */
6897 resetFrameNumber(): void;
6898 /**
6899 * Adds an event listener. There are various events that are sent before or after a new frame
6900 * is rendered.
6901 *
6902 * @see [[MapViewEventNames]].
6903 *
6904 * @example
6905 * ```TypeScript
6906 * let frameCount = 0;
6907 * mapView.addEventListener(MapViewEventNames.Render, () => {
6908 * ++frameCount;
6909 * });
6910 * ```
6911 *
6912 * @param type - One of the [[MapViewEventNames]] strings.
6913 * @param listener - The callback invoked when the `MapView` needs to render a new frame.
6914 */
6915 addEventListener(type: MapViewEventNames, listener: (event: RenderEvent) => void): void;
6916 /**
6917 * Removes an event listener. There are various events that are sent before or after a new frame
6918 * is rendered.
6919 *
6920 * @see [[MapViewEventNames]].
6921 *
6922 * @example
6923 * ```TypeScript
6924 * mapView.removeEventListener(MapViewEventNames.Render, listener);
6925 * ```
6926 *
6927 * @param type - One of the [[MapViewEventNames]] strings.
6928 * @param listener - The callback invoked when the `MapView` needs to render a new frame.
6929 */
6930 removeEventListener(type: MapViewEventNames, listener: (event: RenderEvent) => void): void;
6931 /**
6932 * The HTML canvas element used by this `MapView`.
6933 */
6934 get canvas(): HTMLCanvasElement;
6935 /**
6936 * The HTML canvas element used by this `MapView`.
6937 */
6938 get collisionDebugCanvas(): HTMLCanvasElement | undefined;
6939 /**
6940 * The THREE.js scene used by this `MapView`.
6941 */
6942 get scene(): THREE_2.Scene;
6943 /**
6944 * The THREE.js camera used by this `MapView` to render the main scene.
6945 * @note When modifying the camera all derived properties like:
6946 * - {@link MapView.target}
6947 * - {@link MapView.zoomLevel}
6948 * - {@link MapView.tilt}
6949 * - {@link MapView.heading}
6950 * could change.
6951 * These properties are cached internaly and will only be updated in the next animation frame.
6952 * FIXME: Unfortunatley THREE.js is not dispatching any events when camera properties change
6953 * so we should have an API for enforcing update of cached values.
6954 */
6955 get camera(): THREE_2.PerspectiveCamera;
6956 /**
6957 * The THREE.js `WebGLRenderer` used by this scene.
6958 */
6959 get renderer(): THREE_2.WebGLRenderer;
6960 /**
6961 * The color used to clear the view.
6962 */
6963 get clearColor(): number;
6964 /**
6965 * The color used to clear the view.
6966 */
6967 set clearColor(color: number);
6968 /**
6969 * The alpha used to clear the view.
6970 */
6971 get clearAlpha(): number;
6972 /**
6973 * The alpha used to clear the view.
6974 */
6975 set clearAlpha(alpha: number);
6976 /**
6977 * The projection used to project geo coordinates to world coordinates.
6978 */
6979 get projection(): Projection;
6980 /**
6981 * Changes the projection at run time.
6982 *
6983 * @param projection - The {@link @here/harp-geoutils#Projection} instance to use.
6984 */
6985 set projection(projection: Projection);
6986 /**
6987 * Get camera clipping planes evaluator used.
6988 */
6989 get clipPlanesEvaluator(): ClipPlanesEvaluator;
6990 /**
6991 * Changes the clip planes evaluator at run time.
6992 */
6993 set clipPlanesEvaluator(clipPlanesEvaluator: ClipPlanesEvaluator);
6994 /**
6995 * The distance (in pixels) between the screen and the camera.
6996 */
6997 get focalLength(): number;
6998 /**
6999 * Get geo coordinates of camera focus (target) point.
7000 * This point is not necessarily on the ground, i.e.:
7001 * - if the tilt is high and projection is [[sphereProjection]]
7002 * - if the camera was modified directly and is not pointing to the ground.
7003 * In any case the projection of the target point will be in the center of the screen.
7004 *
7005 * @returns geo coordinates of the camera focus point.
7006 */
7007 get target(): GeoCoordinates;
7008 /** @internal
7009 * Get world coordinates of camera focus point.
7010 *
7011 * @note The focus point coordinates are updated with each camera update so you don't need
7012 * to re-calculate it, although if the camera started looking to the void, the last focus
7013 * point is stored.
7014 *
7015 * @returns world coordinates of the camera focus point.
7016 */
7017 get worldTarget(): THREE_2.Vector3;
7018 /** @internal
7019 * Get distance from camera to the point of focus in world units.
7020 *
7021 * @note If camera does not point to any ground anymore the last focus point distance is
7022 * then returned.
7023 *
7024 * @returns Last known focus point distance.
7025 */
7026 get targetDistance(): number;
7027 /**
7028 * Get object describing frustum planes distances and min/max visibility range for actual
7029 * camera setup.
7030 * Near and far plane distance are self explanatory while minimum and maximum visibility range
7031 * describes the extreme near/far planes distances that may be achieved with current camera
7032 * settings, meaning at current zoom level (ground distance) and any possible orientation.
7033 * @note Visibility is directly related to camera [[ClipPlaneEvaluator]] used and determines
7034 * the maximum possible distance of camera far clipping plane regardless of tilt, but may change
7035 * whenever zoom level changes. Distance is measured in world units which may be approximately
7036 * equal to meters, but this depends on the distortion related to projection type used.
7037 * @internal
7038 */
7039 get viewRanges(): ViewRanges;
7040 /**
7041 * The position in geo coordinates of the center of the scene.
7042 * @internal
7043 */
7044 get geoCenter(): GeoCoordinates;
7045 /**
7046 * The position in geo coordinates of the center of the scene.
7047 * Longitude values outside of -180 and +180 are acceptable.
7048 */
7049 set geoCenter(geoCenter: GeoCoordinates);
7050 /**
7051 * The node in this MapView's scene containing the user [[MapAnchor]]s.
7052 * All (first level) children of this node will be positioned in world space according to the
7053 * [[MapAnchor.geoPosition]].
7054 * Deeper level children can be used to position custom objects relative to the anchor node.
7055 */
7056 get mapAnchors(): MapAnchors;
7057 /**
7058 * The position in world coordinates of the center of the scene.
7059 */
7060 get worldCenter(): THREE_2.Vector3;
7061 /**
7062 * Get the [[PickHandler]] for this `mapView`.
7063 */
7064 get pickHandler(): PickHandler;
7065 /**
7066 * Get the {@link ImageCache} that belongs to this `MapView`.
7067 */
7068 get imageCache(): MapViewImageCache;
7069 /**
7070 * @hidden
7071 * Get the {@link PoiManager} that belongs to this `MapView`.
7072 */
7073 get poiManager(): PoiManager;
7074 /**
7075 * @hidden
7076 * Get the array of {@link PoiTableManager} that belongs to this `MapView`.
7077 */
7078 get poiTableManager(): PoiTableManager;
7079 /**
7080 * The minimum camera height in meters.
7081 */
7082 get minCameraHeight(): number;
7083 /**
7084 * The minimum zoom level.
7085 */
7086 get minZoomLevel(): number;
7087 /**
7088 * The minimum zoom level.
7089 */
7090 set minZoomLevel(zoomLevel: number);
7091 /**
7092 * The maximum zoom level. Default is 14.
7093 */
7094 get maxZoomLevel(): number;
7095 /**
7096 * The maximum zoom level.
7097 */
7098 set maxZoomLevel(zoomLevel: number);
7099 /**
7100 * Returns the zoom level for the given camera setup.
7101 */
7102 get zoomLevel(): number;
7103 set zoomLevel(zoomLevel: number);
7104 /**
7105 * Returns tilt angle in degrees.
7106 */
7107 get tilt(): number;
7108 /**
7109 * Set the tilt angle of the map.
7110 * @param tilt -: New tilt angle in degrees.
7111 */
7112 set tilt(tilt: number);
7113 /**
7114 * Returns heading angle in degrees.
7115 */
7116 get heading(): number;
7117 /**
7118 * Set the heading angle of the map.
7119 * @param heading -: New heading angle in degrees.
7120 */
7121 set heading(heading: number);
7122 /**
7123 * Environment used to evaluate dynamic scene expressions.
7124 */
7125 get env(): Env;
7126 /**
7127 * Returns the storage level for the given camera setup.
7128 * Actual storage level of the rendered data also depends
7129 * on {@link DataSource.storageLevelOffset}.
7130 */
7131 get storageLevel(): number;
7132 /**
7133 * Returns height of the viewport in pixels.
7134 */
7135 get viewportHeight(): number;
7136 /**
7137 * Returns `true` if the native WebGL antialiasing is enabled.
7138 *
7139 * @default `true` for `pixelRatio` < `2.0`, `false` otherwise.
7140 */
7141 get nativeWebglAntialiasEnabled(): boolean;
7142 /**
7143 * Returns {@link DataSource}s displayed by this `MapView`.
7144 */
7145 get dataSources(): DataSource[];
7146 /**
7147 * Set's the way in which the fov is calculated on the map view. Note, for
7148 * this to take visual effect, the map should be rendered after calling this
7149 * function.
7150 * @param fovCalculation - How the FOV is calculated.
7151 */
7152 setFovCalculation(fovCalculation: FovCalculation): void;
7153 /**
7154 * Returns the unique {@link DataSource} matching the given name.
7155 */
7156 getDataSourceByName(dataSourceName: string): DataSource | undefined;
7157 /**
7158 * Returns the array of {@link DataSource}s referring to the same [[StyleSet]].
7159 */
7160 getDataSourcesByStyleSetName(styleSetName: string): DataSource[];
7161 /**
7162 * Returns true if the specified {@link DataSource} is enabled.
7163 */
7164 isDataSourceEnabled(dataSource: DataSource): boolean;
7165 /**
7166 * Adds a new {@link DataSource} to this `MapView`.
7167 * `MapView` needs at least one {@link DataSource} to
7168 * display something.
7169 *
7170 * @param dataSource - The data source.
7171 */
7172 addDataSource(dataSource: DataSource): Promise<void>;
7173 /**
7174 * Removes {@link DataSource} from this `MapView`.
7175 *
7176 * @param dataSource - The data source to be removed
7177 */
7178 removeDataSource(dataSource: DataSource): void;
7179 /**
7180 * Access the `VisibleTileSet` to get access to all current datasources and their visible tiles.
7181 */
7182 get visibleTileSet(): VisibleTileSet;
7183 /**
7184 * Adds new overlay text elements to this `MapView`.
7185 *
7186 * @param textElements - Array of {@link TextElement} to be added.
7187 */
7188 addOverlayText(textElements: TextElement[]): void;
7189 /**
7190 * Adds new overlay text elements to this `MapView`.
7191 *
7192 * @param textElements - Array of {@link TextElement} to be added.
7193 */
7194 clearOverlayText(): void;
7195 /**
7196 * Adjusts the camera to look at a given geo coordinate with tilt and heading angles.
7197 *
7198 * #### Note on `target` and `bounds`
7199 *
7200 * If `bounds` are specified, `zoomLevel` and `distance` parameters are ignored and `lookAt`
7201 * calculates best zoomLevel (and possibly target) to fit given bounds.
7202 *
7203 * Following table shows how relation between `bounds` and target.
7204 *
7205 * | `bounds` | `target` | actual `target`
7206 * | ------ | ------ | --------
7207 * | {@link @here/harp-geoutils#GeoBox} | _defined_ | `params.target` is used
7208 * | {@link @here/harp-geoutils#GeoBox} | `undefined` | `bounds.center` is used as new `target`
7209 * | {@link @here/harp-geoutils#GeoBoxExtentLike} | `undefined` | current `MapView.target` is used
7210 * | {@link @here/harp-geoutils#GeoBoxExtentLike} | _defined_ | `params.target` is used
7211 * | [[GeoCoordLike]][] | `undefined` | new `target` is calculated as center of world box covering given points
7212 * | [[GeoCoordLike]][] | _defined_ | `params.target` is used and zoomLevel is adjusted to view all given geo points
7213 *
7214 * In each case, `lookAt` finds minimum `zoomLevel` that covers given extents or geo points.
7215 *
7216 * With flat projection, if `bounds` represents points on both sides of antimeridian, and
7217 * {@link MapViewOptions.tileWrappingEnabled} is used, `lookAt` will use this knowledge and find
7218 * minimal view that may cover "next" or "previous" world.
7219 *
7220 * With sphere projection if `bounds` represents points on both sides of globe, best effort
7221 * method is used to find best `target``.
7222 *
7223 * #### Examples
7224 *
7225 * ```
7226 * mapView.lookAt({heading: 90})
7227 * // look east retaining current `target`, `zoomLevel` and `tilt`
7228 *
7229 * mapView.lookAt({lat: 40.707, lng: -74.01})
7230 * // look at Manhattan, New York retaining other view params
7231 *
7232 * mapView.lookAt(bounds: { latitudeSpan: 10, longitudeSpan: 10})
7233 * // look at current `target`, but extending zoomLevel so we see 10 degrees of lat/long span
7234 * ```
7235 *
7236 * @see More examples in [[LookAtExample]].
7237 *
7238 * @param params - {@link LookAtParams}
7239 *
7240 * {@labels WITH_PARAMS}
7241 */
7242 lookAt(params: Partial<LookAtParams>): void;
7243 /**
7244 * The method that sets the camera to the desired angle (`tiltDeg`) and `distance` (in meters)
7245 * to the `target` location, from a certain heading (`headingAngle`).
7246 *
7247 * @param target - The location to look at.
7248 * @param distance - The distance of the camera to the target in meters.
7249 * @param tiltDeg - The camera tilt angle in degrees (0 is vertical), curbed below 89deg
7250 * @default 0
7251 * @param headingDeg - The camera heading angle in degrees and clockwise (as opposed to yaw)
7252 * @default 0
7253 * starting north.
7254 * @deprecated Use lookAt version with {@link LookAtParams} object parameter.
7255 */
7256 lookAt(target: GeoCoordLike, distance: number, tiltDeg?: number, headingDeg?: number): void;
7257 /**
7258 * Moves the camera to the specified {@link @here/harp-geoutils#GeoCoordinates},
7259 * sets the desired `zoomLevel` and
7260 * adjusts the yaw and pitch. The pitch of the camera is
7261 * always curbed so that the camera cannot
7262 * look above the horizon. This paradigm is necessary
7263 * in {@link @here/harp-map-controls#MapControls}, where the center of
7264 * the screen is used for the orbiting interaction (3 fingers / right mouse button).
7265 *
7266 * @param geoPos - Geolocation to move the camera to.
7267 * @param zoomLevel - Desired zoom level.
7268 * @param yawDeg - Camera yaw in degrees, counter-clockwise (as opposed to heading), starting
7269 * north.
7270 * @param pitchDeg - Camera pitch in degrees.
7271 * @deprecated Use {@link (MapView.lookAt:WITH_PARAMS)} instead.
7272 */
7273 setCameraGeolocationAndZoom(geoPos: GeoCoordinates, zoomLevel: number, yawDeg?: number, pitchDeg?: number): void;
7274 /**
7275 * Updates the value of a dynamic property.
7276 *
7277 * Property names starting with a `$`-sign are reserved and any attempt to change their value
7278 * will result in an error.
7279 *
7280 * Themes can access dynamic properties using the `Expr` operator `["dynamic-properties"]`,
7281 * for example:
7282 *
7283 * `["get", "property name", ["dynamic-properties"]]`
7284 *
7285 * @param name - The name of the property.
7286 * @param value - The value of the property.
7287 */
7288 setDynamicProperty(name: string, value: Value): void;
7289 /**
7290 * Removes the given dynamic property from this {@link MapView}.
7291 *
7292 * Property names starting with a `$`-sign are reserved and any attempt to change their value
7293 * will result in an error.
7294 *
7295 * @param name - The name of the property to remove.
7296 */
7297 removeDynamicProperty(name: string): void;
7298 /**
7299 * Returns `true` if this `MapView` is constantly redrawing the scene.
7300 */
7301 get animating(): boolean;
7302 /**
7303 * Begin animating the scene.
7304 */
7305 beginAnimation(): void;
7306 /**
7307 * Stop animating the scene.
7308 */
7309 endAnimation(): void;
7310 /**
7311 * Returns `true` if the camera moved in the last frame.
7312 */
7313 get cameraIsMoving(): boolean;
7314 /**
7315 * Returns `true` if the current frame will immediately be followed by another frame.
7316 */
7317 get isDynamicFrame(): boolean;
7318 /**
7319 * Returns the ratio between a pixel and a world unit for the current camera (in the center of
7320 * the camera projection).
7321 */
7322 get pixelToWorld(): number;
7323 /**
7324 * Returns the ratio between a world and a pixel unit for the current camera (in the center of
7325 * the camera projection).
7326 */
7327 get worldToPixel(): number;
7328 get pixelRatio(): number;
7329 /**
7330 * PixelRatio in the WebGlRenderer. May contain values > 1.0 for high resolution screens
7331 * (HiDPI).
7332 *
7333 * A value of `undefined` will make the getter return `window.devicePixelRatio`, setting a value
7334 * of `1.0` will disable the use of HiDPI on all devices.
7335 *
7336 * @note Since the current pixelRatio may have been used in some calculations (e.g. the icons)
7337 * they may appear in the wrong size now. To ensure proper display of data, a call to
7338 * `clearTileCache()` is required if the pixelRatio is changed after tiles have been loaded.
7339 *
7340 * @memberof MapView
7341 */
7342 set pixelRatio(pixelRatio: number);
7343 /**
7344 * PixelRatio ratio for rendering when the camera is moving or an animation is running. Useful
7345 * when rendering on high resolution displays with low performance GPUs that may be
7346 * fill-rate-limited.
7347 *
7348 * If a value is specified, a low resolution render pass is used to render the scene into a
7349 * low resolution render target, before it is copied to the screen.
7350 *
7351 * A value of `undefined` disables the low res render pass. Values between 0.5 and
7352 * `window.devicePixelRatio` can be tried to give good results. The value should not be larger
7353 * than `window.devicePixelRatio`.
7354 *
7355 * @note Since no anti-aliasing is applied during dynamic rendering with `dynamicPixelRatio`
7356 * defined, visual artifacts may occur, especially with thin lines..
7357 *
7358 * @note The resolution of icons and text labels is not affected.
7359 *
7360 * @default `undefined`
7361 */
7362 set dynamicPixelRatio(ratio: number | undefined);
7363 get dynamicPixelRatio(): number | undefined;
7364 /**
7365 * Returns the screen position of the given geo coordinates.
7366 *
7367 * @param geoPos - The geo coordinates.
7368 * @returns The screen position in CSS/client coordinates (no pixel ratio applied) or
7369 * `undefined`.
7370 */
7371 getScreenPosition(geoPos: GeoCoordinates): THREE_2.Vector2 | undefined;
7372 /**
7373 * Returns a ray caster using the supplied screen positions.
7374 *
7375 * @param x - The X position in css/client coordinates (without applied display ratio).
7376 * @param y - The Y position in css/client coordinates (without applied display ratio).
7377 *
7378 * @alpha
7379 *
7380 * @return Raycaster with origin at the camera and direction based on the supplied x / y screen
7381 * points.
7382 */
7383 raycasterFromScreenPoint(x: number, y: number): THREE_2.Raycaster;
7384 /**
7385 * Returns the world space position from the given screen position. The return value can be
7386 * `null`, in case the camera is facing the horizon and the given `(x, y)` value is not
7387 * intersecting the ground plane.
7388 *
7389 * @param x - The X position in css/client coordinates (without applied display ratio).
7390 * @param y - The Y position in css/client coordinates (without applied display ratio).
7391 */
7392 getWorldPositionAt(x: number, y: number): THREE_2.Vector3 | null;
7393 /**
7394 * Returns the {@link @here/harp-geoutils#GeoCoordinates} from the
7395 * given screen position. The return value can be
7396 * `null`, in case the camera is facing the horizon and
7397 * the given `(x, y)` value is not
7398 * intersecting the ground plane.
7399 *
7400 * @param x - The X position in css/client coordinates (without applied display ratio).
7401 * @param y - The Y position in css/client coordinates (without applied display ratio).
7402 */
7403 getGeoCoordinatesAt(x: number, y: number): GeoCoordinates | null;
7404 /**
7405 * Returns the normalized screen coordinates from the given pixel position.
7406 *
7407 * @param x - The X position in css/client coordinates (without applied display ratio).
7408 * @param y - The Y position in css/client coordinates (without applied display ratio).
7409 */
7410 getNormalizedScreenCoordinates(x: number, y: number): THREE_2.Vector3;
7411 /**
7412 * Do a raycast on all objects in the scene. Useful for picking. Limited to objects that
7413 * THREE.js can raycast, the solid lines that get their geometry in the shader cannot be tested
7414 * for intersection.
7415 *
7416 * Note, if a {@link DataSource} adds an [[Object3D]]
7417 * to a {@link Tile}, it will be only pickable once
7418 * {@link MapView.render} has been called, this is because
7419 * {@link MapView.render} method creates the
7420 * internal three.js root [[Object3D]] which is used in the [[PickHandler]] internally.
7421 * This method will not test for intersection custom objects added to the scene by for
7422 * example calling directly the [[scene.add]] method from THREE.
7423 *
7424 * @param x - The X position in css/client coordinates (without applied display ratio).
7425 * @param y - The Y position in css/client coordinates (without applied display ratio).
7426 * @returns The list of intersection results.
7427 */
7428 intersectMapObjects(x: number, y: number): PickResult[];
7429 /**
7430 * Resize the HTML canvas element and the THREE.js `WebGLRenderer`.
7431 *
7432 * @param width - The new width.
7433 * @param height - The new height.
7434 */
7435 resize(width: number, height: number): void;
7436 /**
7437 * Redraws scene immediately
7438 *
7439 * @note Before using this method, set `synchronousRendering` to `true`
7440 * in the {@link MapViewOptions}
7441 *
7442 * @param frameStartTime - Optional timestamp for start of frame.
7443 * Default: [[PerformanceTimer.now()]]
7444 */
7445 renderSync(frameStartTime?: number): void;
7446 /**
7447 * Requests a redraw of the scene.
7448 */
7449 update(): void;
7450 /**
7451 * Returns `true` if an update has already been requested, such that after a currently rendering
7452 * frame, the next frame will be rendered immediately.
7453 */
7454 get updatePending(): boolean;
7455 /**
7456 * Requests a redraw of the scene.
7457 * @deprecated Use the [[update]] method instead.
7458 */
7459 requestUpdateIfNeeded(): void;
7460 /**
7461 * Clear the tile cache.
7462 *
7463 * Remove the {@link Tile} objects created by cacheable
7464 * {@link DataSource}s. If a {@link DataSource} name is
7465 * provided, this method restricts the eviction the {@link DataSource} with the given name.
7466 *
7467 * @param dataSourceName - The name of the {@link DataSource}.
7468 */
7469 clearTileCache(dataSourceName?: string): void;
7470 /**
7471 * Apply visitor to all visible tiles.
7472 *
7473 * @param fun - Visitor function
7474 */
7475 forEachVisibleTile(fun: (tile: Tile) => void): void;
7476 /**
7477 * Apply a visitor function to all tiles in the cache.
7478 *
7479 * @param visitor - Visitor function
7480 */
7481 forEachCachedTile(visitor: (tile: Tile) => void): void;
7482 /**
7483 * Visit each tile in visible, rendered, and cached sets.
7484 *
7485 * * Visible and temporarily rendered tiles will be marked for update and retained.
7486 * * Cached but not rendered/visible will be evicted.
7487 *
7488 * @param dataSource - If passed, only the tiles from this {@link DataSource} instance
7489 * are processed. If `undefined`, tiles from all {@link DataSource}s are processed.
7490 */
7491 markTilesDirty(dataSource?: DataSource): void;
7492 /**
7493 * Sets the DataSource which contains the elevations, the elevation range source, and the
7494 * elevation provider. Only a single elevation source is possible per {@link MapView}
7495 *
7496 * If the terrain-datasource is merged with this repository, we could internally construct
7497 * the {@link ElevationRangeSource} and the {@link ElevationProvider}
7498 * and access would be granted to
7499 * the application when it asks for it, to simplify the API.
7500 *
7501 * @param elevationSource - The datasource containing the terrain tiles.
7502 * @param elevationRangeSource - Allows access to the elevation min / max per tile.
7503 * @param elevationProvider - Allows access to the elevation at a given location or a ray
7504 * from the camera.
7505 */
7506 setElevationSource(elevationSource: DataSource, elevationRangeSource: ElevationRangeSource, elevationProvider: ElevationProvider): Promise<void>;
7507 /**
7508 * Clears any elevation sources and provider previously set.
7509 * @param elevationSource - The datasource to be cleared.
7510 */
7511 clearElevationSource(elevationSource: DataSource): void;
7512 /**
7513 * Public access to {@link MapViewFog} allowing to toggle it by setting its `enabled` property.
7514 */
7515 get fog(): MapViewFog;
7516 private setPostEffects;
7517 /**
7518 * Returns the elevation provider.
7519 */
7520 get elevationProvider(): ElevationProvider | undefined;
7521 get shadowsEnabled(): boolean;
7522 set shadowsEnabled(enabled: boolean);
7523 private extractAttitude;
7524 private lookAtImpl;
7525 /**
7526 * Plug-in PolarTileDataSource for spherical projection and plug-out otherwise
7527 */
7528 private updatePolarDataSource;
7529 /**
7530 * Updates the camera and the projections and resets the screen collisions,
7531 * note, setupCamera must be called before this is called.
7532 * @param viewRanges - optional parameter that supplies new view ranges, most importantly
7533 * near/far clipping planes distance. If parameter is not provided view ranges will be
7534 * calculated from [[ClipPlaneEvaluator]] used in {@link VisibleTileSet}.
7535 */
7536 private updateCameras;
7537 /**
7538 * Derive the look at settings (i.e. target, zoom, ...) from the current camera.
7539 */
7540 private updateLookAtSettings;
7541 /**
7542 * Update `Env` instance used for style `Expr` evaluations.
7543 */
7544 private updateEnv;
7545 /**
7546 * Transfer the NDC point to view space.
7547 * @param vector - Vector to transform.
7548 * @param result - Result to place calculation.
7549 */
7550 private ndcToView;
7551 /**
7552 * Transfer from view space to camera space.
7553 * @param viewPos - position in view space, result is stored here.
7554 */
7555 private viewToLightSpace;
7556 /**
7557 * Update the directional light camera. Note, this requires the cameras to first be updated.
7558 */
7559 private updateLights;
7560 /**
7561 * Render loop callback that should only be called by [[requestAnimationFrame]].
7562 * Will trigger [[requestAnimationFrame]] again if updates are pending or animation is running.
7563 * @param frameStartTime - The start time of the current frame
7564 */
7565 private renderLoop;
7566 /**
7567 * Start render loop if not already running.
7568 */
7569 private startRenderLoop;
7570 /**
7571 * Returns the list of the enabled data sources.
7572 */
7573 private getEnabledTileDataSources;
7574 /**
7575 * Renders the current frame.
7576 */
7577 private render;
7578 private renderTileObjects;
7579 /**
7580 * Process dynamic updates of [[TileObject]]'s style.
7581 *
7582 * @returns `true` if object shall be used in scene, `false` otherwise
7583 */
7584 private processTileObject;
7585 /**
7586 * Process the features owned by the given [[TileObject]].
7587 *
7588 * @param tile - The {@link Tile} owning the [[TileObject]]'s features.
7589 * @param object - The [[TileObject]] to process.
7590 * @returns `false` if the given [[TileObject]] should not be added to the scene.
7591 */
7592 private processTileObjectFeatures;
7593 private prepareRenderTextElements;
7594 private finishRenderTextElements;
7595 private initTheme;
7596 private setupCamera;
7597 private createVisibleTileSet;
7598 private updateSkyBackground;
7599 private addNewSkyBackground;
7600 private removeSkyBackGround;
7601 private updateSkyBackgroundColors;
7602 private updateLighting;
7603 private movementStarted;
7604 private movementFinished;
7605 /**
7606 * Check if the set of visible tiles changed since the last frame.
7607 *
7608 * May be called multiple times per frame.
7609 *
7610 * Equality is computed by creating a string containing the IDs of the tiles.
7611 */
7612 private checkIfTilesChanged;
7613 private checkCopyrightUpdates;
7614 private getRenderedTilesCopyrightInfo;
7615 private updateImages;
7616 private loadPoiTables;
7617 private setupStats;
7618 private setupRenderer;
7619 private createTextRenderer;
7620 private resetTextRenderer;
7621 /**
7622 * Default handler for webglcontextlost event.
7623 *
7624 * Note: The renderer `this.m_renderer` may not be initialized when this function is called.
7625 */
7626 private onWebGLContextLost;
7627 /**
7628 * Default handler for webglcontextrestored event.
7629 *
7630 * Note: The renderer `this.m_renderer` may not be initialized when this function is called.
7631 */
7632 private onWebGLContextRestored;
7633 private limitFov;
7634 /**
7635 * Sets the field of view calculation, and applies it immediately to the camera.
7636 *
7637 * @param type - How to calculate the FOV
7638 */
7639 private setFovOnCamera;
7640 /**
7641 * Sets the focal length based on the supplied fov and the height of the canvas. This must be
7642 * called at least once. This is necessary to be recalled when the [[FovCalculation]]'s type is
7643 * fixed. In such cases, when the height changes, the focal length must be readjusted whereas
7644 * the FOV stays the same. The opposite is true for the dynamic case, where the focal length is
7645 * fixed but the FOV changes.
7646 * @param height - Height of the canvas in css / client pixels.
7647 */
7648 private calculateFocalLength;
7649 /**
7650 * Get canvas client size in css/client pixels.
7651 *
7652 * Supports canvases not attached to DOM, which have 0 as `clientWidth` and `clientHeight` by
7653 * calculating it from actual canvas size and current pixel ratio.
7654 */
7655 private getCanvasClientSize;
7656}
7657
7658/**
7659 * Class that provides {@link MapView}'s atmospheric scattering effect.
7660 */
7661export declare class MapViewAtmosphere {
7662 private m_mapAnchors;
7663 private m_sceneCamera;
7664 private m_projection;
7665 private m_updateCallback?;
7666 private m_atmosphereVariant;
7667 private m_materialVariant;
7668 /**
7669 * User data name attribute assigned to created mesh.
7670 */
7671 static SkyAtmosphereUserName: string;
7672 /**
7673 * User data name attribute assigned to created mesh.
7674 */
7675 static GroundAtmosphereUserName: string;
7676 /**
7677 * Check if map anchors have already atmosphere effect added.
7678 *
7679 * @param mapAnchors - MapAnchors to check.
7680 */
7681 static isPresent(mapAnchors: MapAnchors): boolean;
7682 private m_enabled;
7683 private m_skyGeometry?;
7684 private m_skyMaterial?;
7685 private m_skyMesh?;
7686 private m_groundGeometry?;
7687 private m_groundMaterial?;
7688 private m_groundMesh?;
7689 private m_clipPlanesEvaluator;
7690 private readonly m_lightDirection;
7691 /**
7692 * Creates and adds `Atmosphere` effects to the scene.
7693 *
7694 * @note Currently works only with globe projection.
7695 *
7696 * @param m_mapAnchors - The {@link MapAnchors} instance where the effect will be added.
7697 * @param m_sceneCamera - The camera used to render entire scene.
7698 * @param m_projection - The geo-projection used to transform geo coordinates to
7699 * cartesian space.
7700 * @param m_updateCallback - The optional callback to that should be called whenever atmosphere
7701 * configuration changes, may be used to inform related components (`MapView`) to redraw.
7702 * @param m_atmosphereVariant - The optional atmosphere configuration variant enum
7703 * [[AtmosphereVariant]], which denotes where the atmosphere scattering effect should be
7704 * applied, it may be ground or sky atmosphere only or most realistic for both, which is
7705 * chosen by default.
7706 * @param m_materialVariant - The optional material variant to be used, mainly for
7707 * testing and tweaking purposes.
7708 */
7709 constructor(m_mapAnchors: MapAnchors, m_sceneCamera: THREE_2.Camera, m_projection: Projection, m_updateCallback?: (() => void) | undefined, m_atmosphereVariant?: AtmosphereVariant, m_materialVariant?: AtmosphereShadingVariant);
7710 get skyMesh(): THREE_2.Mesh | undefined;
7711 get groundMesh(): THREE_2.Mesh | undefined;
7712 /**
7713 * Allows to enable/disable the atmosphere effect, regardless of the theme settings.
7714 *
7715 * Use this method to change the setup in runtime without defining corresponding theme setup.
7716 *
7717 * @param enable - A boolean that specifies whether the atmosphere should be enabled or
7718 * disabled.
7719 */
7720 set enabled(enable: boolean);
7721 /**
7722 * Returns the current atmosphere status, enabled or disabled.
7723 */
7724 get enabled(): boolean;
7725 set lightMode(lightMode: AtmosphereLightMode);
7726 /**
7727 * Disposes allocated resources.
7728 */
7729 dispose(): void;
7730 /**
7731 * Sets the atmosphere depending on the
7732 * {@link @here/harp-datasource-protocol#Theme} instance provided.
7733 *
7734 * This function is called when a theme is loaded. Atmosphere is added only if the theme
7735 * contains a atmosphere definition with a:
7736 * - `color` property, used to set the atmosphere color.
7737 *
7738 * @param theme - A {@link @here/harp-datasource-protocol#Theme} instance.
7739 */
7740 reset(theme: Theme): void;
7741 private get disposed();
7742 /**
7743 * Handles atmosphere effect adding.
7744 */
7745 private addToMapAnchors;
7746 /**
7747 * Handles atmosphere effect removal.
7748 */
7749 private removeFromMapAnchors;
7750 private createSkyGeometry;
7751 private createGroundGeometry;
7752 private setupSkyForRendering;
7753 private setupGroundForRendering;
7754 private overrideClipPlanes;
7755 private revertClipPlanes;
7756}
7757
7758export declare enum MapViewEventNames {
7759 /** Called before this `MapView` starts to render a new frame. */
7760 Update = "update",
7761 /** Called when the WebGL canvas is resized. */
7762 Resize = "resize",
7763 /** Called when the frame is about to be rendered. */
7764 Render = "render",
7765 /** Called after a frame has been rendered. */
7766 AfterRender = "didrender",
7767 /** Called after the first frame has been rendered. */
7768 FirstFrame = "first-render",
7769 /** Called when the first view has all the necessary tiles loaded and rendered. */
7770 FrameComplete = "frame-complete",
7771 /** Called when the theme has been loaded with the internal {@link ThemeLoader}. */
7772 ThemeLoaded = "theme-loaded",
7773 /** Called when the animation mode has started. */
7774 AnimationStarted = "animation-started",
7775 /** Called when the animation mode has stopped. */
7776 AnimationFinished = "animation-finished",
7777 /** Called when a camera interaction has been detected. */
7778 MovementStarted = "movement-started",
7779 /** Called when a camera interaction has been stopped. */
7780 MovementFinished = "movement-finished",
7781 /** Called when a data source has been connected or failed to connect. */
7782 DataSourceConnect = "datasource-connect",
7783 /** Emitted when copyright info of rendered map has been changed. */
7784 CopyrightChanged = "copyright-changed",
7785 /** Called when the WebGL context is lost. */
7786 ContextLost = "webglcontext-lost",
7787 /** Called when the WebGL context is restored. */
7788 ContextRestored = "webglcontext-restored",
7789 /** Called when camera position has been changed. */
7790 CameraPositionChanged = "camera-changed"
7791}
7792
7793/**
7794 * Base class to create features.
7795 */
7796export declare abstract class MapViewFeature {
7797 coordinates: FeatureGeometry["coordinates"];
7798 properties?: {} | undefined;
7799 /**
7800 * The type of the feature. The extended class should initialize this value. It defaults to
7801 * "Point" in order to avoid allowing `null` or `undefined`.
7802 */
7803 type: FeatureGeometry["type"];
7804 /**
7805 * A string identifying this feature.
7806 */
7807 uuid: string;
7808 /**
7809 * Builds a new `MapViewFeature`.
7810 *
7811 * @param coordinates - The GeoJson geometry.
7812 * @param style - The style to render the geometry.
7813 */
7814 constructor(coordinates: FeatureGeometry["coordinates"], properties?: {} | undefined);
7815}
7816
7817/**
7818 * Manages the fog display in {@link MapView}.
7819 */
7820export declare class MapViewFog {
7821 private m_scene;
7822 private m_enabled;
7823 private m_fog;
7824 private m_fogIsDefined;
7825 private m_cachedTheme;
7826 /**
7827 * Constructs a `MapViewFog` instance.
7828 *
7829 * @param m_scene - The scene used in {@link MapView} that contains the map objects.
7830 */
7831 constructor(m_scene: THREE_2.Scene);
7832 /**
7833 * Allows for disabling the fog, even if it is defined in the theme. Use this property for
7834 * custom views like the demo app's debug camera. However, if the theme does not define a
7835 * fog, enabling this property here has no effect.
7836 *
7837 * @param value - A boolean that specifies whether the fog should be enabled or disabled.
7838 */
7839 set enabled(enableFog: boolean);
7840 /**
7841 * Returns the current fog status, enabled or disabled.
7842 */
7843 get enabled(): boolean;
7844 /**
7845 * Sets the fog depending on the {@link @here/harp-datasource-protocol#Theme}
7846 * instance provided. This function is called when a
7847 * theme is loaded. Fog is added only if the theme contains a fog definition with a:
7848 * - `color` property, used to set the fog color.
7849 * - `startRatio` property, used to set the start distance of the fog as a ratio of the far
7850 * clipping plane distance.
7851 *
7852 * @param theme - A {@link @here/harp-datasource-protocol#Theme} instance.
7853 */
7854 reset(theme: Theme): void;
7855 /**
7856 * Updates the fog at runtime, depending on the camera.
7857 *
7858 * @param camera - An instance of a `THREE.Camera` with a `far` property.
7859 */
7860 update(mapView: MapView, viewDistance?: number): void;
7861 /**
7862 * Handles fog addition.
7863 */
7864 private add;
7865 /**
7866 * Handles fog removal.
7867 */
7868 private remove;
7869 /**
7870 * ThreeJS lets users manage the `RawShaderMaterial` themselves, so they need to be modified
7871 * explicitly.
7872 *
7873 * @see https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLProgram.js#L298
7874 */
7875 private setFogInRawShaderMaterials;
7876}
7877
7878/**
7879 * Cache images wrapped into {@link ImageItem}s for a {@link MapView}.
7880 *
7881 * @remarks
7882 * An image may have multiple names in
7883 * a theme, the `MapViewImageCache` will take care of that.
7884 * Registering multiple images with the
7885 * same name is invalid.
7886 *
7887 * The `MapViewImageCache` uses a global {@link ImageCache} to actually store (and generate) the
7888 * image data.
7889 */
7890export declare class MapViewImageCache {
7891 mapView: MapView;
7892 private m_name2Url;
7893 private m_url2Name;
7894 /**
7895 * The constructor for `MapViewImageCache`.
7896 *
7897 * @param mapView - a {@link MapView} instance.
7898 */
7899 constructor(mapView: MapView);
7900 /**
7901 * Register an existing image by name.
7902 *
7903 * @param name - Name of the image from {@link @here/harp-datasource-protocol#Theme}.
7904 * @param url - URL of image.
7905 * @param image - Optional [[ImageData]] of image.
7906 */
7907 registerImage(name: string | undefined, url: string, image: ImageData | ImageBitmap | undefined): ImageItem;
7908 /**
7909 * Add an image and optionally start loading it. Once done, the [[ImageData]] or [[ImageBitmap]]
7910 * will be stored in the {@link ImageItem}.
7911 *
7912 * @param name - Name of image from {@link @here/harp-datasource-protocol#Theme}.
7913 * @param url - URL of image.
7914 * @param startLoading - Optional. Pass `true` to start loading the image in the background.
7915 */
7916 addImage(name: string, url: string, startLoading?: boolean): ImageItem | Promise<ImageItem | undefined>;
7917 /**
7918 * Find {@link ImageItem} by its name.
7919 *
7920 * @param name - Name of image.
7921 */
7922 findImageByName(name: string): ImageItem | undefined;
7923 /**
7924 * Find {@link ImageItem} by URL.
7925 *
7926 * @param url - Url of image.
7927 */
7928 findImageByUrl(url: string): ImageItem | undefined;
7929 /**
7930 * Load an {@link ImageItem}. Returns a promise or a loaded {@link ImageItem}.
7931 *
7932 * @param imageItem - ImageItem to load.
7933 */
7934 loadImage(imageItem: ImageItem): ImageItem | Promise<ImageItem | undefined>;
7935 /**
7936 * Remove all {@link ImageItem}s from the cache.
7937 *
7938 * @remarks
7939 * Also removes all {@link ImageItem}s that belong to this
7940 * {@link MapView} from the global {@link ImageCache}.
7941 */
7942 clear(): void;
7943 /**
7944 * Returns number of image names stored in the cache.
7945 */
7946 get numberOfNames(): number;
7947 /**
7948 * Returns number of image URLs in the cache.
7949 */
7950 get numberOfUrls(): number;
7951 /**
7952 * Return `true` if an image with the given name is known.
7953 *
7954 * @param name - Name of the image.
7955 */
7956 hasName(name: string): boolean;
7957 /**
7958 * Return `true` if an image with the given URL is known.
7959 * @param url - URL of image.
7960 */
7961 hasUrl(url: string): boolean;
7962 /**
7963 * Return the names under which an image with the given URL is saved.
7964 */
7965 findNames(url: string): string[] | undefined;
7966}
7967
7968export declare class MapViewLineFeature extends MapViewFeature {
7969 coordinates: LineString["coordinates"];
7970 properties?: {} | undefined;
7971 /** @override */
7972 type: LineString["type"];
7973 constructor(coordinates: LineString["coordinates"], properties?: {} | undefined);
7974}
7975
7976export declare class MapViewMultiLineFeature extends MapViewFeature {
7977 coordinates: MultiLineString["coordinates"];
7978 properties?: {} | undefined;
7979 /** @override */
7980 type: MultiLineString["type"];
7981 constructor(coordinates: MultiLineString["coordinates"], properties?: {} | undefined);
7982}
7983
7984export declare class MapViewMultiPointFeature extends MapViewFeature {
7985 coordinates: MultiPoint["coordinates"];
7986 properties?: {} | undefined;
7987 /** @override */
7988 type: MultiPoint["type"];
7989 constructor(coordinates: MultiPoint["coordinates"], properties?: {} | undefined);
7990}
7991
7992export declare class MapViewMultiPolygonFeature extends MapViewFeature {
7993 coordinates: MultiPolygon["coordinates"];
7994 properties?: {} | undefined;
7995 /** @override */
7996 type: MultiPolygon["type"];
7997 constructor(coordinates: MultiPolygon["coordinates"], properties?: {} | undefined);
7998}
7999
8000/**
8001 * User configuration for the {@link MapView}.
8002 */
8003export declare interface MapViewOptions extends TextElementsRendererOptions, Partial<LookAtParams> {
8004 /**
8005 * The canvas element used to render the scene.
8006 */
8007 canvas: HTMLCanvasElement;
8008 /**
8009 * Optional WebGL Rendering Context.
8010 * (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext)
8011 */
8012 context?: WebGLRenderingContext;
8013 /**
8014 * `true` if the canvas contains an alpha (transparency) buffer or not. Default is `false`.
8015 */
8016 alpha?: boolean;
8017 /**
8018 * If `true`adds a Background Mesh for each tile
8019 *
8020 * @default `true`
8021 */
8022 addBackgroundDatasource?: boolean;
8023 /**
8024 * Whether the native WebGL antialiasing should be enabled. It is better to disable it if the
8025 * MapView's MSAA is enabled.
8026 *
8027 * @default `true` for `pixelRatio` < `2.0`, `false` otherwise.
8028 */
8029 enableNativeWebglAntialias?: boolean;
8030 /**
8031 * Antialias settings for the map rendering. It is better to disable the native antialising if
8032 * the custom antialiasing is enabled.
8033 */
8034 customAntialiasSettings?: IMapAntialiasSettings;
8035 /**
8036 * `Projection` used by the `MapView`.
8037 *
8038 * The default value is [[mercatorProjection]].
8039 */
8040 projection?: Projection;
8041 /**
8042 * The URL of the script that the decoder worker runs. The default URL is
8043 * `./decoder.bundle.js`.
8044 *
8045 * Relative URIs are resolved to full URL using the document's base URL
8046 * (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2).
8047 */
8048 decoderUrl?: string;
8049 /**
8050 * The number of Web Workers used to decode data. The default is
8051 * CLAMP(`navigator.hardwareConcurrency` - 1, 1, 2).
8052 */
8053 decoderCount?: number;
8054 /**
8055 * The {@link @here/harp-datasource-protocol#Theme} used by Mapview.
8056 *
8057 * This Theme can be one of the following:
8058 * - `string` : the URI of the theme file used to style this map
8059 * - `Theme` : the `Theme` object already loaded
8060 * - `Promise<Theme>` : the future `Theme` object
8061 * - `undefined` : the theme is not yet set up, but can be set later. Rendering waits until
8062 * the theme is set.
8063 *
8064 * **Note:** Layers that use a theme do not render any content until that theme is available.
8065 *
8066 * Relative URIs are resolved to full URL using the document's base URL
8067 * (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2).
8068 *
8069 * Custom URIs (of theme itself and of resources referenced by theme) may be resolved with help
8070 * of [[uriResolver]].
8071 *
8072 * @see {@link ThemeLoader.load} for details how theme is loaded
8073 */
8074 theme?: string | Theme | Promise<Theme>;
8075 /**
8076 * Resolve `URI` referenced in `MapView` assets using this resolver.
8077 *
8078 * Use, to support application/deployment specific `URI`s into actual `URLs` that can be loaded
8079 * with `fetch`.
8080 *
8081 * Example:
8082 * ```
8083 * uriResolver: new PrefixMapUriResolver({
8084 * "local://poiMasterList": "/assets/poiMasterList.json",
8085 * // will match only 'local//:poiMasterList' and
8086 * // resolve to `/assets/poiMasterList.json`
8087 * "local://icons/": "/assets/icons/"
8088 * // will match only 'local//:icons/ANYPATH' (and similar) and
8089 * // resolve to `/assets/icons/ANYPATH`
8090 * })
8091 * ```
8092 *
8093 * @see {@link @here/harp-utils#UriResolver}
8094 * @See {@link @here/harp-utils#PrefixMapUriResolver}
8095 */
8096 uriResolver?: UriResolver;
8097 /**
8098 * The minimum zoom level; default is `1`.
8099 */
8100 minZoomLevel?: number;
8101 /**
8102 * Determines the minimum camera height, in meters.
8103 */
8104 minCameraHeight?: number;
8105 /**
8106 * The maximum zoom level. The default is `14`.
8107 */
8108 maxZoomLevel?: number;
8109 /**
8110 * User-defined camera clipping planes distance evaluator.
8111 * If not defined, {@link TiltViewClipPlanesEvaluator} will be used by {@link MapView}.
8112 *
8113 * @default {@link TiltViewClipPlanesEvaluator}
8114 */
8115 clipPlanesEvaluator?: ClipPlanesEvaluator;
8116 /**
8117 * Set to true to extend the frustum culling. This improves the rejection of some tiles, which
8118 * normal frustum culling cannot detect. You can disable this property to measure performance.
8119 *
8120 * @default true
8121 */
8122 extendedFrustumCulling?: boolean;
8123 /**
8124 * The maximum number of tiles rendered from one data source at a time.
8125 *
8126 * @default See [[MapViewDefaults.maxVisibleDataSourceTiles]].
8127 */
8128 maxVisibleDataSourceTiles?: number;
8129 /**
8130 * Size of a tile cache for one data source.
8131 *
8132 * @default See [[MapViewDefaults.tileCacheSize]].
8133 */
8134 tileCacheSize?: number;
8135 /**
8136 * Specify if the cache should be counted in tiles or in megabytes.
8137 *
8138 * @see [[MapViewDefaults.resourceComputationType]].
8139 */
8140 resourceComputationType?: ResourceComputationType;
8141 /**
8142 * Limits the number of reduced zoom levels (lower detail)
8143 * to be searched for fallback tiles.
8144 *
8145 * When zooming in, newly elected tiles may have not
8146 * yet loaded. {@link MapView} searches through
8147 * the tile cache for tiles ready to be displayed in
8148 * lower zoom levels. The tiles may be
8149 * located shallower in the quadtree.
8150 *
8151 * To disable a cache search, set the value to `0`.
8152 *
8153 * @default [[MapViewDefaults.quadTreeSearchDistanceUp]]
8154 */
8155 quadTreeSearchDistanceUp?: number;
8156 /**
8157 * Limits the number of higher zoom levels (more detailed)
8158 * to be searched for fallback tiles.
8159 *
8160 * When zooming out, newly elected tiles may have not
8161 * yet loaded. {@link MapView} searches through
8162 * the tile cache for tiles ready to be displayed in
8163 * higher zoom levels. These tiles may be
8164 * located deeper in the quadtree.
8165 *
8166 * To disable a cache search, set the value to `0`.
8167 *
8168 * @default [[MapViewDefaults.quadTreeSearchDistanceDown]]
8169 */
8170 quadTreeSearchDistanceDown?: number;
8171 /**
8172 * Set to `true` to measure performance statistics.
8173 */
8174 enableStatistics?: boolean;
8175 /**
8176 * Preserve the buffers until they are cleared manually or overwritten.
8177 *
8178 * Set to `true` in order to copy {@link MapView} canvas contents
8179 * to an image or another canvas.
8180 *
8181 * @default `false`.
8182 * @see https://threejs.org/docs/#api/renderers/WebGLRenderer.preserveDrawingBuffer
8183 */
8184 preserveDrawingBuffer?: boolean;
8185 /**
8186 * @deprecated Not needed anymore, roads can be picked by default.
8187 */
8188 enableRoadPicking?: boolean;
8189 /**
8190 * Set to `true` to allow picking of technique information associated with objects.
8191 */
8192 enablePickTechnique?: boolean;
8193 /**
8194 * An optional canvas element that renders 2D collision debug information.
8195 */
8196 collisionDebugCanvas?: HTMLCanvasElement;
8197 /**
8198 * Maximum timeout, in milliseconds, before a [[MOVEMENT_FINISHED_EVENT]] is sent after the
8199 * latest frame with a camera movement. The default is 300ms.
8200 */
8201 movementThrottleTimeout?: number;
8202 /**
8203 * How to calculate the Field of View, if not specified, then
8204 * [[DEFAULT_FOV_CALCULATION]] is used.
8205 */
8206 fovCalculation?: FovCalculation;
8207 languages?: string[];
8208 /**
8209 * Sets the data sources to use specific country point of view (political view).
8210 *
8211 * This option may result in rendering different country borders then commonly accepted for
8212 * some regions and it mainly regards to so called __disputed borders__. Although not all
8213 * data sources or themes may support it.
8214 *
8215 * @note Country code should be coded in lower-case ISO 3166-1 alpha-2 standard, if this option
8216 * is `undefined` the majority point of view will be used.
8217 */
8218 politicalView?: string;
8219 /**
8220 * Set fixed pixel ratio for rendering. Useful when rendering on high resolution displays with
8221 * low performance GPUs that may be fill-rate limited.
8222 * @default `window.devicePixelRatio`
8223 */
8224 pixelRatio?: number;
8225 /**
8226 * Set fixed pixel ratio for rendering when the camera is moving or an animation is running.
8227 * Useful when rendering on high resolution displays with low performance GPUs that may be
8228 * fill-rate limited.
8229 *
8230 * If a value is specified, a low resolution render pass is used to render the scene into a
8231 * low resolution render target, before it is copied to the screen.
8232 *
8233 * A value of `undefined` disables the low res render pass. Values between 0.5 and
8234 * `window.devicePixelRatio` can be tried to give good results. The value should not be larger
8235 * than `window.devicePixelRatio`.
8236 *
8237 * @note Since no anti-aliasing is applied during dynamic rendering with `dynamicPixelRatio`
8238 * defined, visual artifacts may occur, especially with thin lines..
8239 *
8240 * @note The resolution of icons and text labels is not affected.
8241 *
8242 * @default `undefined`
8243 */
8244 dynamicPixelRatio?: number;
8245 /**
8246 * Set maximum FPS (Frames Per Second). If VSync in enabled, the specified number may not be
8247 * reached, but instead the next smaller number than `maxFps` that is equal to the refresh rate
8248 * divided by an integer number.
8249 *
8250 * E.g.: If the monitors refresh rate is set to 60hz, and if `maxFps` is set to a value of `40`
8251 * (60hz/1.5), the actual used FPS may be 30 (60hz/2). For displays that have a refresh rate of
8252 * 60hz, good values for `maxFps` are 30, 20, 15, 12, 10, 6, 3 and 1. A value of `0` is ignored.
8253 */
8254 maxFps?: number;
8255 /**
8256 * Enable map repeat for planar projections.
8257 * If `true`, map will be repeated in longitudinal direction continuously.
8258 * If `false`, map will end on lon -180 & 180 deg.
8259 *
8260 * @default `true`
8261 */
8262 tileWrappingEnabled?: boolean;
8263 /**
8264 * Set tiling scheme for [[BackgroundDataSource]]
8265 */
8266 backgroundTilingScheme?: TilingScheme;
8267 /**
8268 * Should be the {@link PolarTileDataSource} used on spherical projection.
8269 * Default is `true`.
8270 */
8271 enablePolarDataSource?: boolean;
8272 /**
8273 * The name of the [[StyleSet]] used by {@link PolarTileDataSource}
8274 * to evaluate for the decoding.
8275 * Default is `"polar"`.
8276 */
8277 polarStyleSetName?: string;
8278 /**
8279 * Storage level offset of regular tiles from reference datasource to align
8280 * {@link PolarTileDataSource} tiles to.
8281 * Default is `-1`.
8282 */
8283 polarGeometryLevelOffset?: number;
8284 /**
8285 * Hint for the WebGL implementation on which power mode to prefer.
8286 */
8287 powerPreference?: MapViewPowerPreference;
8288 /**
8289 * Set to `true` to allow rendering scene synchronously.
8290 *
8291 * By calling `renderSync()` scene draws immediately, opposite to default case when
8292 * `update` method requests redraw and waits for the next animation frame.
8293 *
8294 * You need to set up your own render loop controller.
8295 * Event `MapViewEventNames.Update` fired when {@link MapView} requests for an redraw.
8296 * E.g.: When tiles loaded asynchronously and ready for rendering.
8297 *
8298 * @note Internal `maxFps` will be overridden and may not work properly as `renderSync`
8299 * intended to be called from external render loop.
8300 *
8301 * @default false.
8302 */
8303 synchronousRendering?: boolean;
8304 /**
8305 * Set true to enable rendering mixed levels of detail (increases rendering performance).
8306 * If not set will enable mixed levels of detail for spherical projection
8307 * and disable for other projections.
8308 *
8309 * @default undefined
8310 */
8311 enableMixedLod?: boolean;
8312 /**
8313 * Enable shadows in the map. Shadows will only be casted on features that use the "standard"
8314 * or "extruded-polygon" technique in the map theme.
8315 * @default false
8316 */
8317 enableShadows?: boolean;
8318}
8319
8320export declare class MapViewPointFeature extends MapViewFeature {
8321 coordinates: Point["coordinates"];
8322 properties?: {} | undefined;
8323 /** @override */
8324 type: Point["type"];
8325 constructor(coordinates: Point["coordinates"], properties?: {} | undefined);
8326}
8327
8328/**
8329 * `MapViewPoints` is a class to extend for the `"circles"` and `"squares"` [[Technique]]s to
8330 * implement raycasting of [[THREE.Points]] as expected in
8331 * {@link MapView}, that are in screen space.
8332 * It copies the behaviour of the `raycast` method in [[THREE.Points]] and dispatches it to its
8333 * children classes, {@link Circles} and {@link Squares}, who hold the intersection testing in the
8334 * `testPoint` method. This class also has the ability to dismiss the testing via the
8335 * `enableRayTesting` flag.
8336 *
8337 * Its main motivation is to handle the point styles of XYZ projects.
8338 *
8339 * @see https://github.com/mrdoob/three.js/blob/master/src/objects/Points.js
8340 */
8341export declare abstract class MapViewPoints extends THREE_2.Points {
8342 /**
8343 * This allows to discard the ray testing.
8344 */
8345 enableRayTesting: boolean;
8346 /**
8347 * Implements the intersection testing in screen space between the drawn points and the ray.
8348 *
8349 * @remarks The drawing of the points being different between {@link Circles}
8350 * and {@link Squares}, this method is implemented in these child classes.
8351 *
8352 * @param point - The point to test.
8353 * @param screenPosition - The point position on screen.
8354 * @param pickCoordinates - The picking position on screen.
8355 * @param index - The index of the point in the [[THREE.Geometry]].
8356 * @param distance - The distance between the point and the ray origin.
8357 * @param intersects - The results array.
8358 */
8359 abstract testPoint(point: THREE_2.Vector3, screenPosition: THREE_2.Vector2, pickCoordinates: THREE_2.Vector2, index: number, distance: number, intersects: THREE_2.Intersection[]): void;
8360 /**
8361 * This method is similar to the original method `raycast` in [[THREE.Points]] except that it
8362 * then calls the tailored `testPoint` method in the children classes to test intersections
8363 * depending on whether the points are circles or squares, which [[THREE.Points]] cannot do.
8364 *
8365 * @param raycaster - The raycaster.
8366 * @param intersects - The array to fill with the results.
8367 */
8368 raycast(raycaster: PickingRaycaster, intersects: THREE_2.Intersection[]): void;
8369}
8370
8371export declare class MapViewPolygonFeature extends MapViewFeature {
8372 coordinates: Polygon["coordinates"];
8373 properties?: {} | undefined;
8374 /** @override */
8375 type: Polygon["type"];
8376 constructor(coordinates: Polygon["coordinates"], properties?: {} | undefined);
8377}
8378
8379/**
8380 * Hint for the WebGL implementation on which power mode to prefer.
8381 *
8382 * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12
8383 */
8384export declare enum MapViewPowerPreference {
8385 /** Default value. */
8386 Default = "default",
8387 /** Lower power mode, used to conserve energy. */
8388 LowPower = "low-power",
8389 /** Maximum performance. */
8390 HighPerformance = "high-performance"
8391}
8392
8393export declare namespace MapViewUtils {
8394 const MAX_TILT_DEG = 89;
8395 const MAX_TILT_RAD: number;
8396 /**
8397 * The anti clockwise rotation of an object along the axes of its tangent space, with itself
8398 * as origin.
8399 */
8400 export interface Attitude {
8401 /**
8402 * Rotation of the object along its vertical axis.
8403 */
8404 yaw: number;
8405 /**
8406 * Rotation of the object along its horizontal axis.
8407 */
8408 pitch: number;
8409 /**
8410 * Rotation of the object along its forward axis.
8411 */
8412 roll: number;
8413 }
8414 /**
8415 * Describes estimated usage of memory on heap and GPU.
8416 */
8417 export interface MemoryUsage {
8418 heapSize: number;
8419 gpuSize: number;
8420 }
8421 /**
8422 * Zooms and moves the map in such a way that the given target position remains at the same
8423 * position after the zoom.
8424 *
8425 * @param mapView - Instance of MapView.
8426 * @param targetNDCx - Target x position in NDC space.
8427 * @param targetNDCy - Target y position in NDC space.
8428 * @param zoomLevel - The desired zoom level.
8429 * @param maxTiltAngle - The maximum tilt angle to comply by, in globe projection, in radian.
8430 */
8431 export function zoomOnTargetPosition(mapView: MapView, targetNDCx: number, targetNDCy: number, zoomLevel: number, maxTiltAngle?: number): void;
8432 /**
8433 * Orbits the camera around the focus point of the camera.
8434 *
8435 * @param mapView - The {@link MapView} instance to manipulate.
8436 * @param deltaAzimuthDeg - Delta azimuth in degrees.
8437 * @param deltaTiltDeg - Delta tilt in degrees.
8438 * @param maxTiltAngleRad - The maximum tilt between the camera and its target in radian.
8439 */
8440 export function orbitFocusPoint(mapView: MapView, deltaAzimuthDeg: number, deltaTiltDeg: number, maxTiltAngleRad?: number): void;
8441 /**
8442 * Calculate target (focus) point geo-coordinates for given camera.
8443 * @see getTargetPositionFromCamera
8444 *
8445 * @param camera - The camera looking on target point.
8446 * @param projection - The geo-projection used.
8447 * @param elevation - Optional elevation above (or below) sea level measured in world units.
8448 *
8449 * @deprecated This function is for internal use only and will be removed in the future. Use
8450 * MapView.worldTarget instead.
8451 */
8452 export function getGeoTargetFromCamera(camera: THREE_2.Camera, projection: Projection, elevation?: number): GeoCoordinates | null;
8453 /**
8454 * Calculate target (focus) point world coordinates for given camera position and orientation.
8455 * @param camera - The camera looking on target point.
8456 * @param projection - The geo-projection used.
8457 * @param elevation - Optional elevation above (or below) sea level in world units.
8458 *
8459 * @deprecated This function is for internal use only and will be removed in the future.
8460 */
8461 export function getWorldTargetFromCamera(camera: THREE_2.Camera, projection: Projection, elevation?: number): THREE_2.Vector3 | null;
8462 /**
8463 * @internal
8464 * @deprecated This method will be moved to MapView.
8465 */
8466 export function getTargetAndDistance(projection: Projection, camera: THREE_2.Camera, elevationProvider?: ElevationProvider): {
8467 target: THREE_2.Vector3;
8468 distance: number;
8469 };
8470 /**
8471 * Returns the {@link @here/harp-geoutils#GeoCoordinates} of the camera,
8472 * given its target coordinates on the map and its
8473 * zoom, yaw and pitch.
8474 *
8475 * @param targetCoordinates - Coordinates of the center of the view.
8476 * @param distance - Distance to the target in meters.
8477 * @param yawDeg - Camera yaw in degrees.
8478 * @param pitchDeg - Camera pitch in degrees.
8479 * @param projection - Active MapView, needed to get the camera fov and map projection.
8480 * @param result - Optional output vector.
8481 * @returns Camera position in world space.
8482 */
8483 export function getCameraPositionFromTargetCoordinates(targetCoordinates: GeoCoordinates, distance: number, yawDeg: number, pitchDeg: number, projection: Projection, result?: THREE_2.Vector3): THREE_2.Vector3;
8484 /**
8485 * @hidden
8486 * @internal
8487 *
8488 * Add offset to geo points for minimal view box in flat projection with tile wrapping.
8489 *
8490 * In flat projection, with wrap around enabled, we should detect clusters of points around that
8491 * wrap antimeridian.
8492 *
8493 * Here, we fit points into minimal geo box taking world wrapping into account.
8494 */
8495 export function wrapGeoPointsToScreen(points: GeoCoordLike[], startPosition?: GeoCoordinates): GeoCoordinates[];
8496 /**
8497 * @hidden
8498 * @internal
8499 *
8500 * Given `cameraPos`, force all points that lie on non-visible sphere half to be "near" max
8501 * possible viewable circle from given camera position.
8502 *
8503 * Assumes that shpere projection with world center is in `(0, 0, 0)`.
8504 */
8505 export function wrapWorldPointsToView(points: THREE_2.Vector3[], cameraPos: THREE_2.Vector3): void;
8506 /**
8507 * @hidden
8508 * @internal
8509 *
8510 * Return [[GeoPoints]] bounding {@link @here/harp-geoutils#GeoBox}
8511 * applicable for [[getFitBoundsDistance]].
8512 *
8513 * @returns {@link @here/harp-geoutils#GeoCoordinates} set that covers `box`
8514 */
8515 export function geoBoxToGeoPoints(box: GeoBox): GeoCoordinates[];
8516 /**
8517 * @hidden
8518 * @internal
8519 *
8520 * Get minimal distance required for `camera` looking at `worldTarget` to cover `points`.
8521 *
8522 * All dimensions belong to world space.
8523 *
8524 * @param points - points which shall are to be covered by view
8525 *
8526 * @param worldTarget - readonly, world target of {@link MapView}
8527 * @param camera - readonly, camera with proper `position` and rotation set
8528 * @returns new distance to camera to be used with {@link (MapView.lookAt:WITH_PARAMS)}
8529 */
8530 export function getFitBoundsDistance(points: THREE_2.Vector3[], worldTarget: THREE_2.Vector3, camera: THREE_2.PerspectiveCamera): number;
8531 /**
8532 * @hidden
8533 * @internal
8534 *
8535 * Paremeters for [[getFitBoundsLookAtParams]] function.
8536 */
8537 export interface FitPointParams {
8538 tilt: number;
8539 heading: number;
8540 projection: Projection;
8541 minDistance: number;
8542 camera: THREE_2.PerspectiveCamera;
8543 }
8544 /**
8545 * @hidden
8546 * @internal
8547 *
8548 * Get {@link LookAtParams} that fit all `worldPoints`
8549 * giving that {@link MapView} will target at
8550 * `geoTarget`.
8551 *
8552 * @param geoTarget - desired target (see {@link MapView.target}) as geo point
8553 * @param worldTarget - same as `geoTarget` but in world space
8554 * @param worldPoints - points we want to see
8555 * @param params - other params derived from {@link MapView}.
8556 */
8557 export function getFitBoundsLookAtParams(geoTarget: GeoCoordinates, worldTarget: THREE_2.Vector3, worldPoints: THREE_2.Vector3[], params: FitPointParams): {
8558 target: GeoCoordinates;
8559 distance: number;
8560 heading: number;
8561 tilt: number;
8562 };
8563 /**
8564 * @deprecated use getCameraPositionFromTargetCoordinates instead
8565 */
8566 export function getCameraCoordinatesFromTargetCoordinates(targetCoordinates: GeoCoordinates, distance: number, yawDeg: number, pitchDeg: number, mapView: MapView): GeoCoordinates;
8567 /**
8568 * Casts a ray in NDC space from the current map view and returns the intersection point of that
8569 * ray wih the map in world space.
8570 *
8571 * @param mapView - Instance of MapView.
8572 * @param pointOnScreenXinNDC - X coordinate in NDC space.
8573 * @param pointOnScreenYinNDC - Y coordinate in NDC space.
8574 * @param elevation - Optional param used to offset the ground plane. Used when wanting to pan
8575 * based on a plane at some altitude. Necessary for example when panning with terrain.
8576 *
8577 * @returns Intersection coordinates, or `null` if raycast failed.
8578 */
8579 export function rayCastWorldCoordinates(mapView: MapView, pointOnScreenXinNDC: number, pointOnScreenYinNDC: number, elevation?: number): THREE_2.Vector3 | null;
8580 /**
8581 * Pans the camera according to the projection.
8582 *
8583 * @param mapView - Instance of MapView.
8584 * @param xOffset - In world space. Value > 0 will pan the map to the right, value < 0 will pan
8585 * the map to the left in default camera orientation.
8586 * @param yOffset - In world space. Value > 0 will pan the map upwards, value < 0 will pan the
8587 * map downwards in default camera orientation.
8588 */
8589 export function panCameraAboveFlatMap(mapView: MapView, offsetX: number, offsetY: number): void;
8590 /**
8591 * The function doing a pan in the spherical space
8592 * when {@link MapView}'s active [[ProjectionType]]
8593 * is spherical. In other words, the function that rotates the camera around the globe.
8594 *
8595 * @param mapView - MapView instance.
8596 * @param fromWorld - Start vector representing the scene position of a geolocation.
8597 * @param toWorld - End vector representing the scene position of a geolocation.
8598 */
8599 export function panCameraAroundGlobe(mapView: MapView, fromWorld: THREE_2.Vector3, toWorld: THREE_2.Vector3): void;
8600 /**
8601 * Rotates the camera by the given delta yaw and delta pitch. The pitch will be clamped to the
8602 * maximum possible tilt to the new target, and under the horizon in sphere projection.
8603 *
8604 * @param mapView - The {@link MapView} instance in use.
8605 * @param deltaYawDeg - Delta yaw in degrees.
8606 * @param deltaPitchDeg - Delta pitch in degrees.
8607 * @param maxTiltAngleRad - Max tilt angle in radians.
8608 */
8609 export function rotate(mapView: MapView, deltaYawDeg: number, deltaPitchDeg?: number, maxTiltAngleRad?: number): void;
8610 /**
8611 * Computes the rotation of the camera according to yaw and pitch in degrees. The computations
8612 * hinge on the current `projection` and `target`, because yaw and pitch are defined in
8613 * tangent space of the target point.
8614 *
8615 * **Note:** `yaw == 0 && pitch == 0` will north up the map and you will look downwards onto the
8616 * map.
8617 *
8618 * @param projection - Current projection.
8619 * @param target - The camera target.
8620 * @param yawDeg - Yaw in degrees, counter-clockwise (as opposed to azimuth), starting north.
8621 * @param pitchDeg - Pitch in degrees.
8622 */
8623 export function getCameraRotationAtTarget(projection: Projection, target: GeoCoordinates, yawDeg: number, pitchDeg: number, result?: THREE_2.Quaternion): THREE_2.Quaternion;
8624 /**
8625 * Sets the rotation of the camera according to yaw and pitch in degrees. The computations hinge
8626 * on the current projection and `geoCenter`, because yaw and pitch are defined in tangent
8627 * space. In particular, `MapView#geoCenter` needs to be set before calling `setRotation`.
8628 *
8629 * **Note:** `yaw == 0 && pitch == 0` will north up the map and you will look downwards onto the
8630 * map.
8631 *
8632 * @param mapView - Instance of MapView.
8633 * @param yawDeg - Yaw in degrees, counter-clockwise (as opposed to azimuth), starting north.
8634 * @param pitchDeg - Pitch in degrees.
8635 */
8636 export function setRotation(mapView: MapView, yawDeg: number, pitchDeg: number): void;
8637 /**
8638 * Extracts current camera tilt angle in radians.
8639 *
8640 * @param camera - The [[Camera]] in use.
8641 * @param projection - The {@link @here/harp-geoutils#Projection} used to
8642 * convert between geo and world coordinates.
8643 *
8644 * @deprecated Use MapView.tilt
8645 */
8646 export function extractCameraTilt(camera: THREE_2.Camera, projection: Projection): number;
8647 /**
8648 * Extracts yaw, pitch, and roll rotation in radians.
8649 * - Yaw : Rotation around the vertical axis, counter-clockwise (as opposed to azimuth),
8650 * starting north.
8651 * - Pitch :Rotation around the horizontal axis.
8652 * - Roll : Rotation around the view axis.
8653 *
8654 * @see https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
8655 *
8656 * @param options - Subset of necessary {@link MapView} properties.
8657 * @param object - The [[THREE.Object3D]] instance to extract the rotations from.
8658 */
8659 export function extractAttitude(options: {
8660 projection: Projection;
8661 }, object: THREE_2.Object3D): Attitude;
8662 /**
8663 * Gets the spherical coordinates in radian of the object to the coordinates of `point`.
8664 *
8665 * Note: this method can be used to get the direction that an object points to, when `location`
8666 * is the target of that object, by adding PI to it. Otherwise it only returns the spherical
8667 * coordinates of `object` in the tangent space of `location`.
8668 *
8669 * @param mapView - The {@link MapView} instance to consider.
8670 * @param object - The object to get the coordinates from.
8671 * @param location - The reference point.
8672 */
8673 export function extractSphericalCoordinatesFromLocation(mapView: MapView, object: THREE_2.Object3D, location: GeoCoordinates): {
8674 azimuth: number;
8675 tilt: number;
8676 };
8677 /**
8678 * Gets the tilt angle (in radians) of the object relative to the coordinates of `location`.
8679 *
8680 * Note: this method can be used to get the direction that an object points to, when `location`
8681 * is the target of that object, by adding PI to it. Otherwise it only returns the tilt angle
8682 * (in radians) of `object` in the tangent space of `location`.
8683 *
8684 * @param projection - The {@link @here/harp-geoutils#Projection} used when
8685 * converting from geo to world coordinates.
8686 * @param object - The object to get the coordinates from.
8687 * @param location - The reference point.
8688 */
8689 export function extractTiltAngleFromLocation(projection: Projection, object: THREE_2.Object3D, location: GeoCoordinates): number;
8690 /**
8691 * Get perspective camera frustum planes distances.
8692 * @return all plane distances in helper object.
8693 */
8694 export function getCameraFrustumPlanes(camera: THREE_2.PerspectiveCamera): {
8695 left: number;
8696 right: number;
8697 top: number;
8698 bottom: number;
8699 near: number;
8700 far: number;
8701 };
8702 /**
8703 * Casts a ray in NDC space from the current view of the camera and returns the intersection
8704 * point of that ray against the map in geo coordinates. The return value can be `null` when
8705 * the raycast is above the horizon.
8706 *
8707 * @param mapView - Instance of MapView.
8708 * @param pointOnScreenXNDC - Abscissa in NDC space.
8709 * @param pointOnScreenYNDC - Ordinate in NDC space.
8710 * @returns Intersection geo coordinates, or `null` if raycast is above the horizon.
8711 */
8712 export function rayCastGeoCoordinates(mapView: MapView, pointOnScreenXinNDC: number, pointOnScreenYinNDC: number): GeoCoordinates | null;
8713 /**
8714 * Calculates and returns the distance from the ground, which is needed to put the camera to
8715 * this height, to see the size of the area that would be covered by one tile for the given zoom
8716 * level.
8717 *
8718 * @param mapView - Instance of MapView.
8719 * @param options - Subset of necessary {@link MapView} properties.
8720 */
8721 export function calculateDistanceToGroundFromZoomLevel(options: {
8722 projection: Projection;
8723 focalLength: number;
8724 camera: THREE_2.Object3D;
8725 }, zoomLevel: number): number;
8726 /**
8727 * Calculates and returns the distance to the target point.
8728 *
8729 * @param options - Necessary subset of MapView properties to compute the distance.
8730 * @param zoomLevel - The zoom level to get the equivalent height to.
8731 */
8732 export function calculateDistanceFromZoomLevel(options: {
8733 focalLength: number;
8734 }, zoomLevel: number): number;
8735 /**
8736 * Calculates the zoom level, which corresponds to the current distance from
8737 * camera to lookAt point.
8738 * Therefore the zoom level is a `float` and not an `int`. The height of the camera can be in
8739 * between zoom levels. By setting the zoom level, you change the height position of the camera
8740 * in away that the field of view of the camera should be able to cover one tile for the given
8741 * zoom level.
8742 *
8743 * As an example for this, when you have a tile of zoom level 14 in front of the camera and you
8744 * set the zoom level of the camera to 14, then you are able to see the whole tile in front of
8745 * you.
8746 *
8747 * @param options - Subset of necessary {@link MapView} properties.
8748 * @param distance - The distance in meters, which are scene units in {@link MapView}.
8749 */
8750 export function calculateZoomLevelFromDistance(options: {
8751 focalLength: number;
8752 minZoomLevel: number;
8753 maxZoomLevel: number;
8754 }, distance: number): number;
8755 /**
8756 * Translates a linear clip-space distance value to the actual value stored in the depth buffer.
8757 * This is useful as the depth values are not stored in the depth buffer linearly, and this can
8758 * lead into confusing behavior when not taken into account.
8759 *
8760 * @param clipDistance - Distance from the camera in clip space (range: [0, 1]).
8761 * @param camera - Camera applying the perspective projection.
8762 */
8763 export function calculateDepthFromClipDistance(clipDistance: number, camera: THREE_2.Camera): number;
8764 /**
8765 * Translates a linear distance value [0..1], where 1 is the distance to the far plane, into
8766 * [0..cameraFar].
8767 *
8768 * @param distance - Distance from the camera (range: [0, 1]).
8769 * @param camera - Camera applying the perspective projection.
8770 */
8771 export function cameraToWorldDistance(distance: number, camera: THREE_2.Camera): number;
8772 /**
8773 * Calculates vertical field of view for given horizontal field of vision and aspect ratio.
8774 *
8775 * @param hFov - Horizontal field of view in rad.
8776 * @param aspect - Aspect ratio.
8777 */
8778 export function calculateVerticalFovByHorizontalFov(hFov: number, aspect: number): number;
8779 /**
8780 * Calculates horizontal field of view for given vertical field of vision and aspect ratio.
8781 *
8782 * @param hFov - Vertical field of view in rad.
8783 * @param aspect - Aspect ratio.
8784 */
8785 export function calculateHorizontalFovByVerticalFov(vFov: number, aspect: number): number;
8786 /**
8787 * Calculates the focal length based on the vertical FOV and height.
8788 *
8789 * @param vFov - Vertical field of view in rad.
8790 * @param height - Height of canvas in pixels.
8791 */
8792 export function calculateFocalLengthByVerticalFov(vFov: number, height: number): number;
8793 /**
8794 * Calculates the vertical field of view based on the focal length and the height.
8795 *
8796 * @param focalLength - Focal length in pixels (see [[calculateFocalLengthByVerticalFov]])
8797 * @param height - Height of canvas in pixels.
8798 */
8799 export function calculateFovByFocalLength(focalLength: number, height: number): number;
8800 /**
8801 * Calculates object's screen size based on the focal length and it's camera distance.
8802 *
8803 * @param focalLength - Focal length in pixels (see [[calculateFocalLengthByVerticalFov]])
8804 * @param distance - Object distance in world space.
8805 * @param worldSize - Object size in world space.
8806 * @return object size in screen space.
8807 */
8808 export function calculateScreenSizeByFocalLength(focalLength: number, distance: number, worldSize: number): number;
8809 /**
8810 * Calculates object's world size based on the focal length and it's camera distance.
8811 *
8812 * @param focalLength - Focal length in pixels (see [[calculateFocalLengthByVerticalFov]])
8813 * @param distance - Object distance in world space.
8814 * @param screenSize - Object size in screen space.
8815 * @return object size in world space.
8816 */
8817 export function calculateWorldSizeByFocalLength(focalLength: number, distance: number, screenSize: number): number;
8818 /**
8819 * Computes estimate for size of a THREE.Object3D object and its children. Shared materials
8820 * and/or attributes will be counted multiple times.
8821 *
8822 * @param object - The mesh object to evaluate
8823 * @param size - The {@link MemoryUsage} to update.
8824 * @param visitedObjects - Optional map to store large objects that could be shared.
8825 *
8826 * @returns Estimate of object size in bytes for heap and GPU.
8827 */
8828 export function estimateObject3dSize(object: THREE_2.Object3D, parentSize?: MemoryUsage, visitedObjects?: Map<string, boolean>): MemoryUsage;
8829 /**
8830 * Check if tiles or other content is currently being loaded.
8831 *
8832 * This method can be removed once HARP-7932 is implemented.
8833 *
8834 * @returns `true` if MapView has visible tiles or other content that is being loaded.
8835 */
8836 export function mapViewIsLoading(mapView: MapView): boolean;
8837 /**
8838 * Gets language list used by the browser
8839 *
8840 * @returns Array of iso language codes
8841 */
8842 export function getBrowserLanguages(): string[] | undefined;
8843}
8844
8845/**
8846 * Technique that describes icons with labels. Used in [[PoiTechnique]] and [[LineMarkerTechnique]]
8847 * (for road shields).
8848 */
8849export declare interface MarkerTechniqueParams extends BaseTechniqueParams {
8850 /**
8851 * Text to be displayed for feature.
8852 *
8853 * Defaults to first defined:
8854 * - feature property `label` if present in technique (deprecated)
8855 * - `["get", "name:short"]` is `useAbbreviation` is true
8856 * - `["get", "iso_code"]` is `useIsoCode` is true
8857 * - `["get", "name:$LANGUAGE"]` for each specified language
8858 * - `["get", "name"]`
8859 *
8860 * See [[ExtendedTileInfo.getFeatureText]]
8861 */
8862 text?: DynamicProperty<string>;
8863 /**
8864 * Field name of object containing the text to be rendered.
8865 *
8866 * @deprecated Use `["get", "FIELD"]`.
8867 */
8868 label?: string;
8869 /**
8870 * If `true`, the abbreviation (field `name:short`) of the elements is used as text.
8871 *
8872 * @deprecated Use proper expression with [`get`, `name:short`] for this purpose.
8873 */
8874 useAbbreviation?: boolean;
8875 /**
8876 * If `true`, the iso code (field 'iso_code') of the elements is used as text.
8877 * The `iso_code` field contains the ISO 3166-1 2-letter country code.
8878 *
8879 * @deprecated Use proper expression with [`get`, `iso_code`] for this purpose.
8880 */
8881 useIsoCode?: boolean;
8882 /**
8883 * Priority of marker, defaults to `0`. Markers with highest priority get placed first.
8884 */
8885 priority?: DynamicProperty<number>;
8886 /**
8887 * Minimum zoomLevel at which to display the label text. No default.
8888 */
8889 textMinZoomLevel?: number;
8890 /**
8891 * Maximum zoomLevel at which to display the label text. No default.
8892 */
8893 textMaxZoomLevel?: number;
8894 /**
8895 * Minimum zoomLevel at which to display the label icon. No default.
8896 */
8897 iconMinZoomLevel?: number;
8898 /**
8899 * Maximum zoomLevel at which to display the label icon. No default.
8900 */
8901 iconMaxZoomLevel?: number;
8902 /**
8903 * Icon color.
8904 *
8905 * If specified, combined using multiplication with color value read from icon texture.
8906 *
8907 * Works best for grayscale or monochromatic textures.
8908 */
8909 iconColor?: StyleColor;
8910 /**
8911 * Icon brightness.
8912 *
8913 * Factor that multiplies a color on top of the icon texture (and `iconColor`) with `0` being
8914 * fully black as final output, `1` being the original rgb colors of the texture.
8915 *
8916 * @default `1`
8917 */
8918 iconBrightness?: number;
8919 /**
8920 * Scaling factor of icon. Defaults to 0.5, reducing the size ot 50% in the distance.
8921 */
8922 distanceScale?: number;
8923 /**
8924 * If `false`, text may overlap markers.
8925 * @default `false`
8926 */
8927 textMayOverlap?: boolean;
8928 /**
8929 * If `false`, the icon may overlap text and other icons of lower priority. If not defined, the
8930 * property value from `textMayOverlap` will be used.
8931 * @default `false`
8932 */
8933 iconMayOverlap?: boolean;
8934 /**
8935 * If `false`, text will not reserve screen space, other markers will be able to overlap.
8936 * @default `true`
8937 */
8938 textReserveSpace?: boolean;
8939 /**
8940 * If `false`, icon will not reserve screen space, other markers will be able to overlap. If not
8941 * defined, the property value from `iconReserveSpace` will be used.
8942 * @default `true`
8943 */
8944 iconReserveSpace?: boolean;
8945 /**
8946 * If `false`, text will not be rendered during animations. Defaults to `true`.
8947 */
8948 renderTextDuringMovements?: boolean;
8949 /**
8950 * If `true`, the label will always be rendered on top. If overlapping with other labels with
8951 * this flag set, the render order is undefined.
8952 * @default `false`
8953 */
8954 alwaysOnTop?: boolean;
8955 /**
8956 * If `true`, icon will appear even if the text part is blocked by other labels. Defaults to
8957 * `false`.
8958 */
8959 textIsOptional?: boolean;
8960 /**
8961 * Should be displayed on map or not. Defaults to `true`.
8962 */
8963 showOnMap?: boolean;
8964 /**
8965 * Specify stack mode. Defaults to `ShowInStack`.
8966 */
8967 stackMode?: PoiStackMode;
8968 /**
8969 * Minimal distance between markers in screen pixels.
8970 */
8971 minDistance?: number;
8972 /**
8973 * If true, the text will appear even if the icon cannot be rendered because of missing icon
8974 * graphics. Defaults to `true`.
8975 */
8976 iconIsOptional?: boolean;
8977 /**
8978 * Fading time for labels in seconds.
8979 */
8980 textFadeTime?: number;
8981 /**
8982 * Fading time for icons in seconds.
8983 */
8984 iconFadeTime?: number;
8985 /**
8986 * Horizontal offset (to the right) in screen pixels.
8987 */
8988 xOffset?: DynamicProperty<number>;
8989 /**
8990 * Vertical offset (up) in screen pixels.
8991 */
8992 yOffset?: DynamicProperty<number>;
8993 /**
8994 * Horizontal offset (to the right) in screen pixels.
8995 */
8996 iconXOffset?: DynamicProperty<number>;
8997 /**
8998 * Vertical offset (up) in screen pixels.
8999 */
9000 iconYOffset?: DynamicProperty<number>;
9001 /**
9002 * Scaling factor of icon.
9003 */
9004 iconScale?: number;
9005 /**
9006 * Vertical height in pixels, controls vertical scaling. Overrides `iconScale`.
9007 */
9008 screenHeight?: DynamicProperty<number>;
9009 /**
9010 * Horizontal height in pixels, controls horizontal scaling. Overrides `iconScale`.
9011 */
9012 screenWidth?: DynamicProperty<number>;
9013 /**
9014 * Name of the POI table which should be used for this POI.
9015 */
9016 poiTable?: string;
9017 /**
9018 * Fixed name to identify POI options in the POI table. If `poiName` has a value, this value
9019 * supersedes any value read from the field referenced in `poiNameField`.
9020 */
9021 poiName?: string;
9022 /**
9023 * Name of the field to evaluate to get the name of the POI options in the POI table.
9024 */
9025 poiNameField?: string;
9026 /**
9027 * Name of [[ImageTexture]] definition to use.
9028 */
9029 imageTexture?: DynamicProperty<string>;
9030 /**
9031 * Field name to extract imageTexture content from.
9032 */
9033 imageTextureField?: string;
9034 /**
9035 * Prefix for `imageTexture` if `imageTextureField` is used.
9036 */
9037 imageTexturePrefix?: string;
9038 /**
9039 * Postfix for `imageTexture` if `imageTextureField` is used.
9040 */
9041 imageTexturePostfix?: string;
9042 /**
9043 * Name of the text style.
9044 */
9045 style?: string;
9046 /**
9047 * Name of the preferred [[Font]] to be used when rendering.
9048 */
9049 fontName?: string;
9050 /**
9051 * Size of the text (pixels).
9052 */
9053 size?: DynamicProperty<number>;
9054 /**
9055 * Size of the text background (pixels).
9056 */
9057 backgroundSize?: DynamicProperty<number>;
9058 /**
9059 * Glyph style to apply for the currently active [[Font]].
9060 */
9061 fontStyle?: "Regular" | "Bold" | "Italic" | "BoldItalic";
9062 /**
9063 * Glyph variant to apply for the currently active [[Font]].
9064 */
9065 fontVariant?: "Regular" | "AllCaps" | "SmallCaps";
9066 /**
9067 * Glyph local rotation (radians).
9068 */
9069 rotation?: number;
9070 /**
9071 * Text color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
9072 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
9073 * @format color-hex
9074 */
9075 color?: DynamicProperty<StyleColor>;
9076 /**
9077 * Text background color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`,
9078 * `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
9079 * @format color-hex
9080 */
9081 backgroundColor?: DynamicProperty<StyleColor>;
9082 /**
9083 * For transparent text, set a value between 0.0 for totally transparent, to 1.0 for totally
9084 * opaque.
9085 */
9086 opacity?: DynamicProperty<number>;
9087 /**
9088 * Background text opacity value.
9089 */
9090 backgroundOpacity?: DynamicProperty<number>;
9091 /**
9092 * Inter-glyph spacing (pixels). Scaled by `size`.
9093 */
9094 tracking?: DynamicProperty<number>;
9095 /**
9096 * Inter-line spacing (pixels). Scaled by `size`.
9097 */
9098 leading?: DynamicProperty<number>;
9099 /**
9100 * Maximum number of lines for this label.
9101 */
9102 maxLines?: DynamicProperty<number>;
9103 /**
9104 * Maximum line width (pixels).
9105 */
9106 lineWidth?: DynamicProperty<number>;
9107 /**
9108 * [[TextCanvas]] rotation (radians).
9109 */
9110 canvasRotation?: DynamicProperty<number>;
9111 /**
9112 * Line typesetting rotation (radians).
9113 */
9114 lineRotation?: DynamicProperty<number>;
9115 /**
9116 * Wrapping (line-breaking) mode.
9117 */
9118 wrappingMode?: DynamicProperty<"None" | "Character" | "Word">;
9119 /**
9120 * Text position regarding the baseline.
9121 *
9122 * @note The [[placements]] attribute may override the alignment settings.
9123 */
9124 hAlignment?: DynamicProperty<"Left" | "Center" | "Right">;
9125 /**
9126 * Text position inside a line.
9127 *
9128 * @note The [[placements]] attribute may supersede it.
9129 */
9130 vAlignment?: DynamicProperty<"Above" | "Center" | "Below">;
9131 /**
9132 * Text label positions relative to the label central position (anchor point).
9133 *
9134 * This attribute defines a comma separated tokens of possible text placements
9135 * relative to label central position (anchor), for example: "TL, TR, C".
9136 * Keep in mind that horizontal placement defines text position in opposite way to
9137 * the alignment, so the text `R` placed (located on the **right side** of label position)
9138 * will be the same as `Left` aligned by deduction. On other side vertical placement is quite
9139 * similar to vertical alignment so `T` placement corresponds with `Above` alignment.
9140 *
9141 * @note This attribute may override [[hAlignment]] and [[vAlignment]] if defined.
9142 */
9143 placements?: string;
9144 /**
9145 * World space offset in meters applied to the icon. Valid only for icons which have the
9146 * "offset_direction" property as an attribute of the data.
9147 */
9148 worldOffset?: DynamicProperty<number>;
9149}
9150
9151/**
9152 * A node representing a `match` expression.
9153 */
9154export declare class MatchExpr extends Expr {
9155 readonly value: Expr;
9156 readonly branches: Array<[MatchLabel, Expr]>;
9157 readonly fallback: Expr;
9158 /**
9159 * Tests if the given JSON node is a valid label for the `"match"` operator.
9160 *
9161 * @param node - A JSON value.
9162 */
9163 static isValidMatchLabel(node: JsonValue): node is MatchLabel;
9164 constructor(value: Expr, branches: Array<[MatchLabel, Expr]>, fallback: Expr);
9165 /** @override */
9166 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
9167 /** @override */
9168 protected exprIsDynamic(): boolean;
9169}
9170
9171/**
9172 * The labels of a {@link MatchExpr} expression.
9173 */
9174export declare type MatchLabel = number | string | number[] | string[];
9175
9176/**
9177 * Generic material type constructor.
9178 */
9179export declare type MaterialConstructor = new (params?: {}) => THREE_2.Material;
9180
9181/**
9182 * The structure of the options to pass into [[createMaterial]].
9183 */
9184export declare interface MaterialOptions {
9185 /**
9186 * The shader [[Technique]] to choose.
9187 */
9188 technique: Technique;
9189 /**
9190 * Environment used to evaluate dynamic technique attributes.
9191 *
9192 * Usually {@link MapView.env}.
9193 */
9194 env: Env;
9195 /**
9196 * Properties to skip.
9197 *
9198 * @see [[applyTechniqueToMaterial]]
9199 */
9200 skipExtraProps?: string[];
9201 /**
9202 * `RawShaderMaterial` instances need to know about the fog at instantiation in order to avoid
9203 * recompiling them manually later (ThreeJS does not update fog for `RawShaderMaterial`s).
9204 */
9205 fog?: boolean;
9206 /**
9207 * Whether shadows are enabled or not, this is required because we change the material used.
9208 */
9209 shadowsEnabled?: boolean;
9210}
9211
9212declare namespace Math2D {
9213 /**
9214 * Alternative 2D box object with less memory impact (four numbers instead of two min/max
9215 * objects with two numbers each). Should be faster.
9216 */
9217 class Box {
9218 x: number;
9219 y: number;
9220 w: number;
9221 h: number;
9222 /**
9223 * Alternative 2D box object with less memory impact (four numbers instead of two min/max
9224 * objects with two numbers each). Should be faster.
9225 *
9226 * @param x - New X value.
9227 * @param y - New y value.
9228 * @param w - New w value.
9229 * @param h - New h value.
9230 */
9231 constructor(x?: number, y?: number, w?: number, h?: number);
9232 /**
9233 * Set new values to all properties of the box.
9234 *
9235 * @param x - New X value.
9236 * @param y - New y value.
9237 * @param w - New w value.
9238 * @param h - New h value.
9239 */
9240 set(x: number, y: number, w: number, h: number): void;
9241 /**
9242 * Test box for inclusion of point.
9243 *
9244 * @param x - X coordinate of point.
9245 * @param y - Y coordinate of point.
9246 */
9247 contains(x: number, y: number): boolean;
9248 /**
9249 * Test box for inclusion of another box.
9250 *
9251 * @param other - Box 2 to test for inclusion.
9252 */
9253 containsBox(other: Box): boolean;
9254 /**
9255 * Test two boxes for intersection.
9256 *
9257 * @param other - Box 2 to test for intersection.
9258 */
9259 intersects(other: Box): boolean;
9260 }
9261 /**
9262 * Box to store UV coordinates.
9263 */
9264 interface UvBox {
9265 s0: number;
9266 t0: number;
9267 s1: number;
9268 t1: number;
9269 }
9270 /**
9271 * Compute squared distance between two 2D points `a` and `b`.
9272 *
9273 * @param ax - Point a.x
9274 * @param ay - Point a.y
9275 * @param bx - Point b.x
9276 * @param by - Point b.y
9277 * @returns Squared distance between the two points
9278 */
9279 function distSquared(ax: number, ay: number, bx: number, by: number): number;
9280 /**
9281 * Computes the squared length of a line.
9282 *
9283 * @param line - An array of that forms a line via [x,y,z,x,y,z,...] tuples.
9284 */
9285 function computeSquaredLineLength(line: number[]): number;
9286 /**
9287 * Compute squared distance between a 2D point and a 2D line segment.
9288 *
9289 * @param px - Test point X
9290 * @param py - Test point y
9291 * @param l0x - Line segment start X
9292 * @param l0y - Line segment start Y
9293 * @param l1x - Line segment end X
9294 * @param l1y - Line segment end Y
9295 * @returns Squared distance between point and line segment
9296 */
9297 function distToSegmentSquared(px: number, py: number, l0x: number, l0y: number, l1x: number, l1y: number): number;
9298}
9299
9300export declare namespace MathUtils {
9301 /**
9302 * Creates a new empty bounding box.
9303 *
9304 * @deprecated Use {@link https://threejs.org/docs/#api/en/math/Box3 | THREE.Box3} instead.
9305 */
9306 export function newEmptyBox3(): Box3Like;
9307 /**
9308 * Creates a new [Vector3Like] instance.
9309 *
9310 * @param x - The x component.
9311 * @param y - The y component.
9312 * @param z - The z component.
9313 */
9314 export function newVector3(x: number, y: number, z: number): Vector3Like;
9315 /**
9316 * Creates a new [Vector3Like] instance.
9317 *
9318 * @param x - The x component.
9319 * @param y - The y component.
9320 * @param z - The z component.
9321 * @param v - The resulting [Vector3Like] instance.
9322 */
9323 export function newVector3<Vector extends Vector3Like>(x: number, y: number, z: number, v: Vector): Vector;
9324 /**
9325 * Copies the vector across.
9326 *
9327 * @param from - The vector to copy from.
9328 * @param to - The resulting [Vector3Like] instance, with the contents copied from from
9329 */
9330 export function copyVector3<Vector extends Vector3Like>(from: Vector3Like, to: Vector): Vector;
9331 /**
9332 * Converts an angle measured in degrees to an equivalent value in radians.
9333 *
9334 * @param degrees - Value in degrees.
9335 * @returns Value in radians.
9336 * @deprecated use THREE.MathUtils.degToRad instead
9337 */
9338 const degToRad: typeof THREE_2.MathUtils.degToRad;
9339 /**
9340 * Converts an angle measured in radians to an equivalent value in degrees.
9341 *
9342 * @param degrees - Value in radians.
9343 * @returns Value in degrees.
9344 * @deprecated Use {@link https://threejs.org/docs/#api/en/math/MathUtils.radToDeg
9345 * | THREE.MathUtils.radToDeg}.
9346 */
9347 const radToDeg: typeof THREE_2.MathUtils.radToDeg;
9348 /**
9349 * Ensures that input value fits in a given range.
9350 *
9351 * @param value - The value to be clamped.
9352 * @param min - Minimum value.
9353 * @param max - Maximum value.
9354 * @returns Clamped value.
9355 * @deprecated Use {@link https://threejs.org/docs/#api/en/math/MathUtils.clamp
9356 * | THREE.MathUtils.clamp}.
9357 */
9358 const clamp: typeof THREE_2.MathUtils.clamp;
9359 /**
9360 * Normalize angle in degrees to range `[0, 360)`.
9361 *
9362 * @param a - Angle in degrees.
9363 * @returns Angle in degrees in range `[0, 360)`.
9364 */
9365 export function normalizeAngleDeg(a: number): number;
9366 /**
9367 * Normalize latitude angle in degrees to range `[-180, 180]`.
9368 *
9369 * @param a - Latitude angle in degrees.
9370 * @returns Latitude angle in degrees in range `[-180, 180]`.
9371 */
9372 export function normalizeLongitudeDeg(a: number): number;
9373 /**
9374 * Return the minimal delta between angles `a` and `b` given in degrees.
9375 *
9376 * Equivalent to `a - b` in coordinate space with exception vector direction can be reversed
9377 * that if `abs(a-b) > 180` because trip is shorter in 'other' direction.
9378 *
9379 * Useful when interpolating between `b` and `a` in angle space.
9380 *
9381 * @param a - Start angle in degrees.
9382 * @param b - End angle in degrees.
9383 * @returns Angle that that satisfies condition `a - b - d = 0` in angle space.
9384 */
9385 export function angleDistanceDeg(a: number, b: number): number;
9386 /**
9387 * Interpolate linearly between two angles given in degrees.
9388 *
9389 * @param p0 - Angle from in degrees
9390 * @param p1 - Angle to in degrees
9391 * @param t - Interpolation factor (alpha), in range `0-1`.
9392 */
9393 export function interpolateAnglesDeg(p0: number, p1: number, t: number): number;
9394}
9395
9396/**
9397 * Optional parameters passed on [[TextCanvas]].`measureText` function call.
9398 */
9399declare interface MeasurementParameters {
9400 /**
9401 * Path where text should be placed on. Overrides the original position parameter.
9402 */
9403 path?: THREE_2.Path | THREE_2.CurvePath<THREE_2.Vector2>;
9404 /**
9405 * If `true`, text on a path will be placed even when its size its bigger than the path's size.
9406 */
9407 pathOverflow?: boolean;
9408 /**
9409 * Output per-character bounds.
9410 */
9411 outputCharacterBounds?: THREE_2.Box2[];
9412 /**
9413 * Array containing info on whether the glyphs are upper or lower case. Needed to support
9414 * `SmallCaps`.
9415 */
9416 letterCaseArray?: boolean[];
9417}
9418
9419/**
9420 * Describes estimated usage of memory on heap and GPU.
9421 */
9422declare interface MemoryUsage {
9423 heapSize: number;
9424 gpuSize: number;
9425}
9426
9427export declare class MercatorConstants {
9428 static readonly MAXIMUM_LATITUDE: number;
9429}
9430
9431/**
9432 * Mercator {@link Projection} used to convert geo coordinates to world coordinates and vice versa.
9433 */
9434export declare const mercatorProjection: Projection;
9435
9436/**
9437 * The {@link TilingScheme} used by the HERE web tiles.
9438 *
9439 * The `mercatorTilingScheme` features a quadtree subdivision scheme and a Mercator projection.
9440 */
9441export declare const mercatorTilingScheme: TilingScheme;
9442
9443/**
9444 * Available texture minification filters.
9445 */
9446export declare type MinFilter = "nearest" | "nearestMipMapNearest" | "nearestMipMapLinear" | "linear" | "linearMipMapNearest" | "linearMipMapLinear";
9447
9448/**
9449 * {@link MapView}'s MSAA implementation.
9450 *
9451 * @remarks
9452 * MSAA stands for Multi Sampling Anti-Aliasing, and its concept
9453 * is to provide a rendering engine with additional color values for each pixel, so they can include
9454 * the missing bits between them on a screen. WebGL already comes with a native MSAA implementation
9455 * with four samples. Because of its native nature, it is more efficient and one may not want to use
9456 * MapView's MSAA implementation when these four samples are satisfying. However in some situations
9457 * they are not: on low devices, MSAA can impact the framerate and we may desire to reduce the
9458 * number of samples at runtime. On the other hand, when the interaction stops, the engine also
9459 * stops rendering the map, and because a map relies on many line-like patterns, aliasing can then
9460 * turn very noticeable. In such static renders, the number of samples could be dramatically
9461 * increased on a last frame to render.
9462 */
9463export declare class MSAARenderPass extends Pass {
9464 /**
9465 * The sampling level determines the number of samples that will be performed per frame.
9466 * Renders will happen `2 ^ samplingLevel` time(s). `samplingLevel` stands between `0` and `5`.
9467 * Therefore there can be between 1 and 32 samples.
9468 *
9469 * @default `SamplingLevel.Level_1`
9470 */
9471 samplingLevel: MSAASampling;
9472 private m_renderTarget;
9473 private readonly m_localCamera;
9474 private readonly m_quadScene;
9475 private readonly m_quadUniforms;
9476 private readonly m_quadMaterial;
9477 private readonly m_quad;
9478 /**
9479 * The constructor for `MSAARenderPass`. It builds an internal scene with a camera looking at a
9480 * quad.
9481 *
9482 * @param m_scene - The scene to render.
9483 * @param m_camera - The camera to render the scene through.
9484 */
9485 constructor();
9486 /**
9487 * Releases all used resources.
9488 */
9489 dispose(): void;
9490 /**
9491 * The render function of `MSAARenderPass`.
9492 *
9493 * @remarks
9494 * At each call of this method, and for each sample the {@link MapView}
9495 * camera provided in the `render method is offset within the dimension of a
9496 * pixel on screen. It then renders the whole scene with this offset to a local
9497 * `WebGLRenderTarget` instance, via a `WebGLRenderer` instance. Finally the local camera
9498 * created in the constructor shoots the quad and renders to the write buffer or to the frame
9499 * buffer. The quad material's opacity is modified so the renders can accumulate in the
9500 * targetted buffer.
9501 *
9502 * The number of samples can be modified at runtime through the enum [[SamplingLevel]].
9503 *
9504 * If there is no further pass, the {@link Pass.renderToScreen} flag can be set to `true` to
9505 * output directly to the framebuffer.
9506 *
9507 * @param renderer - The ThreeJS WebGLRenderer instance to render the scene with.
9508 * @param scene - The ThreeJS Scene instance to render the scene with.
9509 * @param camera - The ThreeJS Camera instance to render the scene with.
9510 * @param writeBuffer - A ThreeJS WebGLRenderTarget instance to render the scene to.
9511 * @param readBuffer - A ThreeJS WebGLRenderTarget instance to render the scene.
9512 * @override
9513 */
9514 render(renderer: THREE_2.WebGLRenderer, scene: THREE_2.Scene, camera: THREE_2.PerspectiveCamera | THREE_2.OrthographicCamera, writeBuffer: THREE_2.WebGLRenderTarget | null, readBuffer: THREE_2.WebGLRenderTarget): void;
9515 /**
9516 * Resize the internal render target to match the new size specified.
9517 *
9518 * @param width - New width to apply to the render target.
9519 * @param height - New height to apply to the render target.
9520 * @override
9521 */
9522 setSize(width: number, height: number): void;
9523 /**
9524 * The list of offsets to apply to the camera, per sampling level, adapted from :
9525 *
9526 * @see https://msdn.microsoft.com/en-us/library/windows/desktop/ff476218%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
9527 */
9528 static readonly OffsetVectors: number[][][];
9529}
9530
9531/**
9532 * This enum represents the sampling level to apply to
9533 * a {@link MSAARenderPass} instance. At level 0,
9534 * only one sample is performed, which is like
9535 * disabling the MSAA pass.
9536 */
9537export declare enum MSAASampling {
9538 "Level_0" = 0,
9539 "Level_1" = 1,
9540 "Level_2" = 2,
9541 "Level_3" = 3,
9542 "Level_4" = 4,
9543 "Level_5" = 5
9544}
9545
9546/**
9547 * Represents "MultiLineString" GeoJSON geometry object.
9548 */
9549export declare interface MultiLineString {
9550 type: "MultiLineString";
9551 coordinates: number[][][];
9552}
9553
9554/**
9555 * Represents "MultiPoint" GeoJSON geometry object.
9556 */
9557export declare interface MultiPoint {
9558 type: "MultiPoint";
9559 coordinates: number[][];
9560}
9561
9562/**
9563 * Represents "MultiPolygon" GeoJSON geometry object.
9564 */
9565export declare interface MultiPolygon {
9566 type: "MultiPolygon";
9567 coordinates: number[][][][];
9568}
9569
9570/**
9571 * Measures a sequence of connected events, such as multiple processing stages in a function.
9572 * Each stage is identified with a timer name, that must be a valid timer in the statistics
9573 * object. Additionally, all timers within a `MultiStageTimer` must be unique.
9574 *
9575 * Internally, the `MultiStageTimer` manages a list of timers where at the end of each stage,
9576 * one timer stops and the next timer starts.
9577 */
9578export declare class MultiStageTimer {
9579 private statistics;
9580 readonly name: string;
9581 stages: string[];
9582 private currentStage;
9583 /**
9584 * Defines the `MultiStageTimer` with a list of timer names that represent its stages.
9585 *
9586 * @param statistics - The statistics object that manages the timers.
9587 * @param name - Name of this `MultiStageTimer`.
9588 * @param stages - List of timer names.
9589 */
9590 constructor(statistics: Statistics, name: string, stages: string[]);
9591 /**
9592 * Gets the timer value for the last stage. If the `MultiStageTimer` did not finish its
9593 * last stage, the value is `undefined`.
9594 */
9595 get value(): number | undefined;
9596 /**
9597 * Resets the timers across all stages.
9598 */
9599 reset(): void;
9600 /**
9601 * Starts the `MultiStageTimer` at its first stage.
9602 */
9603 start(): number;
9604 /**
9605 * Stops the `MultiStageTimer`. Returns the measurement of the last stage, which may be
9606 * `undefined` if not all stages started.
9607 */
9608 stop(): number;
9609 /**
9610 * Gets the current stage.
9611 */
9612 get stage(): string | undefined;
9613 /**
9614 * Sets the current stage. If a new stage is provided, the current timer (if available) is
9615 * stopped, and the next timer is started. If the timer in the next stage is `undefined`,
9616 * this is equivalent to calling `stop` on the `MultiStageTimer`.
9617 *
9618 * @param stage - The next stage to start.
9619 */
9620 set stage(stage: string | undefined);
9621}
9622
9623/**
9624 * Check if vertex normals should be generated for this technique (if no normals are in the data).
9625 * @param technique - Technique to check.
9626 */
9627export declare function needsVertexNormals(technique: Technique): boolean;
9628
9629export declare interface NoneStyle extends BaseStyle<"none", {
9630 [name: string]: any;
9631}> {
9632 [name: string]: any;
9633}
9634
9635/**
9636 * Equirectangular {@link Projection} used to convert geo coordinates to unit coordinates and vice
9637 * versa.
9638 */
9639export declare const normalizedEquirectangularProjection: Projection;
9640
9641/**
9642 * Null literal expression.
9643 */
9644export declare class NullLiteralExpr extends LiteralExpr {
9645 static instance: NullLiteralExpr;
9646 /** @override */
9647 readonly value: Value;
9648 protected constructor();
9649 /** @override */
9650 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
9651 /** @override */
9652 protected exprIsDynamic(): boolean;
9653}
9654
9655/**
9656 * Number literal expression.
9657 */
9658export declare class NumberLiteralExpr extends LiteralExpr {
9659 readonly value: number;
9660 constructor(value: number);
9661 /** @override */
9662 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
9663}
9664
9665/**
9666 * Object literal expression.
9667 */
9668export declare class ObjectLiteralExpr extends LiteralExpr {
9669 readonly value: object;
9670 constructor(value: object);
9671 get isArrayLiteral(): boolean;
9672 /** @override */
9673 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
9674}
9675
9676/**
9677 * Default OMV tile decoder service type.
9678 *
9679 * Used for requesting decoder services using [[WorkerServiceManager]].
9680 */
9681export declare const OMV_TILE_DECODER_SERVICE_TYPE = "omv-tile-decoder";
9682
9683/**
9684 * Default OMV tiler service type.
9685 *
9686 * Used for requesting tiler services using [[WorkerServiceManager]].
9687 */
9688export declare const OMV_TILER_SERVICE_TYPE = "omv-tiler";
9689
9690export declare class OmvDataSource extends TileDataSource<OmvTile> {
9691 private m_params;
9692 private readonly m_decoderOptions;
9693 constructor(m_params: OmvWithRestClientParams | OmvWithCustomDataProvider);
9694 /** @override */
9695 connect(): Promise<void>;
9696 /**
9697 * Remove the current data filter.
9698 * Will be applied to the decoder, which might be shared with other omv datasources.
9699 */
9700 removeDataFilter(): void;
9701 /**
9702 * Set a new data filter. Can also be done during the creation of an [[OmvDataSource]].
9703 * Will be applied to the decoder, which might be shared with other omv datasources.
9704 *
9705 * @param filterDescription - Data filter description created with
9706 * [[OmvFeatureFilterDescriptionBuilder]].
9707 */
9708 setDataFilter(filterDescription: OmvFeatureFilterDescription): void;
9709 /** @override */
9710 shouldPreloadTiles(): boolean;
9711 /** @override */
9712 setLanguages(languages?: string[]): void;
9713 /** @override */
9714 setPoliticalView(politicalView?: string): void;
9715 /** @override */
9716 get storageLevelOffset(): number;
9717 /** @override */
9718 set storageLevelOffset(levelOffset: number);
9719 /** @override */
9720 setEnableElevationOverlay(enable: boolean): void;
9721 private configureDecoder;
9722}
9723
9724export declare interface OmvDataSourceParameters extends DataSourceOptions {
9725 /**
9726 * If set to `true`, features that have no technique in the theme will be printed to the console
9727 * (can be excessive!).
9728 */
9729 showMissingTechniques?: boolean;
9730 /**
9731 * @deprecated Tile info is not decoded anymore. The same information can be generated
9732 * implementing a [[IGeometryProcessor]] and using [[OmvProtobufDataAdapter]] to decode OMV
9733 * data.
9734 */
9735 createTileInfo?: boolean;
9736 /**
9737 * Specify the decoder that should be used. If not supplied, the default will be used.
9738 */
9739 decoder?: ITileDecoder;
9740 /**
9741 * Optionally specify the DataProvider that should be used.
9742 */
9743 dataProvider?: DataProvider;
9744 /**
9745 * Specify the URL to the decoder bundle. If not supplied, the default will be used.
9746 */
9747 concurrentDecoderScriptUrl?: string;
9748 /**
9749 * Gather feature IDs from `OmvData`. Defaults to `false`.
9750 * @deprecated FeatureIds are always gathered, use [[gatherFeatureAttributes]] to gather
9751 * all feature attributes.
9752 */
9753 gatherFeatureIds?: boolean;
9754 /**
9755 * Gather feature attributes from `OmvData`. Defaults to `false`.
9756 */
9757 gatherFeatureAttributes?: boolean;
9758 /**
9759 * @deprecated Tile info is not decoded anymore. The same information can be generated
9760 * implementing a [[IGeometryProcessor]] and using [[OmvProtobufDataAdapter]] to decode OMV
9761 * data.
9762 */
9763 gatherRoadSegments?: boolean;
9764 /**
9765 * If not set to `false`, very short text labels will be skipped during decoding based on a
9766 * heuristic.
9767 */
9768 skipShortLabels?: boolean;
9769 /**
9770 * A description for the feature filter that can be safely passed down to the web workers. It
9771 * has to be generated with the help of the [[OmvFeatureFilterDescriptionBuilder]] (to guarantee
9772 * correctness). This parameter gets applied to the decoder used in the [[OmvDataSource]]
9773 * which might be shared between various [[OmvDataSource]]s.
9774 */
9775 filterDescr?: OmvFeatureFilterDescription;
9776 /**
9777 * Optional, custom factory for [[Tile]] instances created by this [[OmvDataSource]].
9778 */
9779 tileFactory?: TileFactory<OmvTile>;
9780 /**
9781 * Identifier used to choose [[OmvFeatureModifier]]s to be applied.
9782 *
9783 * If left `undefined` at least [[OmvGenericFeatureModifier]] will be applied.
9784 * The list of feature modifiers may be extended internally by some data source options
9785 * such as [[politicalView]] which adds [[OmvPoliticalViewFeatureModifier]].
9786 *
9787 * @note This parameter gets applied to the decoder used in the [[OmvDataSource]] which might
9788 * be shared between various [[OmvDataSource]]s.
9789 */
9790 featureModifierId?: FeatureModifierId;
9791 /**
9792 * Expresses specific country point of view that is used when rendering disputed features,
9793 * like borders, names, etc. If undefined "defacto" or most widely accepted political view
9794 * will be presented.
9795 *
9796 * @see featureModifiers
9797 */
9798 politicalView?: string;
9799 /**
9800 * Optional, default copyright information of tiles provided by this data source.
9801 * Implementation should provide this information from the source data if possible.
9802 */
9803 copyrightInfo?: CopyrightInfo[];
9804 /**
9805 * Optional copyright info provider for tiles provided by this data source.
9806 */
9807 copyrightProvider?: CopyrightProvider;
9808 /**
9809 * Maximum geometry height above groud level this `OmvDataSource` can produce.
9810 *
9811 * Used in first stage of frustum culling before [[Tile.maxGeometryHeight]] data is available.
9812 *
9813 * @default [[EarthConstants.MAX_BUILDING_HEIGHT]].
9814 */
9815 maxGeometryHeight?: number;
9816 /**
9817 * Indicates whether overlay on elevation is enabled. Defaults to `false`.
9818 */
9819 enableElevationOverlay?: boolean;
9820 /**
9821 * Indicates whether to add a ground plane to cover the tile completely. This is necessary for
9822 * the fallback logic, such that the parent fall back tiles don't overlap the children tiles.
9823 * Default is true (i.e. if not defined it is taken to be true)
9824 */
9825 addGroundPlane?: boolean;
9826}
9827
9828export declare class OmvDebugLabelsTile extends OmvTile {
9829 constructor(dataSource: DataSource, tileKey: TileKey);
9830 /** @override */
9831 loadingFinished(): void;
9832 /**
9833 * Create [[TextElement]] objects from the given decoded [[Tile]] and list of materials.
9834 */
9835 private addLabelDebugInfo;
9836}
9837
9838/**
9839 * Internal interface for options passed from the [[OmvDataSource]] to the decoder.
9840 *
9841 * @hidden
9842 */
9843export declare interface OmvDecoderOptions {
9844 /**
9845 * If true, features that have no technique in the theme will be printed to the console (can be
9846 * excessive!).
9847 */
9848 showMissingTechniques?: boolean;
9849 /**
9850 * Gather feature attributes from [[OmvData]]. Defaults to false.
9851 */
9852 gatherFeatureAttributes?: boolean;
9853 /**
9854 * @deprecated Tile info is not decoded anymore. The same information can be generated
9855 * implementing a [[IGeometryProcessor]] and using [[OmvProtobufDataAdapter]] to decode OMV
9856 * data.
9857 */
9858 createTileInfo?: boolean;
9859 /**
9860 * @deprecated Tile info is not decoded anymore. The same information can be generated
9861 * implementing a [[IGeometryProcessor]] and using [[OmvProtobufDataAdapter]] to decode OMV
9862 * data.
9863 */
9864 gatherRoadSegments?: boolean;
9865 /**
9866 * Optional storage level offset for [[Tile]]s. Default is -2.
9867 */
9868 storageLevelOffset?: number;
9869 /**
9870 * If not set to `false` very short text labels will be skipped during decoding based on a
9871 * heuristic.
9872 */
9873 skipShortLabels?: boolean;
9874 /**
9875 * A description for the feature filter which can be safely passed down to the web workers.
9876 * It has to be generated with the help of the [[OmvFeatureFilterDescriptionBuilder]] (to
9877 * guarantee the correctness).
9878 */
9879 filterDescription?: OmvFeatureFilterDescription | null;
9880 /**
9881 * List of user specified [[OmvFeatureModifier]]s, list order declares the order of processing.
9882 *
9883 * Each identifier is used to choose corresponding OmvFeatureModifier, if undefined at least
9884 * [[OmvGenericFeatureModifier]] is added to decoder.
9885 */
9886 featureModifiers?: FeatureModifierId[];
9887 /**
9888 * Country code (lower-case ISO 3166-1 alpha-2) defining optional point of view to be used.
9889 * Set to empty string ("") if you want to use default (widely accepted) point of view.
9890 * If set to `undefined` leaves current political view decoder configuration.
9891 */
9892 politicalView?: string;
9893 enableElevationOverlay?: boolean;
9894}
9895
9896/**
9897 * The `OmvFeatureFilter` is designed to work in an `OmvVisitor`/`visitOmv` combination (for
9898 * example, `OmvDecoder`). Returning `false` from any of the calls terminates processing of that
9899 * layer or feature.
9900 *
9901 * The `OmvFeatureFilter` is an "early-opt-out" filter, which cannot filter individual features,
9902 * because at that point the features are not really decoded. Use the [[OmvFeatureModifier]] to
9903 * filter for individual features.
9904 */
9905export declare interface OmvFeatureFilter {
9906 /**
9907 * Returns `true` if the filter contains rules for specific kinds.
9908 */
9909 hasKindFilter: boolean;
9910 /**
9911 * Return `false` if the layer should not be processed.
9912 *
9913 * @param layer - Current layer.
9914 * @param level - Level of tile.
9915 */
9916 wantsLayer(layer: string, level: number): boolean;
9917 /**
9918 * Return `false` if the point feature should not be processed.
9919 *
9920 * @param layer - Current layer.
9921 * @param feature - Current feature.
9922 * @param level - Level of tile.
9923 */
9924 wantsPointFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
9925 /**
9926 * Return `false` if the line feature should not be processed.
9927 *
9928 * @param layer - Current layer.
9929 * @param feature - Current feature.
9930 * @param level - Level of tile.
9931 */
9932 wantsLineFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
9933 /**
9934 * Return `false` if the polygon feature should not be processed.
9935 *
9936 * @param layer - Current layer.
9937 * @param feature - Current feature.
9938 * @param level - Level of tile.
9939 */
9940 wantsPolygonFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
9941 /**
9942 * Return `false` if kind of object is not enabled and the geometry should not be created.
9943 *
9944 * @param {(string | string[])} kind Tag "kind" of the tag.
9945 * @returns {boolean}
9946 */
9947 wantsKind(kind: string | string[]): boolean;
9948}
9949
9950/**
9951 * Internal type of a complete [[OmvFeatureFilter]] description, should not be publicly available.
9952 *
9953 * @hidden
9954 */
9955export declare interface OmvFeatureFilterDescription {
9956 processLayersDefault: boolean;
9957 processPointsDefault: boolean;
9958 processLinesDefault: boolean;
9959 processPolygonsDefault: boolean;
9960 layersToProcess: OmvLayerFilterDescription[];
9961 layersToIgnore: OmvLayerFilterDescription[];
9962 pointsToProcess: OmvFilterDescription[];
9963 pointsToIgnore: OmvFilterDescription[];
9964 linesToProcess: OmvFilterDescription[];
9965 linesToIgnore: OmvFilterDescription[];
9966 polygonsToProcess: OmvFilterDescription[];
9967 polygonsToIgnore: OmvFilterDescription[];
9968 kindsToProcess: string[];
9969 kindsToIgnore: string[];
9970}
9971
9972/**
9973 * Builds an `OmvFilterDescription` (internal type) that specifies an [[OmvFeatureFilter]] as well
9974 * as an [[OmvFeatureModifier]].
9975 *
9976 */
9977export declare class OmvFeatureFilterDescriptionBuilder {
9978 private m_processLayersDefault;
9979 private m_processPointsDefault;
9980 private m_processLinesDefault;
9981 private m_processPolygonsDefault;
9982 private readonly m_layersToProcess;
9983 private readonly m_layersToIgnore;
9984 private readonly m_pointsToProcess;
9985 private readonly m_ignoredPoints;
9986 private readonly m_linesToProcess;
9987 private readonly m_linesToIgnore;
9988 private readonly m_polygonsToProcess;
9989 private readonly m_polygonsToIgnore;
9990 private m_kindsToProcess;
9991 private m_kindsToIgnore;
9992 /**
9993 * Builds an `OmvFilterDescription` (internal type) that specifies an [[OmvFeatureFilter]] as
9994 * well as an [[OmvFeatureModifier]].
9995 *
9996 * @param processLayersDefault - If `true`, all unspecified layers will be processed.
9997 * If `false`, all unspecified layers will be ignored.
9998 * @param processPointsDefault - If `true`, all unspecified point features will be processed. If
9999 * `false`, all unspecified point features will be ignored.
10000 * @param processLinesDefault - If `true`, all unspecified line features will be processed. If
10001 * `false`, all unspecified line features will be ignored.
10002 * @param processPolygonsDefault - If `true`, all unspecified polygon features will be
10003 * processed. If `false`, all unspecified polygon features will be ignored.
10004 */
10005 constructor(options?: OmvFeatureFilterDescriptionBuilder.OmvFeatureFilterDescriptionBuilderOptions);
10006 /**
10007 * Add a layer that should be processed.
10008 *
10009 * @param layer - Layer name to be matched.
10010 * @param match - Match condition.
10011 */
10012 processLayer(layer: string, match?: OmvFilterString.StringMatch, minLevel?: number, maxLevel?: number): void;
10013 /**
10014 * Add a layer that should be ignored.
10015 *
10016 * @param layer - Layer name to be matched.
10017 * @param match - Match condition.
10018 */
10019 ignoreLayer(layer: string, match?: OmvFilterString.StringMatch, minLevel?: number, maxLevel?: number): void;
10020 /**
10021 * Add a valid point feature.
10022 *
10023 * @param options - Feature options.
10024 */
10025 processPoint(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10026 /**
10027 * Add valid point features.
10028 *
10029 * @param options - Multi feature options.
10030 */
10031 processPoints(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10032 /**
10033 * Add a point feature that should be ignored.
10034 *
10035 * @param options - Feature options.
10036 */
10037 ignorePoint(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10038 /**
10039 * Add point features that should be ignored.
10040 *
10041 * @param options - Multi feature options.
10042 */
10043 ignorePoints(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10044 /**
10045 * Add a valid line feature.
10046 *
10047 * @param options - Feature options.
10048 */
10049 processLine(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10050 /**
10051 * Add valid line features.
10052 *
10053 * @param options - Multi feature options.
10054 */
10055 processLines(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10056 /**
10057 * Ignore a line feature.
10058 *
10059 * @param options - Feature options.
10060 */
10061 ignoreLine(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10062 /**
10063 * Ignore line features.
10064 *
10065 * @param options - Multi feature options.
10066 */
10067 ignoreLines(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10068 /**
10069 * Add a valid polygon feature.
10070 *
10071 * @param options - Feature options.
10072 */
10073 processPolygon(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10074 /**
10075 * Add valid polygon features.
10076 *
10077 * @param options - Multi feature options.
10078 */
10079 processPolygons(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10080 /**
10081 * Ignore a valid polygon feature.
10082 *
10083 * @param options - Feature options.
10084 */
10085 ignorePolygon(options: OmvFeatureFilterDescriptionBuilder.FeatureOption): void;
10086 /**
10087 * Ignore polygon features.
10088 *
10089 * @param options - Multi feature options.
10090 */
10091 ignorePolygons(options: OmvFeatureFilterDescriptionBuilder.MultiFeatureOption): void;
10092 /**
10093 * Add all the specified strings as "enabledKinds".
10094 *
10095 * @param {string[]} enabledKinds List of kinds that should be generated.
10096 */
10097 processKinds(enabledKinds: string[]): void;
10098 /**
10099 * Add all the specified strings as "disabledKinds".
10100 *
10101 * @param {string[]} disabledKinds List of kinds that should _not_ be generated.
10102 */
10103 ignoreKinds(disabledKinds: string[]): void;
10104 /**
10105 * Create a filter description that can be passed as an option to the [[OmvDataSource]].
10106 */
10107 createDescription(): OmvFeatureFilterDescription;
10108 private addItem;
10109 private addItems;
10110}
10111
10112export declare namespace OmvFeatureFilterDescriptionBuilder {
10113 /**
10114 * Options for `OmvFeatureFilterDescriptionBuilder`.
10115 */
10116 export interface OmvFeatureFilterDescriptionBuilderOptions {
10117 /**
10118 * If `true`, all unspecified layers will be processed. If `false`, all unspecified layers
10119 * will be ignored.
10120 */
10121 processLayersDefault?: boolean;
10122 /**
10123 * If `true`, all unspecified point features will be processed. If `false`, all unspecified
10124 * point features will be ignored.
10125 */
10126 processPointsDefault?: boolean;
10127 /**
10128 * If `true`, all unspecified line features will be processed. If `false`, all unspecified
10129 * line
10130 * features will be ignored.
10131 */
10132 processLinesDefault?: boolean;
10133 /**
10134 * If `true`, all unspecified polygon features will be processed. If `false`, all
10135 * unspecified polygon features will be ignored.
10136 */
10137 processPolygonsDefault?: boolean;
10138 }
10139 /**
10140 * Description of a single feature.
10141 */
10142 export interface FeatureOption {
10143 /**
10144 * Layer name to be matched.
10145 */
10146 layer: string;
10147 /**
10148 * Optional geometry type to be limited to. If specified, but does not match, the feature is
10149 * ignored.
10150 */
10151 geomType: OmvGeometryType | OmvGeometryType[] | undefined;
10152 /**
10153 * Optional class to match. If specified, but does not match, the feature is ignored.
10154 */
10155 featureClass: string;
10156 /**
10157 * Match condition for the layer name.
10158 */
10159 matchLayer?: OmvFilterString.StringMatch;
10160 /**
10161 * Match condition for `featureClass`.
10162 */
10163 matchClass?: OmvFilterString.StringMatch;
10164 /**
10165 * Minimum tile level to match.
10166 */
10167 minLevel?: number;
10168 /**
10169 * Maximum tile level to match.
10170 */
10171 maxLevel?: number;
10172 /**
10173 * Feature attribute to match.
10174 */
10175 featureAttribute?: OmvFilterFeatureAttribute;
10176 }
10177 /**
10178 * Description for multiple features.
10179 */
10180 export interface MultiFeatureOption {
10181 /**
10182 * Layer name to be matched.
10183 */
10184 layer: string;
10185 /**
10186 * Optional geometry type to be limited to. If specified, but does not match, the feature is
10187 * ignored.
10188 */
10189 geomTypes?: OmvGeometryType | OmvGeometryType[] | undefined;
10190 /**
10191 * Optional classes to match. If specified, but does not match, the feature is ignored.
10192 */
10193 featureClasses?: OmvFilterString[];
10194 /**
10195 * Match condition for the layer name.
10196 */
10197 matchLayer?: OmvFilterString.StringMatch;
10198 /**
10199 * Minimum tile level to match.
10200 */
10201 minLevel?: number;
10202 /**
10203 * Maximum tile level to match.
10204 */
10205 maxLevel?: number;
10206 /**
10207 * Feature attribute to match.
10208 */
10209 featureAttribute?: OmvFilterFeatureAttribute;
10210 }
10211}
10212
10213/**
10214 * The `OmvFeatureModifier` can be used to filter individual features. It gets passed in the [[Env]]
10215 * of the feature, which contains all the values that can be searched for in a style. If a filter
10216 * function returns false, the feature is ignored, and no geometry is being created.
10217 *
10218 * In addition to pure filtering, the `OmvFeatureModifier` can also modify the [[Env]] of the
10219 * feature, or even add new properties to the feature, for example, traffic states. The
10220 * `OmvFeatureModifier` is executed before the styles are selected, so the geometry is created with
10221 * the modified feature properties.
10222 */
10223export declare interface OmvFeatureModifier {
10224 /**
10225 * Check if the point feature described by `env` should be processed. The properties can be
10226 * modified or added to.
10227 *
10228 * @param layer - Current layer.
10229 * @param env - Properties of point feature.
10230 * @param level - Level of tile.
10231 * @returns `false` to ignore feature.
10232 */
10233 doProcessPointFeature(layer: string, env: MapEnv, level: number): boolean;
10234 /**
10235 * Check if the line feature described by `env` should be processed. The properties can be
10236 * modified or added to.
10237 *
10238 * @param layer - Current layer.
10239 * @param env - Properties of line feature.
10240 * @param level - Level of tile.
10241 * @returns `false` to ignore feature.
10242 */
10243 doProcessLineFeature(layer: string, env: MapEnv, level: number): boolean;
10244 /**
10245 * Check if the polygon feature described by `env` should be processed. The properties can be
10246 * modified or added to.
10247 *
10248 * @param layer - Current layer.
10249 * @param env - Properties of polygon feature.
10250 * @param level - Level of tile.
10251 * @returns `false` to ignore feature.
10252 */
10253 doProcessPolygonFeature(layer: string, env: MapEnv, level: number): boolean;
10254}
10255
10256/**
10257 * Internal type of a single filter description, Should not be publicly available.
10258 *
10259 * @hidden
10260 */
10261export declare interface OmvFilterDescription {
10262 layerName: OmvFilterString;
10263 geometryTypes?: OmvGeometryType[];
10264 classes?: OmvFilterString[];
10265 minLevel: number;
10266 maxLevel: number;
10267 featureAttribute?: OmvFilterFeatureAttribute;
10268}
10269
10270/**
10271 * Definition of a filter for a feature attribute
10272 */
10273export declare interface OmvFilterFeatureAttribute {
10274 key: string;
10275 value: Value;
10276}
10277
10278/**
10279 * Definition of a filter.
10280 */
10281export declare interface OmvFilterString {
10282 /** String value */
10283 value: string;
10284 /** Match condition */
10285 match: OmvFilterString.StringMatch;
10286}
10287
10288/**
10289 * Adding the match condition type and the matching function to the namespace of `OmvFilterString`.
10290 */
10291export declare namespace OmvFilterString {
10292 /**
10293 * Match condition.
10294 */
10295 export enum StringMatch {
10296 /** Matches any. */
10297 Any = 0,
10298 /** Exact match. */
10299 Match = 1,
10300 /** Matches if a test string starts with a filter string. */
10301 StartsWith = 2,
10302 /** Matches if a test string contains a filter string. */
10303 Contains = 3,
10304 /** Matches if a test string ends with a filter string. */
10305 EndsWith = 4
10306 }
10307 /**
10308 * Check for a string against a filter.
10309 *
10310 * @param str - The string to check against a filter.
10311 * @param filterString - The filter containing the match condition.
10312 * @returns `true` if the match condition is satisfied.
10313 */
10314 export function matchString(str: string, filterString: OmvFilterString): boolean;
10315}
10316
10317/**
10318 * `OmvFeatureFilter` implementation that uses a `OmvFeatureFilterDescription` to filter `TileData`
10319 * features before they are completely decoded.
10320 *
10321 * @hidden
10322 */
10323export declare class OmvGenericFeatureFilter implements OmvFeatureFilter {
10324 private description;
10325 private static matchLayer;
10326 private disabledKinds;
10327 private enabledKinds;
10328 constructor(description: OmvFeatureFilterDescription);
10329 wantsLayer(layer: string, level: number): boolean;
10330 wantsPointFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
10331 wantsLineFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
10332 wantsPolygonFeature(layer: string, geometryType: OmvGeometryType, level: number): boolean;
10333 wantsKind(kind: string | string[]): boolean;
10334 get hasKindFilter(): boolean;
10335 private wantsFeature;
10336}
10337
10338/**
10339 * `OmvFeatureModifier` implementation that uses a `OmvFeatureFilterDescription` to filter
10340 * `TileData` features before they are completely decoded.
10341 *
10342 * @hidden
10343 */
10344export declare class OmvGenericFeatureModifier implements OmvFeatureModifier {
10345 private description;
10346 static matchItems(layerName: string, featureClass: string, items: OmvFilterDescription[]): boolean;
10347 static matchAttribute(layerName: string, env: MapEnv, items: OmvFilterDescription[]): boolean;
10348 constructor(description: OmvFeatureFilterDescription);
10349 doProcessPointFeature(layer: string, env: MapEnv): boolean;
10350 doProcessLineFeature(layer: string, env: MapEnv): boolean;
10351 doProcessPolygonFeature(layer: string, env: MapEnv): boolean;
10352 protected doProcessFeature(itemsToProcess: OmvFilterDescription[], itemsToIgnore: OmvFilterDescription[], layer: string, env: MapEnv, defaultResult: boolean): boolean;
10353}
10354
10355export declare enum OmvGeometryType {
10356 UNKNOWN = 0,
10357 POINT = 1,
10358 LINESTRING = 2,
10359 POLYGON = 3
10360}
10361
10362/**
10363 * Internal type of a layer filter description, Should not be publicly available.
10364 *
10365 * @hidden
10366 */
10367export declare interface OmvLayerFilterDescription {
10368 name: OmvFilterString;
10369 minLevel: number;
10370 maxLevel: number;
10371}
10372
10373/**
10374 * REST client supporting getting protobuf OMV Tile from REST-based servers.
10375 */
10376export declare class OmvRestClient implements DataProvider {
10377 readonly params: OmvRestClientParameters;
10378 private readonly downloadManager;
10379 private readonly urlParams;
10380 constructor(params: OmvRestClientParameters);
10381 /** Overriding abstract method, in this case doing nothing. */
10382 connect(): Promise<void>;
10383 /** Overriding abstract method, in this case always returning `true`. */
10384 ready(): boolean;
10385 /**
10386 * Asynchronously fetches a tile from this restful server.
10387 *
10388 * **Note:** If the tile doesn't exist, a successful response with a `404` status code is
10389 * returned.
10390 *
10391 * @example
10392 * ```typescript
10393 * const response = layer.getTile(tileKey);
10394 * if (!response.ok) {
10395 * // a network error happened
10396 * console.error("Unable to download tile", response.statusText);
10397 * return;
10398 * }
10399 * if (response.status === 404) {
10400 * // 404 -, no data exists at the given tile. Do nothing.
10401 * return;
10402 * }
10403 *
10404 * // the response is ok and contains data, access it e.g. as arrayBuffer:
10405 * const payload = await response.arrayBuffer();
10406 * ```
10407 *
10408 * @param tileKey - The tile key of the tile.
10409 * @param tileRequestInit - Optional request options to be passed to fetch when downloading a
10410 * tile.
10411 * @returns A `Promise` of the HTTP response that contains the payload of the requested tile.
10412 */
10413 getTile(tileKey: TileKey, abortSignal?: AbortSignal | undefined): Promise<ArrayBufferLike | {}>;
10414 /**
10415 * Get actual authentication code/token for this request according to configuration.
10416 */
10417 private getActualAuthenticationCode;
10418 /**
10419 * Get default authnentication method basing on apiFormat and other params.
10420 */
10421 private getDefaultAuthMethod;
10422 /**
10423 * Apply athentication code/token using configured (or default) authentication method.
10424 *
10425 * @param url -
10426 * @param init - request extra data
10427 * @param authenticationCode - authentication/token to be applied
10428 * @return new url to be used
10429 */
10430 private applyAuthCode;
10431 /**
10432 * Get actual tile URL depending on configured API format.
10433 */
10434 private dataUrl;
10435 private addQueryParams;
10436}
10437
10438export declare interface OmvRestClientParameters {
10439 /**
10440 * `URL` pattern used to fetch tile files.
10441 *
10442 * `URL` with special keywords replaced to retrieve specific tile:
10443 * - `{z}` - zoom level of tile, @see [[TileKey.level]]
10444 * - `{x}` - horizontal coordinate of tile (column number), @see [[TileKey.column]]
10445 * - `{y}` - vertical coordinate of Tile (row number), @see [[TileKey.row]]
10446 *
10447 * Examples of `url` patterns:
10448 * ```
10449 * https://my-base-url.com/vector-tiles/{z}/{x}/{y}.mvt
10450 * https://xyz.api.here.com/tiles/herebase.02/{z}/{x}/{y}/omv
10451 * https://xyz.api.here.com/tiles/osmbase/512/all/{z}/{x}/{y}.mvt
10452 * ```
10453 *
10454 * Note: To add authentication headers and/or query params, use [[authMethod]], [[urlParams]]
10455 * properties or embed token directly in `url`.
10456 *
10457 * Complete examples:
10458 * ```
10459 * // XYZ OSM with authentication using query param
10460 * {
10461 * url: "https://xyz.api.here.com/tiles/osmbase/512/all/{z}/{x}/{y}.mvt",
10462 * urlParams: {
10463 * access_token: accessToken
10464 * },
10465 * }
10466 * // HERE Vector Tile with authentication using bearer token retrieved by callback
10467 * {
10468 * url: "https://vector.hereapi.com/v2/vectortiles/base/mc/{z}/{x}/{y}/omv",
10469 * authenticationMethod: AuthenticationTypeBearer,
10470 * authenticationCode: () => getBearerToken()
10471 * }
10472 * ```
10473 */
10474 url?: string;
10475 /**
10476 * The base URL of the REST Tile Service.
10477 * @see [[APIFormat]] for the definition of `baseUrl`.
10478 */
10479 baseUrl?: string;
10480 /**
10481 * Authentication code used for the different APIs.
10482 *
10483 * When [[AuthenticationCodeProvider]] is is used as value, the provider is called before each
10484 * to get currently valid authentication code/token.
10485 *
10486 * @see [[APIFormat]] for the query parameter this is used with.
10487 */
10488 authenticationCode?: string | AuthenticationCodeProvider;
10489 /**
10490 * Specifies [[AuthMethod]] to be used when requesting tiles.
10491 *
10492 * Defaults for each [[APIFormat]] are documented with each format type.
10493 */
10494 authenticationMethod?: AuthenticationMethodInfo;
10495 /**
10496 * The REST API format to use for the tile path generation, will default to the HERE Vector Tile
10497 * API.
10498 */
10499 apiFormat?: APIFormat;
10500 /**
10501 * Tiling scheme is used in some of the APIs, not implemented yet.
10502 */
10503 tilingScheme?: TilingScheme;
10504 /**
10505 * Transfer Manager to use; creates an own instance if none passed.
10506 */
10507 downloadManager?: ITransferManager;
10508 /**
10509 * Function to retrieve the Bearer Token
10510 *
10511 * @deprecated Please use [[authenticationCode]].
10512 */
10513 getBearerToken?: () => Promise<string>;
10514 /**
10515 * Array of query parameters to be appended at the end of the url.
10516 * It is empty by default.
10517 */
10518 urlParams?: {
10519 [key: string]: string;
10520 };
10521}
10522
10523export declare class OmvTile extends Tile {
10524 constructor(dataSource: DataSource, tileKey: TileKey);
10525}
10526
10527export declare interface OmvTileFactory {
10528 /** Create an instance of [[OmvTile]] or a subclass. */
10529 createTile(dataSource: OmvDataSource, tileKey: TileKey): OmvTile;
10530}
10531
10532export declare type OmvWithCustomDataProvider = OmvDataSourceParameters & {
10533 dataProvider: DataProvider;
10534};
10535
10536export declare type OmvWithRestClientParams = OmvRestClientParameters & OmvDataSourceParameters;
10537
10538declare type OneThatMatches<T, P> = T extends P ? T : never;
10539
10540declare interface OperatorDescriptor {
10541 /**
10542 * Returns `true` if this operator requires a dynamic execution context (e.g. ["zoom"]).
10543 */
10544 isDynamicOperator?: (call: CallExpr) => boolean;
10545 /**
10546 * Evaluates the given expression.
10547 */
10548 call: (context: ExprEvaluatorContext, call: CallExpr) => Value;
10549 /**
10550 * Partial evaluate the `call` expression using the given `context`.
10551 */
10552 partialEvaluate?: (context: ExprEvaluatorContext, call: CallExpr) => Value;
10553}
10554
10555declare interface OperatorDescriptorMap {
10556 [name: string]: OperatorDescriptor;
10557}
10558
10559/**
10560 * Interface for `OptionsMap` which describes a general structure of key-value pairs.
10561 */
10562export declare interface OptionsMap {
10563 [name: string]: any;
10564}
10565
10566export declare class OrientedBox3 implements OrientedBox3Like {
10567 /**
10568 * The position of the center of this `OrientedBox3`.
10569 */
10570 readonly position: Vector3;
10571 /**
10572 * The x-axis of this `OrientedBox3`.
10573 */
10574 readonly xAxis: Vector3;
10575 /**
10576 * The y-axis of this `OrientedBox3`.
10577 */
10578 readonly yAxis: Vector3;
10579 /**
10580 * The z-axis of this `OrientedBox3`.
10581 */
10582 readonly zAxis: Vector3;
10583 /**
10584 * The extents of this `OrientedBox3`.
10585 */
10586 readonly extents: Vector3;
10587 /**
10588 * Creates a new `OrientedBox3`.
10589 */
10590 constructor();
10591 /**
10592 * Creates a new `OrientedBox3` with the given position, orientation and extents.
10593 *
10594 * @param position - The position of the center of the `OrientedBox3`.
10595 * @param rotationMatrix - The rotation of the `OrientedBox3`.
10596 * @param extents - The extents of the `OrientedBox3`.
10597 */
10598 constructor(position: Vector3, rotationMatrix: Matrix4, extents: Vector3);
10599 /**
10600 * Create a copy of this [[OrientedBoundingBox]].
10601 */
10602 clone(): OrientedBox3;
10603 /**
10604 * Copies the values of `other` to this {@link OrientedBox3}.
10605 * @param other - The other {@link OrientedBox3} to copy.
10606 */
10607 copy(other: OrientedBox3): void;
10608 /**
10609 * Gets the center position of this {@link OrientedBox3}.
10610 *
10611 * @param center - The returned center position.
10612 */
10613 getCenter(center?: Vector3): Vector3;
10614 /**
10615 * Gets the size of this {@link OrientedBox3}.
10616 *
10617 * @param size - The returned size.
10618 */
10619 getSize(size?: Vector3): Vector3;
10620 /**
10621 * Gets the orientation matrix of this `OrientedBox3`.
10622 * @param matrix - The output orientation matrix.
10623 */
10624 getRotationMatrix(matrix?: Matrix4): Matrix4;
10625 /**
10626 * Checks intersection with the given `THREE.Frustum` or array of `THREE.Plane`s.
10627 *
10628 * @param frustumOrPlanes - Frustum or array of planes.
10629 */
10630 intersects(frustumOrPlanes: Plane[] | Frustum): boolean;
10631 /**
10632 * Checks intersection with the given ray.
10633 *
10634 * @param ray - The ray to test.
10635 * @returns distance from ray origin to intersection point if it exist, undefined otherwise.
10636 */
10637 intersectsRay(ray: Ray): number | undefined;
10638 /**
10639 * Returns true if this {@link OrientedBox3} contains the given point.
10640 *
10641 * @param point - A valid point.
10642 */
10643 contains(point: Vector3): boolean;
10644 /**
10645 * Returns the distance from this {@link OrientedBox3} and the given `point`.
10646 *
10647 * @param point - A point.
10648 */
10649 distanceToPoint(point: Vector3): number;
10650 /**
10651 * Returns the squared distance from this {@link OrientedBox3} and the given `point`.
10652 *
10653 * @param point - A point.
10654 */
10655 distanceToPointSquared(point: Vector3): number;
10656}
10657
10658/**
10659 * The interface {@link OrientedBox3Like} is used to represent oriented bounding box.
10660 */
10661export declare interface OrientedBox3Like extends TransformLike {
10662 /**
10663 * The extents of this bounding box.
10664 */
10665 readonly extents: Vector3Like;
10666}
10667
10668/**
10669 * Parse string encoded color value using all known [[StringEncodedColorFormats]].
10670 *
10671 * @param color - The string encoded color expression (i.e. '#FFF', 'rgb(255, 0, 0)', etc.).
10672 * @returns The color parsed or __undefined__ if non of the known representations matches
10673 * the expression provided in [[color]].
10674 */
10675export declare function parseStringEncodedColor(color: string): number | undefined;
10676
10677/**
10678 * Parse string encoded numeral values using all known [[StringEncodedNumeralFormats]].
10679 *
10680 * @param numeral - The string representing numeric value.
10681 * @param pixelToMeters - The ratio used to convert from meters to pixels (default 1.0).
10682 * @returns Number parsed or __undefined__ if non of the numeral patterns matches the expression
10683 * provided in [[numeral]].
10684 */
10685export declare function parseStringEncodedNumeral(numeral: string, pixelToMeters?: number): number | undefined;
10686
10687/**
10688 * The base class to extend for further passes in {@link MapView},
10689 * like the {@link MSAARenderPass},
10690 *
10691 * @remarks
10692 * `Pass` provides the core logic for both :
10693 * - render passes (proper scene renders),
10694 * - and shader passes (quad renders, i.e. effects added on top of the render output as a
10695 * postprocess).
10696 *
10697 * Even some shader passes still actually fall within the render pass category as they need to
10698 * re-render the scene to then deduce an effect, such as masking, AO, DoF etc. Others just need the
10699 * previous input image to apply a shader on top of it, as for bloom or NVIDIA's FXAA for example.
10700 * These only are proper shader passes.
10701 */
10702export declare class Pass implements IPass {
10703 enabled: boolean;
10704 renderToScreen: boolean;
10705 setSize(width: number, height: number): void;
10706 render(renderer: THREE_2.WebGLRenderer, scene: THREE_2.Scene, camera: THREE_2.Camera, writeBuffer: THREE_2.WebGLRenderTarget | null, readBuffer: THREE_2.WebGLRenderTarget | null, delta?: number): void;
10707}
10708
10709/**
10710 * This path in world coordinates is projected to screen space and blocks all other labels.
10711 *
10712 * It could be used for example:
10713 * - Border rejects labels.
10714 * - Route blocks street labels from being rendered underneath.
10715 *
10716 * Could potentially be expanded in future to have a priority, however for now, this isn't required.
10717 */
10718declare class PathBlockingElement {
10719 readonly points: Vector3Like[];
10720 /**
10721 * Note, [[screenSpaceLines]] is only used as a performance improvement and contains no
10722 * useful information. They are used to contain the screen space coordinates of the
10723 * points. By allocating the space here, we avoid per frame allocations, see
10724 * [[TextElementsRenderer.prepopulateScreenWithBlockingElements]].
10725 */
10726 readonly screenSpaceLines: THREE_2.Line3[];
10727 /**
10728 * Constructs a path from a list of points.
10729 * Pre allocates the [[screenSpaceLines]] used to render.
10730 * @param points - Points in world coordinates.
10731 */
10732 constructor(points: Vector3Like[]);
10733}
10734
10735/**
10736 * This object keeps the path of the geometry. Space of the path depends on the
10737 * use case, so could be either world or local tile space.
10738 */
10739export declare interface PathGeometry {
10740 path: Vector3Like[];
10741}
10742
10743/**
10744 * Performance measurement central. Maintains the current
10745 * {@link FrameStats}, which holds all individual
10746 * performance numbers.
10747 *
10748 * Implemented as an instance for easy access.
10749 */
10750export declare class PerformanceStatistics {
10751 enabled: boolean;
10752 maxNumFrames: number;
10753 /**
10754 * Returns `true` when the maximum number of storable frames is reached.
10755 *
10756 * @readonly
10757 * @type {boolean}
10758 * @memberof PerformanceStatistics
10759 */
10760 get isFull(): boolean;
10761 /**
10762 * Global instance to the instance. The current instance can be overridden by creating a new
10763 * `PerformanceStatistics`.
10764 */
10765 static get instance(): PerformanceStatistics;
10766 private static m_instance?;
10767 /**
10768 * Current frame statistics. Contains all values for the current frame. Will be cleared when
10769 * [[PerformanceStatistics#storeFrameInfo]] is called.
10770 *
10771 * @type {FrameStats}
10772 * @memberof PerformanceStatistics
10773 */
10774 readonly currentFrame: FrameStats;
10775 /**
10776 * @ignore
10777 * Only exported for testing.
10778 *
10779 * Return the array of frame events.
10780 */
10781 get frameEvents(): FrameStatsArray;
10782 /**
10783 * Additional results stored for the current application run, not per frame. Only the last value
10784 * is stored.
10785 *
10786 * @type {(Map<string, number>)}
10787 */
10788 readonly appResults: Map<string, number>;
10789 /**
10790 * Additional configuration values stored for the current application run, not per frame. Only
10791 * the last value is stored.
10792 *
10793 * @type {(Map<string, string>)}
10794 * @memberof PerformanceStatistics
10795 */
10796 readonly configs: Map<string, string>;
10797 private m_frameEvents;
10798 /**
10799 * Creates an instance of PerformanceStatistics. Overrides the current `instance`.
10800 *
10801 * @param {boolean} [enabled=true] If `false` the performance values will not be stored.
10802 * @param {number} [maxNumFrames=1000] The maximum number of frames that are to be stored.
10803 * @memberof PerformanceStatistics
10804 */
10805 constructor(enabled?: boolean, maxNumFrames?: number);
10806 /**
10807 * Clears all settings, all stored frame events as well as the current frame values.
10808 *
10809 * @memberof PerformanceStatistics
10810 */
10811 clear(): void;
10812 /**
10813 * Clears only all stored frame events as well as the current frame values.
10814 *
10815 * @memberof PerformanceStatistics
10816 */
10817 clearFrames(): void;
10818 /**
10819 * Add the render state information from [[THREE.WebGLInfo]] to the current frame.
10820 * @param {THREE.WebGLInfo} webGlInfo
10821 */
10822 addWebGLInfo(webGlInfo: THREE_2.WebGLInfo): void;
10823 /**
10824 * Add memory statistics to the current frame if available.
10825 * @note Currently only supported on Chrome
10826 */
10827 addMemoryInfo(): void;
10828 /**
10829 * Stores the current frame events into the array of events and clears all values.
10830 *
10831 * @returns {boolean} Returns `false` if the maximum number of storable frames has been reached.
10832 * @memberof PerformanceStatistics
10833 */
10834 storeAndClearFrameInfo(): boolean;
10835 /**
10836 * Logs all values to the logger.
10837 *
10838 * @param header - Optional header line.
10839 * @param footer - Optional footer line.
10840 */
10841 log(header?: string, footer?: string): void;
10842 /**
10843 * Convert to a plain object that can be serialized. Required to copy the test results over to
10844 * nightwatch.
10845 */
10846 getAsPlainObject(onlyLastFrame?: boolean): any;
10847 /**
10848 * Convert the last frame values to a plain object that can be serialized. Required to copy the
10849 * test results over to nightwatch.
10850 */
10851 getLastFrameStatistics(): any;
10852 /**
10853 * Convert to a plain object that can be serialized. Required to copy the test results over to
10854 * nightwatch.
10855 */
10856 getAsSimpleFrameStatistics(onlyLastFrame?: boolean): SimpleFrameStatistics;
10857}
10858
10859/**
10860 * Handles the picking of scene geometry and roads.
10861 * @internal
10862 */
10863export declare class PickHandler {
10864 readonly mapView: MapView;
10865 readonly camera: THREE_2.Camera;
10866 enablePickTechnique: boolean;
10867 constructor(mapView: MapView, camera: THREE_2.Camera, enablePickTechnique?: boolean);
10868 /**
10869 * Does a raycast on all objects in the scene; useful for picking. This function is Limited to
10870 * objects that THREE.js can raycast. However, any solid lines that have their geometry in the
10871 * shader cannot be tested for intersection.
10872 *
10873 * @param x - The X position in CSS/client coordinates, without the applied display ratio.
10874 * @param y - The Y position in CSS/client coordinates, without the applied display ratio.
10875 * @returns the list of intersection results.
10876 */
10877 intersectMapObjects(x: number, y: number): PickResult[];
10878 private addObjInfo;
10879}
10880
10881/**
10882 * Raycasting points is not supported as necessary in Three.js. This class extends a
10883 * [[THREE.Raycaster]] and adds the width / height of the canvas to allow picking of screen space
10884 * geometry.
10885 *
10886 * @internal
10887 */
10888declare class PickingRaycaster extends THREE_2.Raycaster {
10889 width: number;
10890 height: number;
10891 /**
10892 * Constructor.
10893 *
10894 * @param width - the canvas width.
10895 * @param height - the canvas height.
10896 */
10897 constructor(width: number, height: number);
10898}
10899
10900/**
10901 * Describes the general type of a picked object.
10902 */
10903export declare enum PickObjectType {
10904 /**
10905 * Unspecified.
10906 */
10907 Unspecified = 0,
10908 /**
10909 * A point object.
10910 */
10911 Point = 1,
10912 /**
10913 * A line object.
10914 */
10915 Line = 2,
10916 /**
10917 * An area object.
10918 */
10919 Area = 3,
10920 /**
10921 * The text part of a {@link TextElement}
10922 */
10923 Text = 4,
10924 /**
10925 * The Icon of a {@link TextElement}.
10926 */
10927 Icon = 5,
10928 /**
10929 * Any general 3D object, for example, a landmark.
10930 */
10931 Object3D = 6
10932}
10933
10934/**
10935 * A general pick result. You can access the details of a picked geometry from the property
10936 * `intersection`, which is available if a geometry was hit. If a road was hit, a [[RoadPickResult]]
10937 * is returned, which has additional information, but no `intersection`.
10938 */
10939export declare interface PickResult {
10940 /**
10941 * General type of object.
10942 */
10943 type: PickObjectType;
10944 /**
10945 * A 2D point in screen coordinates, or a 3D point in world coordinates.
10946 */
10947 point: THREE_2.Vector2 | THREE_2.Vector3;
10948 /**
10949 * Distance from the camera to the picking point; used to determine the closest object.
10950 */
10951 distance: number;
10952 /**
10953 * An optional feature ID of the picked object; typically applies to the Optimized Map
10954 * Vector (OMV) format.
10955 */
10956 featureId?: number;
10957 /**
10958 * Defined for geometry only.
10959 */
10960 intersection?: THREE_2.Intersection;
10961 /**
10962 * Defined for roads or if `enableTechniqueInfo` option is enabled.
10963 */
10964 technique?: Technique;
10965 /**
10966 * Optional user data that has been defined in the picked object.
10967 *
10968 * @remarks
10969 * This object points directly to
10970 * information contained in the original {@link TileFeatureData}
10971 * stored in {@link MapView}, and should
10972 * not be modified.
10973 */
10974 userData?: any;
10975}
10976
10977export declare type PixelFormat = "Alpha" | "RGB" | "RGBA" | "Luminance" | "LuminanceAlpha" | "RGBE" | "Depth" | "DepthStencil" | "Red";
10978
10979/**
10980 * A class representing Pixels.
10981 *
10982 * @hidden
10983 * @internal
10984 */
10985declare class Pixels {
10986 readonly value: number;
10987 /**
10988 * Parses a pixel string literal.
10989 *
10990 * @param text - The string color literal
10991 */
10992 static parse(text: string): Pixels | undefined;
10993 /**
10994 * Constructs a [[Pixels]] literal
10995 *
10996 * @param value - The number of pixels.
10997 */
10998 constructor(value: number);
10999 toJSON(): string;
11000}
11001
11002/**
11003 * Defines options (tokens) supported for text placements defined via [[placements]] attribute.
11004 *
11005 * @remarks
11006 * Possible values are defined as vertical placement letter and horizontal letter, where
11007 * one of the axis may be ignored and then assumed centered. Moving clock-wise, we have:
11008 * `TL` (top-left), `T` (top-center), `TR` (top-right), `R` (center-right), `BR` (bottom-right),
11009 * `B` (bottom-center), `BL` (bottom-left), `L` (left), `C` (center-center).
11010 * Alternatively instead of `T`, `B`, `L`, `R` geographic directions may be used accordingly:
11011 * `NW` (north-west), `N` (north), `NE` (north-east), `E` (east), `SE` (south-east), `S` (south),
11012 * `SW` (south-west), `W` (west).
11013 */
11014export declare enum PlacementToken {
11015 TopLeft = "TL",
11016 Top = "T",
11017 TopRight = "TR",
11018 Right = "R",
11019 BottomRight = "BR",
11020 Bottom = "B",
11021 BottomLeft = "BL",
11022 Left = "L",
11023 Center = "C",
11024 NorthWest = "NW",
11025 North = "N",
11026 NorthEast = "NE",
11027 East = "E",
11028 SouthEast = "SE",
11029 South = "S",
11030 SouthWest = "SW",
11031 West = "W"
11032}
11033
11034/**
11035 * Structured clone compliant version of a `three.js` geometry object with points of interest (POIs)
11036 * to be rendered. It is composed of buffers with metadata for POI objects.
11037 */
11038export declare interface PoiGeometry {
11039 positions: BufferAttribute;
11040 texts: number[];
11041 /**
11042 * Names of the image texture or the name of the POI as indices into the array `stringCatalog`.
11043 */
11044 imageTextures?: number[];
11045 technique?: number;
11046 stringCatalog?: Array<string | undefined>;
11047 objInfos?: AttributeMap[];
11048 offsetDirections?: number[];
11049}
11050
11051/**
11052 * Additional information for an icon that is to be rendered along with a {@link TextElement}.
11053 */
11054export declare interface PoiInfo {
11055 /**
11056 * Technique defining the POI or LineMarker
11057 */
11058 technique: PoiTechnique | LineMarkerTechnique;
11059 /**
11060 * Name of the {@link @here/harp-datasource-protocol#ImageTexture}.
11061 */
11062 imageTextureName: string;
11063 /**
11064 * Icon color override
11065 *
11066 * @see {@link @here/harp-datasource-protocol#MarkerTechniqueParams.iconColor};
11067 */
11068 iconColor?: THREE_2.Color;
11069 /**
11070 * Icon brightness.
11071 *
11072 * @see {@link @here/harp-datasource-protocol#MarkerTechniqueParams.iconBrightness};
11073 */
11074 iconBrightness?: number;
11075 /**
11076 * Name of the POI table {@link PoiTable}.
11077 */
11078 poiTableName?: string;
11079 /**
11080 * Name of the POI description in the {@link PoiTable}.
11081 */
11082 poiName?: string;
11083 /**
11084 * Specify stack mode. Defaults to `ShowInStack`.
11085 */
11086 stackMode?: PoiStackMode;
11087 /**
11088 * Minimum zoomLevel at which to display the label icon. No default.
11089 */
11090 iconMinZoomLevel?: number;
11091 /**
11092 * Maximum zoomLevel at which to display the label icon. No default.
11093 */
11094 iconMaxZoomLevel?: number;
11095 /**
11096 * Minimum zoomLevel at which to display the label text. No default.
11097 */
11098 textMinZoomLevel?: number;
11099 /**
11100 * Maximum zoomLevel at which to display the label text. No default.
11101 */
11102 textMaxZoomLevel?: number;
11103 /**
11104 * If true, the text icon will appear even if the text part is blocked by other labels. Defaults
11105 * to `false`.
11106 */
11107 textIsOptional?: boolean;
11108 /**
11109 * If true, the text will appear even if the icon cannot be rendered because of missing icon
11110 * graphics. Defaults to `true`.
11111 */
11112 iconIsOptional?: boolean;
11113 /**
11114 * If `true`, icon is allowed to overlap other labels or icons of lower priority.
11115 */
11116 mayOverlap?: boolean;
11117 /**
11118 * If `true`, icon will reserve screen space, other markers of lower priority will not be
11119 * able to overlap.
11120 */
11121 reserveSpace?: boolean;
11122 /**
11123 * If isValid is `false`, the icon will no longer be placed or rendered. The reason may be a
11124 * missing resource.
11125 */
11126 isValid?: boolean;
11127 /**
11128 * ID to identify the (POI) icon.
11129 */
11130 featureId?: number;
11131 /**
11132 * Reference back to owning {@link TextElement}.
11133 */
11134 textElement: TextElement;
11135 /**
11136 * @hidden
11137 * If false, text will not be rendered during camera movements. Defaults to `true`;
11138 */
11139 renderTextDuringMovements?: boolean;
11140 /**
11141 * @hidden
11142 * Direct access to {@link ImageItem} once it is resolved.
11143 */
11144 imageItem?: ImageItem;
11145 /**
11146 * @hidden
11147 * Direct access to {@link @here/harp-datasource-protocol#ImageTexture} once it is resolved.
11148 */
11149 imageTexture?: ImageTexture;
11150 /**
11151 * @hidden
11152 * Layout help: A shield group is for all [[LineMarker]]s that have the same icon and text,
11153 * making them the same road shield icon.
11154 */
11155 shieldGroupIndex?: number;
11156 /**
11157 * @hidden
11158 * Internal reference to a render batch, made up of all icons that use the same Material.
11159 */
11160 poiRenderBatch?: number;
11161 /**
11162 * @hidden
11163 * Should be computed during loading/initializing of `ImageTexture`.
11164 */
11165 computedWidth?: number;
11166 /**
11167 * @hidden
11168 * Should be computed during loading/initializing of `ImageTexture`.
11169 */
11170 computedHeight?: number;
11171 /**
11172 * @hidden
11173 * Should be computed during loading/initializing of `ImageTexture`.
11174 */
11175 uvBox?: Math2D.UvBox;
11176 /**
11177 * @hidden
11178 * Computed from owning {@link TextElement}. Value is set when `PoiInfo` is assigned to
11179 * {@link TextElement}.
11180 */
11181 renderOrder?: number;
11182}
11183
11184/**
11185 * Return 'true' if the POI has been successfully prepared for rendering.
11186 *
11187 * @param poiInfo - PoiInfo containing information for rendering the POI icon.
11188 */
11189export declare function poiIsRenderable(poiInfo: PoiInfo): boolean;
11190
11191/**
11192 * POI manager class, responsible for loading the
11193 * {@link @here/harp-datasource-protocol#PoiGeometry} objects
11194 * from the {@link @here/harp-datasource-protocol#DecodedTile},
11195 * and preparing them for rendering.
11196 *
11197 * @remarks
11198 * Also loads and manages the texture atlases for the icons.
11199 */
11200export declare class PoiManager {
11201 readonly mapView: MapView;
11202 private static m_missingPoiTableName;
11203 private static m_missingPoiName;
11204 /**
11205 * Warn about a missing POI table name, but only once.
11206 * @param poiTableName - POI mapping table name.
11207 * @param poiTable - POI table instance.
11208 */
11209 private static notifyMissingPoiTable;
11210 /**
11211 * Warn about a missing POI name, but only once.
11212 * @param poiName - name of POI.
11213 * @param poiTableName - POI mapping table name.
11214 */
11215 private static notifyMissingPoi;
11216 private m_imageTextures;
11217 private m_poiShieldGroups;
11218 /**
11219 * The constructor of the `PoiManager`.
11220 *
11221 * @param mapView - The {@link MapView} instance that should display the POIs.
11222 */
11223 constructor(mapView: MapView);
11224 /**
11225 * Add all POIs from a decoded tile and store them as {@link TextElement}s in the {@link Tile}.
11226 *
11227 * Also handles LineMarkers, which is a recurring marker along a line (road).
11228 *
11229 * @param tile - Tile to add POIs to.
11230 * @param decodedTile - DecodedTile containing the raw
11231 * {@link @here/harp-datasource-protocol#PoiGeometry}
11232 * objects describing the POIs.
11233 */
11234 addPois(tile: Tile, decodedTile: DecodedTile): void;
11235 /**
11236 * Load the texture atlas that defines the segments of the texture that should be used for
11237 * specific icons.
11238 *
11239 * @remarks
11240 * Creates an {@link @here/harp-datasource-protocol#ImageTexture}
11241 * for every element in the atlas, such that it can
11242 * be addressed in the theme file.
11243 *
11244 * @param imageName - Name of the image from the theme (NOT the url!).
11245 * @param atlas - URL of the JSON file defining the texture atlas.
11246 */
11247 addTextureAtlas(imageName: string, atlas: string): void;
11248 /**
11249 * Add an {@link @here/harp-datasource-protocol#ImageTexture} such that it
11250 * is available as a named entity for techniques in theme files.
11251 *
11252 * @param imageTexture - {@link @here/harp-datasource-protocol#ImageTexture}
11253 * that should be available for POIs.
11254 */
11255 addImageTexture(imageTexture: ImageTexture): void;
11256 /**
11257 * Return the {@link @here/harp-datasource-protocol#ImageTexture}
11258 * registered under the specified name.
11259 *
11260 * @param name - Name of the {@link @here/harp-datasource-protocol#ImageTexture}.
11261 */
11262 getImageTexture(name: string): ImageTexture | undefined;
11263 /**
11264 * Update the {@link TextElement} with the information taken from the {@link PoiTable} which is
11265 * referenced in the {@link PoiInfo} of the pointLabel.
11266 *
11267 * If the requested {@link PoiTable} is not available yet, the function returns `false`.
11268 * If the {@link PoiTable} is not defined, or if the references POI has no entry in
11269 * the {@link PoiTable}, no action is taken, and the function returns `false`.
11270 *
11271 * If the {@link PoiTable} has been processed, it returns `true`, indicating that this function
11272 * doesn't have to be called again.
11273 *
11274 * @param pointLabel - The {@link TextElement} to update.
11275 *
11276 * @returns `true` if the {@link PoiTable} has been processed, and the
11277 * function does not have to be called again.
11278 */
11279 updatePoiFromPoiTable(pointLabel: TextElement): boolean;
11280 /**
11281 * Clear internal state. Applicable when switching themes.
11282 */
11283 clear(): void;
11284 /**
11285 * Add the LineMarker as a POI with a series of positions. Make sure that the LineMarkers
11286 * having the same visual all get their `shieldGroupIndex` set appropriately, so it can be taken
11287 * care of later that not too many of them are rendered (obey `minDistance` attribute).
11288 */
11289 private addLineMarker;
11290 /**
11291 * Create and add POI {@link TextElement}s to tile with a series of positions.
11292 */
11293 private addPoi;
11294 /**
11295 * Create the {@link TextElement} for a POI.
11296 *
11297 * @remarks
11298 * Even if the POI has no text, it is required that there
11299 * is a {@link TextElement}, since POIs are hooked onto {@link TextElement}s
11300 * for sorting.(Sorted by priority attribute).
11301 */
11302 private checkCreateTextElement;
11303}
11304
11305/**
11306 * Represents "Point" GeoJSON geometry object.
11307 */
11308export declare interface Point {
11309 type: "Point";
11310 coordinates: number[];
11311}
11312
11313/**
11314 * Possible parameters of [[PointTechnique]].
11315 */
11316export declare interface PointTechniqueParams extends BaseTechniqueParams {
11317 /**
11318 * Color of a point in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
11319 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
11320 * @format color-hex
11321 */
11322 color?: DynamicProperty<StyleColor>;
11323 /**
11324 * URL of a texture image to be loaded.
11325 */
11326 texture?: string;
11327 /**
11328 * Set to `true` if line should appear transparent. Rendering transparent lines may come with a
11329 * slight performance impact.
11330 */
11331 transparent?: boolean;
11332 /**
11333 * For transparent lines, set a value between 0.0 for totally transparent, to 1.0 for totally
11334 * opaque.
11335 */
11336 opacity?: DynamicProperty<number>;
11337 /**
11338 * Size of point in pixels.
11339 */
11340 size?: number;
11341 /**
11342 * Whether to enable picking on these points.
11343 */
11344 enablePicking?: boolean;
11345}
11346
11347/** @internal */
11348export declare const pointTechniquePropTypes: TechniqueDescriptor<PointTechniqueParams>;
11349
11350/**
11351 * Manage POI rendering. Uses a [[PoiRenderBuffer]] to actually create the geometry that is being
11352 * rendered.
11353 */
11354declare class PoiRenderer {
11355 readonly mapView: MapView;
11356 readonly textCanvas: TextCanvas;
11357 /**
11358 * Compute screen box for icon. It is required that `prepareRender` has been successfully called
11359 * before `computeScreenBox` may be called.
11360 *
11361 * @param poiInfo - PoiInfo containing information for rendering the POI icon.
11362 * @param screenPosition - Position on screen (2D).
11363 * @param scale - Scale to apply to icon.
11364 * @param env - Current zoom level.
11365 * @param screenBox - Box that will be used to store the result.
11366 * @returns The computed screen box for the icon.
11367 */
11368 static computeIconScreenBox(poiInfo: PoiInfo, screenPosition: THREE_2.Vector2, scale: number, env: Env, screenBox?: Math2D.Box): Math2D.Box;
11369 private static m_missingTextureName;
11370 private m_renderBuffer;
11371 private m_tempScreenBox;
11372 /**
11373 * Create the `PoiRenderer` for the specified {@link MapView}.
11374 *
11375 * @param mapView - The MapView to be rendered to.
11376 * @param textCanvas - The [[TextCanvas]] this `PoiRenderer` is associated to. POIs are added to
11377 * the different layers of this [[TextCanvas]] based on renderOrder.
11378 */
11379 constructor(mapView: MapView, textCanvas: TextCanvas);
11380 /**
11381 * Prepare the POI for rendering, and determine which `poiRenderBatch` should be used. If a
11382 * `poiRenderBatch` is assigned, the POI is ready to be rendered.
11383 *
11384 * @param pointLabel - TextElement with PoiInfo for rendering the POI icon.
11385 * @param env - TODO! The current zoomLevel level of {@link MapView}
11386 *
11387 * @returns `True` if the space is not already allocated by another object (text label or POI)
11388 */
11389 prepareRender(pointLabel: TextElement, env: Env): boolean;
11390 /**
11391 * Reset all batches, removing all content from the [[PoiRenderBuffer]]es. Called at the
11392 * beginning of a frame before the POIs are placed.
11393 */
11394 reset(): void;
11395 /**
11396 * Render the icon.
11397 *
11398 * @param poiInfo - PoiInfo containing information for rendering the POI icon.
11399 * @param screenPosition - Position on screen (2D):
11400 * @param screenCollisions - Object handling the collision checks for screen-aligned 2D boxes.
11401 * @param viewDistance - Box's distance to camera.
11402 * @param scale - Scaling factor to apply to text and icon.
11403 * @param allocateScreenSpace - If `true` screen space will be allocated for the icon.
11404 * @param opacity - Opacity of icon to allow fade in/out.
11405 */
11406 renderPoi(poiInfo: PoiInfo, screenPosition: THREE_2.Vector2, screenCollisions: ScreenCollisions, viewDistance: number, scale: number, allocateScreenSpace: boolean, opacity: number, env: Env): void;
11407 /**
11408 * Update the geometry of all [[PoiRenderBuffer]]es. Called before rendering.
11409 */
11410 update(): void;
11411 /**
11412 * Fill the picking results for the pixel with the given screen coordinate. If multiple
11413 * {@link PoiInfo}s are found, the order of the results is unspecified.
11414 *
11415 * @param screenPosition - Screen coordinate of picking position.
11416 * @param pickCallback - Callback to be called for every picked element.
11417 */
11418 pickTextElements(screenPosition: THREE_2.Vector2, pickCallback: (pickData: any | undefined) => void): void;
11419 /**
11420 * Update the info with the memory footprint caused by objects owned by the `PoiRenderer`.
11421 *
11422 * @param info - The info object to increment with the values from this `PoiRenderer`.
11423 */
11424 getMemoryUsage(info: MemoryUsage): void;
11425 /**
11426 * Register the POI at the [[PoiRenderBuffer]] which may require some setup, for example loading
11427 * of the actual image.
11428 */
11429 private preparePoi;
11430 /**
11431 * Setup texture and material for the batch.
11432 *
11433 * @param poiInfo - {@link PoiInfo} to initialize.
11434 * @param imageTexture - Shared {@link @here/harp-datasource-protocol#ImageTexture},
11435 * defines used area in atlas.
11436 * @param imageItem - Shared {@link ImageItem}, contains cached image for texture.
11437 * @param env - The current zoom level of {@link MapView}
11438 */
11439 private setupPoiInfo;
11440}
11441
11442declare class PoiRendererFactory {
11443 private readonly m_mapView;
11444 /**
11445 * Creates an instance of poi renderer factory.
11446 * @param m_mapView -
11447 */
11448 constructor(m_mapView: MapView);
11449 /**
11450 * Creates poi renderer
11451 * @param textCanvas -
11452 * @returns
11453 */
11454 createPoiRenderer(textCanvas: TextCanvas): PoiRenderer;
11455}
11456
11457/**
11458 * Define the stacking option. Enum values for theme file are in "kebab-case".
11459 */
11460export declare enum PoiStackMode {
11461 /**
11462 * Show in a stack.
11463 */
11464 Show = "show-in-stack",
11465 /**
11466 * Do not show in a stack.
11467 */
11468 Hide = "hide-in-stack",
11469 /**
11470 * Show category parent in the stack.
11471 */
11472 ShowParent = "show-parent"
11473}
11474
11475/**
11476 * Render feature as POIs (icons and text) rendered in screen space.
11477 *
11478 * @see [[MarkerTechniqueParams]].
11479 */
11480export declare type PoiStyle = BaseStyle<"labeled-icon", MarkerTechniqueParams>;
11481
11482/**
11483 * The `PoiTable` stores individual information for each POI type. If a {@link TextElement} has a
11484 * reference to a PoiTable (if TextElement.poiInfo.poiTableName is set), information for the
11485 * TextElement and its icon are read from the PoiTable.
11486 *
11487 * The key to look up the POI is taken from the data, in case of OSM data with TileZen data, the
11488 * `poiNameField` is set to `kind`, which makes the content of the field `kind` in the data the key
11489 * to look up the POIs in the {@link PoiTable}.
11490 *
11491 * On the side of the {@link PoiTable}, the key to look up the PoiTableEntry is either the property
11492 * "name" of the [[PoiTableEntry]] (which should be unique), or the alternative list of names
11493 * `altNames`, where each value should also be unique. If the property `useAltNamesForKey` is set to
11494 * `true`, the `altNames` will be used.
11495 */
11496export declare class PoiTable {
11497 readonly name: string;
11498 readonly useAltNamesForKey: boolean;
11499 /**
11500 * Stores the list of [[PoiTableEntry]]s.
11501 */
11502 private readonly poiList;
11503 /**
11504 * Dictionary to look up for [[PoiTableEntry]] quickly. The dictionary is either created for
11505 * the `name` property of the [[PoiTableEntry]], which will identify POI, or for all of
11506 * alternative the names defined in `altNames` of [[PoiTableEntry]] JSON object.
11507 * Value assigned to key it is the index to [[poiList]] array which contain actual
11508 * [[PoiTabelEntry]] objects.
11509 */
11510 private readonly poiDict;
11511 private m_isLoading;
11512 private m_loadedOk;
11513 /**
11514 * Creates an instance of PoiTable.
11515 *
11516 * @param {string} name Name of the `PoiTable`. Must be unique.
11517 * @param {boolean} useAltNamesForKey Pass `true` to use the contents of the property `altNames`
11518 * to find a [[PoiTableEntry]] in the table.
11519 */
11520 constructor(name: string, useAltNamesForKey: boolean);
11521 /**
11522 * Returns `true` if the table is currently being loaded, `false` otherwise.
11523 *
11524 * @readonly
11525 */
11526 get isLoading(): boolean;
11527 /**
11528 * Returns `true` if the table has been loaded correctly, `false` otherwise.
11529 *
11530 * @readonly
11531 */
11532 get loadedOk(): boolean;
11533 /**
11534 * Gets [[PoiTableEntry]] for poi name specified.
11535 *
11536 * @param poiName - poi name or one of its alternative names if [[useAltNamesForKey]] is
11537 * set to `true`.
11538 * @returns [[PoiTableEntry]] object or undefined if name was not found in dictionary.
11539 */
11540 getEntry(poiName: string): PoiTableEntry | undefined;
11541 /**
11542 * Start to load the PoiTable from the specified URL. Can only be called once per table.
11543 *
11544 * @param {string} poiTableUrl URL that points to the JSON file.
11545 *
11546 * @returns {Promise<boolean>} Promise is being resolved once the JSON file has been fetched and
11547 * the `PoiTable` has been set up.
11548 */
11549 load(poiTableUrl: string): Promise<boolean>;
11550 private startLoading;
11551 private finishedLoading;
11552}
11553
11554/**
11555 * Interface for the JSON description of the [[PoiTable]]. It is being implemented in [[PoiTable]].
11556 */
11557export declare interface PoiTableDef {
11558 /** Name of the `PoiTable`. Must be unique. */
11559 name?: string;
11560 /**
11561 * Stores the list of [[PoiTableEntry]]s.
11562 */
11563 poiList?: PoiTableEntryDef[];
11564}
11565
11566/**
11567 * Class to store and maintain individual POI information for the {@link PoiTable}.
11568 */
11569declare class PoiTableEntry implements PoiTableEntryDef {
11570 /**
11571 * Verify that the JSON description of the POI table entry is valid.
11572 *
11573 * @param jsonEntry - JSON description of the POI table entry.
11574 *
11575 * @returns `true` if the `jsonEntry` is valid.
11576 */
11577 static verifyJSON(jsonEntry: PoiTableEntryDef): boolean;
11578 /** Default name of the POI as the key for looking it up. */
11579 name?: string;
11580 /** Alternative names of the POI. */
11581 altNames?: string[];
11582 /** Visibility of the POI. If `false`, the POI will not be rendered. */
11583 visible?: boolean;
11584 /** Name of the icon, defined in the the texture atlases. */
11585 iconName?: string;
11586 /** Stacking mode of the POI. For future use. */
11587 stackMode?: PoiStackMode;
11588 /**
11589 * Priority of the POI to select the visible set in case there are more POIs than can be
11590 * handled.
11591 */
11592 priority?: number;
11593 /** Minimum zoom level to render the icon on. */
11594 iconMinLevel?: number;
11595 /** Maximum zoom level to render the icon on. */
11596 iconMaxLevel?: number;
11597 /** Minimum zoom level to render the text label on. */
11598 textMinLevel?: number;
11599 /** Maximum zoom level to render the text label on. */
11600 textMaxLevel?: number;
11601 /**
11602 * Setup the [[PoiTableEntry]] from the JSON description. It is assumed that the jsonEntry has
11603 * been verified with [[PoiTableEntry#verifyJSON]].
11604 *
11605 * @param jsonEntry - JSON description of the POI table entry. Expected to have been verified
11606 * with [[PoiTableEntry#verifyJSON]].
11607 */
11608 setup(jsonEntry: PoiTableEntryDef): void;
11609}
11610
11611/**
11612 * Interface for the JSON description of the [[PoiTableEntry]]. The interface is being implemented
11613 * as [[PoiTableEntry]].
11614 */
11615export declare interface PoiTableEntryDef {
11616 /** Default name of the POI as the key for looking it up. */
11617 name?: string;
11618 /** Alternative names of the POI. */
11619 altNames?: string[];
11620 /** Visibility of the POI. If `false`, the POI will not be rendered. */
11621 visible?: boolean;
11622 /** Name of the icon, defined in the the texture atlases. */
11623 iconName?: string;
11624 /** Stacking mode of the POI. For future use. */
11625 stackMode?: string;
11626 /**
11627 * Priority of the POI to select the visible set in case there are more POIs than can be
11628 * handled.
11629 */
11630 priority?: number;
11631 /** Minimum zoom level to render the icon on. */
11632 iconMinLevel?: number;
11633 /** Maximum zoom level to render the icon on. */
11634 iconMaxLevel?: number;
11635 /** Minimum zoom level to render the text label on. */
11636 textMinLevel?: number;
11637 /** Maximum zoom level to render the text label on. */
11638 textMaxLevel?: number;
11639}
11640
11641/**
11642 * The `PoiTableManager` manages the list of [[PoiTables]] that
11643 * can be defined in the {@link @here/harp-datasource-protocol#Theme} sfile.
11644 */
11645export declare class PoiTableManager {
11646 readonly mapView: MapView;
11647 private m_isLoading;
11648 private m_poiTables;
11649 /**
11650 * Creates an instance of PoiTableManager.
11651 * @param {MapView} mapView Owning {@link MapView}.
11652 */
11653 constructor(mapView: MapView);
11654 /**
11655 * Load the {@link PoiTable}s that are stored in the {@link MapView}s
11656 * {@link @here/harp-datasource-protocol#Theme}.
11657 *
11658 * @remarks
11659 * Note that duplicate names of {@link PoiTable}s in the
11660 * {@link @here/harp-datasource-protocol#Theme} will lead to inaccessible {@link PoiTable}s.
11661 *
11662 * @param theme - {@link @here/harp-datasource-protocol#Theme}
11663 * containing all {@link PoiTable}s to load.
11664 *
11665 * @returns Resolved once all the {@link PoiTable}s in
11666 * the {@link @here/harp-datasource-protocol#Theme} have been loaded.
11667 */
11668 loadPoiTables(theme: Theme): Promise<void>;
11669 /**
11670 * Clear the list of {@link PoiTable}s.
11671 */
11672 clear(): void;
11673 /**
11674 * Return the map of {@link PoiTable}s.
11675 */
11676 get poiTables(): Map<string, PoiTable>;
11677 /**
11678 * Manually add a {@link PoiTable}. Normally, the [[PoiTables]]s
11679 * are specified in the {@link @here/harp-datasource-protocol#Theme}.
11680 *
11681 * @remarks
11682 * Ensure that the name is unique.
11683 */
11684 addTable(poiTable: PoiTable): void;
11685 /**
11686 * Retrieve a {@link PoiTable} by name.
11687 *
11688 * @param {(string | undefined)} poiTableName Name of the {@link PoiTable}.
11689 *
11690 * @returns {(PoiTable | undefined)} The found [[poiTable]] if it could be found, `undefined`
11691 * otherwise.
11692 */
11693 getPoiTable(poiTableName: string | undefined): PoiTable | undefined;
11694 /**
11695 * Return `true` if the {@link PoiTable}s have finished loading.
11696 *
11697 * @readonly
11698 */
11699 get finishedLoading(): boolean;
11700 private startLoading;
11701 private finishLoading;
11702}
11703
11704/**
11705 * Definition for a [[PoiTable]] reference as part of the {@link Theme} object.
11706 */
11707export declare interface PoiTableRef {
11708 /** Required name of the [[PoiTable]] for later reference. */
11709 name: string;
11710 /**
11711 * Required URL from where to load [[PoiTable]].
11712 *
11713 * Should refer to JSON that is matched [[PoiTableDef]] interface.
11714 */
11715 url: string;
11716 /**
11717 * If set to `true`, the list of values in the field "altNames" will be used as names for this
11718 * POI.
11719 */
11720 useAltNamesForKey: boolean;
11721}
11722
11723/**
11724 * Runtime representation of [[PoiStyle]] as parsed by [[StyleSetEvaluator]].
11725 * For technique parameters see [[MarkerTechniqueParams]].
11726 */
11727export declare interface PoiTechnique extends MakeTechniqueAttrs<MarkerTechniqueParams> {
11728 name: "labeled-icon";
11729}
11730
11731/**
11732 * {@link DataSource} providing geometry for poles
11733 */
11734export declare class PolarTileDataSource extends DataSource {
11735 private m_tilingScheme;
11736 private m_maxLatitude;
11737 private m_geometryLevelOffset;
11738 private m_debugTiles;
11739 private m_styleSetEvaluator?;
11740 private m_northPoleEntry?;
11741 private m_southPoleEntry?;
11742 constructor({ name, styleSetName, minDataLevel, maxDataLevel, minDisplayLevel, maxDisplayLevel, storageLevelOffset, geometryLevelOffset, debugTiles }: PolarTileDataSourceOptions);
11743 /** @override */
11744 dispose(): void;
11745 createTechiqueEntry(kind: string): TechniqueEntry | undefined;
11746 /** @override */
11747 setStyleSet(styleSet?: StyleSet, definitions?: Definitions, languages?: string[]): void;
11748 /** @override */
11749 setTheme(theme: Theme, languages?: string[]): void;
11750 /** @override */
11751 canGetTile(zoomLevel: number, tileKey: TileKey): boolean;
11752 /** @override */
11753 shouldSubdivide(zoomLevel: number, tileKey: TileKey): boolean;
11754 /** @override */
11755 getTilingScheme(): TilingScheme;
11756 /** @override */
11757 getTile(tileKey: TileKey): Tile;
11758 get geometryLevelOffset(): number;
11759 set geometryLevelOffset(geometryLevelOffset: number);
11760 private intersectEdge;
11761 private createTileGeometry;
11762}
11763
11764export declare interface PolarTileDataSourceOptions extends DataSourceOptions {
11765 /**
11766 * Optional level offset of regular tiles from reference datasource to align tiles to.
11767 * Default is -1.
11768 */
11769 geometryLevelOffset?: number;
11770 /**
11771 * Enable debug display for generated tiles.
11772 * Default is false.
11773 */
11774 debugTiles?: boolean;
11775}
11776
11777/**
11778 * A {@link TilingScheme} featuring quadtree subdivision scheme and
11779 * transverse Mercator projection.
11780 */
11781export declare const polarTilingScheme: TilingScheme;
11782
11783/**
11784 * Represents "Polygon" GeoJSON geometry object.
11785 */
11786export declare interface Polygon {
11787 type: "Polygon";
11788 coordinates: number[][][];
11789}
11790
11791/**
11792 * Declares a a geometry as a polygon.
11793 */
11794export declare interface PolygonalTechniqueParams {
11795 /**
11796 * Whether to use polygon offset. Default is false. This corresponds to the
11797 * GL_POLYGON_OFFSET_FILL WebGL feature.
11798 *
11799 * PolygonOffset is used to raise the geometry towards the geometry (for depth calculation
11800 * only). Default is false.
11801 *
11802 * See here: https://sites.google.com/site/threejstuts/home/polygon_offset
11803 *
11804 * To activate polygonOffset these values have to be set to pull the line "forwards":
11805 *
11806 * transparent: true
11807 *
11808 * polygonOffset: true
11809 *
11810 * polygonOffsetFactor : -1.0, (as an example, see link above)
11811 *
11812 * polygonOffsetUnits: -1 (as an example, see link above)
11813 */
11814 polygonOffset?: boolean;
11815 /**
11816 * Sets the polygon offset factor. Default is 0.
11817 */
11818 polygonOffsetFactor?: DynamicProperty<number>;
11819 /**
11820 * Sets the polygon offset units. Default is 0.
11821 */
11822 polygonOffsetUnits?: DynamicProperty<number>;
11823 /**
11824 * Sets the polygon outline color.
11825 * @format color-hex
11826 */
11827 lineColor?: DynamicProperty<StyleColor>;
11828 /**
11829 * Distance to the camera (0.0 = nearPlane, 1.0 = farPlane) at which the object edges start
11830 * fading out.
11831 */
11832 lineFadeNear?: DynamicProperty<number>;
11833 /**
11834 * Distance to the camera (0.0 = nearPlane, 1.0 = farPlane) at which the object edges become
11835 * transparent. A value of <= 0.0 disables fading.
11836 */
11837 lineFadeFar?: DynamicProperty<number>;
11838}
11839
11840export declare interface PostEffects {
11841 bloom?: IBloomEffect;
11842 outline?: IOutlineEffect;
11843 vignette?: IVignetteEffect;
11844 sepia?: ISepiaEffect;
11845}
11846
11847/**
11848 * A `PriorityListElement` has a priority to assist in sorting. The idea is that the items in a
11849 * grouped priority list will not modify their priority during processing to such an amount, that
11850 * they will change into another group. Smaller lists are smaller to sort, and in case of resource
11851 * limitation (maximum number of rendered objects reached), not all items have to be sorted at all.
11852 */
11853declare interface PriorityListElement {
11854 /**
11855 * The integer value of this priority is used to group objects of "same" priority.
11856 */
11857 priority: number;
11858}
11859
11860/**
11861 * The `PriorityListGroup` contains a list of {@link PriorityListElement}s that all have the same
11862 * (integer) priority.
11863 */
11864declare class PriorityListGroup<T extends PriorityListElement> {
11865 readonly priority: number;
11866 elements: T[];
11867 constructor(priority: number, elements?: T[]);
11868 /**
11869 * Create and return a deep copy of the `PriorityListGroup<T>`.
11870 *
11871 * @returns A clone of the `PriorityListGroup<T>`.
11872 */
11873 clone(): PriorityListGroup<T>;
11874 /**
11875 * Removes an element from the group.
11876 * @param element - The element to remove.
11877 * @returns true if the element was removed, false if it was not found in the group.
11878 */
11879 remove(element: T): boolean;
11880}
11881
11882/**
11883 * The `PriorityListGroupMap` is a map to map the (integer) priority to a {@link PriorityListGroup}.
11884 */
11885declare type PriorityListGroupMap<T extends PriorityListElement> = Map<number, PriorityListGroup<T>>;
11886
11887/**
11888 * `Projection` is used to convert positions from geo coordinates to world coordinates and vice
11889 * versa.
11890 */
11891export declare abstract class Projection {
11892 readonly unitScale: number;
11893 /**
11894 * The type of this [Projection].
11895 */
11896 abstract get type(): ProjectionType;
11897 /**
11898 * Constructs the Projection
11899 *
11900 * @param unitScale - How to transform the projected coordinates to world units.
11901 */
11902 constructor(unitScale: number);
11903 /**
11904 * Returns the world extents in world coordinates.
11905 *
11906 * @param minElevation - The minimum elevation in meters.
11907 * @param maxElevation - The maximum elevation in meters.
11908 * @param result - The optional object that will be used to create the resulting bounding box.
11909 */
11910 abstract worldExtent<Bounds extends Box3Like>(minElevation: number, maxElevation: number, result?: Bounds): Bounds;
11911 /**
11912 * Projects a point from geo coordinates (latitude, longitude, altitude) to world coordinates
11913 * (x,y,z).
11914 *
11915 * Example:
11916 * ```typescript
11917 * const worldPos = new THREE.Vector3();
11918 * projection.projectPoint(geoPos, worldPos);
11919 * ```
11920 *
11921 * @param geoPoint - The position in geo coordinates.
11922 * @param result - The optional object used to store the resulting world position, result must
11923 * implement {@link Vector3Like}.
11924 */
11925 abstract projectPoint<WorldCoordinates extends Vector3Like>(geoPoint: GeoCoordinatesLike, result?: WorldCoordinates): WorldCoordinates;
11926 /**
11927 * Gets the {@link TransformLike} of the local tangent space at the given point.
11928 *
11929 * @param point - The geo / world coordinates.
11930 * @param result - The {@link TransformLike}.
11931 */
11932 localTangentSpace(point: GeoCoordinatesLike | Vector3Like, result: TransformLike): TransformLike;
11933 /**
11934 * Returns the geo coordinates (latitude, longitude, altitude) from the given world position
11935 * (x,y,z).
11936 *
11937 * Example:
11938 * ```typescript
11939 * const geoPos = projection.unprojectPoint(worldPos);
11940 * console.log(geoPos.latitude, geoPos.longitude, geoPos.altitude);
11941 * ```
11942 *
11943 * @param worldPoint - The position in world coordinates.
11944 */
11945 abstract unprojectPoint(worldPoint: Vector3Like): GeoCoordinates;
11946 /**
11947 * Returns the altitude at the given world position (x,y,z) in meters.
11948 *
11949 * @param worldPoint - The position in world coordinates.
11950 */
11951 abstract unprojectAltitude(worldPoint: Vector3Like): number;
11952 /**
11953 * Projects bounds in geo coordinates to a bounding box in world coordinates.
11954 *
11955 * Example:
11956 * ```typescript
11957 * const bounds = projection.projectBox(geoBox);
11958 * console.log(bounds.min, bounds.max);
11959 * ```
11960 *
11961 * @param geoBox - The bounding box in geo coordinates.
11962 */
11963 abstract projectBox(geoBox: GeoBox): Box3Like;
11964 /**
11965 * Projects bounds in geo coordinates to a bounding box in world coordinates.
11966 *
11967 * Example:
11968 * ```typescript
11969 * const bounds = projection.projectBox(geoBox, new THREE.Box3());
11970 * console.log(bounds.min, bounds.max);
11971 * ```
11972 *
11973 * @param geoBox - The bounding box in geo coordinates.
11974 * @param result - The resulting {@link OrientedBox3Like}.
11975 */
11976 abstract projectBox<WorldBoundingBox extends Box3Like | OrientedBox3Like>(geoBox: GeoBox, result: WorldBoundingBox): WorldBoundingBox;
11977 /**
11978 * Converts a bounding box in world coordinates to a bounding box in geo coordinates.
11979 *
11980 * Example:
11981 * ```typescript
11982 * const geoPos = projection.unprojectPoint(worldPos);
11983 * console.log(geoPos.latitude, geoPos.longitude, geoPos.altitude);
11984 * ```
11985 *
11986 * @param worldBox - The bounding box in world coordinates.
11987 */
11988 abstract unprojectBox(worldBox: Box3Like): GeoBox;
11989 /**
11990 * Returns the scaling factor that must be used to convert the units used by `worldPoint` to
11991 * meters.
11992 *
11993 * @param worldPoint - The position in world coordinates.
11994 */
11995 abstract getScaleFactor(worldPoint: Vector3Like): number;
11996 /**
11997 * Returns the surface normal at the given world position.
11998 *
11999 * @param worldPoint - The position in world coordinates.
12000 */
12001 abstract surfaceNormal(worldPoint: Vector3Like): Vector3Like;
12002 /**
12003 * Returns the surface normal at the given world position.
12004 *
12005 * @param worldPoint - The position in world coordinates.
12006 * @returns The resulting normal vector.
12007 */
12008 abstract surfaceNormal<Normal extends Vector3Like>(worldPoint: Vector3Like, result: Normal): Normal;
12009 /**
12010 * Returns the signed distance between the given coordinates and
12011 * the closest point on the surface.
12012 *
12013 * @param worldPoint - The position in world coordinates.
12014 */
12015 abstract groundDistance(worldPoint: Vector3Like): number;
12016 /**
12017 * Scales the given world coordinates to the surface.
12018 *
12019 * @param worldPoint - The position in world coordinates.
12020 */
12021 abstract scalePointToSurface(worldPoint: Vector3Like): Vector3Like;
12022 /**
12023 * Reproject a world position from the given source {@link Projection}.
12024 *
12025 * @param sourceProjection - The source projection.
12026 * @param worldPos - A valid world position for the given source projection.
12027 * @returns The world position reprojected using this {@link Projection}.
12028 */
12029 reprojectPoint(sourceProjection: Projection, worldPos: Vector3Like): Vector3Like;
12030 /**
12031 * Reproject a world position from the given source {@link Projection}.
12032 *
12033 * @param sourceProjection - The source projection.
12034 * @param worldPos - A valid position in the world space defined by the source projection.
12035 * @param result - The resulting position reprojected using this {@link Projection}.
12036 */
12037 reprojectPoint<WorldCoordinates extends Vector3Like>(sourceProjection: Projection, worldPos: Vector3Like, result: WorldCoordinates): WorldCoordinates;
12038}
12039
12040/**
12041 * The type of projection.
12042 */
12043export declare enum ProjectionType {
12044 /**
12045 * A type of [Projection] with zero curvature.
12046 */
12047 Planar = 0,
12048 /**
12049 * A spherical [Projection].
12050 */
12051 Spherical = 1
12052}
12053
12054/**
12055 * A class used to represent a quadtree.
12056 */
12057export declare class QuadTree {
12058 readonly tilingScheme: TilingScheme;
12059 /**
12060 * Constructs a new `QuadTree` for the given {@link TilingScheme}.
12061 *
12062 * Example:
12063 * ```typescript
12064 * const quadTree = new QuadTree(hereTilingScheme);
12065 * const geoBox = quadTree.getGeoBox(tileKey);
12066 * console.log(geoBox.center);
12067 * ```
12068 *
12069 * @param tilingScheme - The TilingScheme used by this `QuadTree`.
12070 */
12071 constructor(tilingScheme: TilingScheme);
12072 /**
12073 * Visits this `QuadTree` and invoke the given accept method
12074 * with the current {@link TileKey} and
12075 * its bounding box in geo coordinates.
12076 *
12077 * Example:
12078 * ```typescript
12079 * const geoPos = new GeoCoordinates(latitude, longitude);
12080 * const quadTree = new QuadTree(hereTilingScheme);
12081 * quadTree.visit((tileKey, geoBox) => {
12082 * if (geoBox.contains(geoPos)) {
12083 * console.log("tile", tileKey, "contains", geoPos);
12084 * return tileKey.level < 14; // stop visiting the quadtree if the level is >= 14.
12085 * }
12086 * return false; // stop visiting the quadtree,
12087 * // the tile's geoBox doesn't contain the given coordinates.
12088 * });
12089 * ```
12090 *
12091 * @param accept - A function that takes a {@link TileKey}
12092 * and its bounding box in geo coordinates
12093 * and returns `true` if the visit of the `QuadTree`
12094 * should continue; otherwise `false`.
12095 */
12096 visit(accept: (tileKey: TileKey, geoBox: GeoBox) => boolean): void;
12097 /**
12098 * Visits the subtree starting from the given tile.
12099 *
12100 * @param tileKey - The root of the subtree that should be visited.
12101 * @param accept - A function that takes a {@link TileKey}
12102 * and its bounding box in geo coordinates
12103 * and returns `true` if the visit of the
12104 * `QuadTree` should continue; otherwise `false`.
12105 */
12106 visitTileKey(tileKey: TileKey, accept: (tileKey: TileKey, geoBox: GeoBox) => boolean): void;
12107}
12108
12109/**
12110 * {@link SubdivisionScheme} representing a quadtree.
12111 */
12112export declare const quadTreeSubdivisionScheme: SubdivisionScheme;
12113
12114/**
12115 * @internal
12116 */
12117export declare type RelationalOp = "<" | ">" | "<=" | ">=";
12118
12119export declare type RemoveInterpolatedPropDef<T> = T | InterpolatedPropertyDefinition<any> extends T ? Exclude<T, InterpolatedPropertyDefinition<any>> : T;
12120
12121export declare type RemoveJsonExpr<T> = T | JsonExpr extends T ? Exclude<T, JsonExpr> : T;
12122
12123/**
12124 * The type of `RenderEvent`.
12125 */
12126export declare interface RenderEvent extends THREE_2.Event {
12127 type: MapViewEventNames.Render | MapViewEventNames.FirstFrame | MapViewEventNames.FrameComplete | MapViewEventNames.ThemeLoaded | MapViewEventNames.AnimationStarted | MapViewEventNames.AnimationFinished | MapViewEventNames.MovementStarted | MapViewEventNames.MovementFinished | MapViewEventNames.ContextLost | MapViewEventNames.ContextRestored | MapViewEventNames.CopyrightChanged;
12128 time?: number;
12129}
12130
12131/**
12132 * Allows to cancel and prioritize requests inside the requestQueue.
12133 *
12134 * @remarks
12135 * Useful to optimize the order of decoding tiles during animations and camera movements.
12136 *
12137 * `RequestController` is not extending [[AbortController]], because this is not supported in ES5.
12138 */
12139export declare class RequestController implements AbortController {
12140 priority: number;
12141 abortController: AbortController;
12142 /**
12143 * Creates an instance of `RequestController`.
12144 *
12145 * @param {number} priority
12146 * @param {AbortController} abortController Optional [[AbortController]] used internally, since
12147 * [[AbortController]]s should not be subclassed.
12148 */
12149 constructor(priority?: number, abortController?: AbortController);
12150 get signal(): AbortSignal;
12151 /**
12152 * Invoking this method will set this object's AbortSignal's aborted flag and
12153 * signal to any observers that the associated activity is to be aborted.
12154 */
12155 abort(): void;
12156}
12157
12158export declare interface RequestHeaders {
12159 [field: string]: string;
12160}
12161
12162declare interface RequestHeaders_2 {
12163 [field: string]: string;
12164}
12165
12166/**
12167 * Like [[StyleDeclaration]], but without [[Reference]] type.
12168 */
12169export declare type ResolvedStyleDeclaration = Style & StyleSelector;
12170
12171/**
12172 * Like [[StyleSet]], but without [[Reference]] type.
12173 */
12174export declare type ResolvedStyleSet = ResolvedStyleDeclaration[];
12175
12176/**
12177 * Way the memory consumption of a tile is computed. Either in number of tiles, or in MegaBytes. If
12178 * it is in MB, an estimation is used.
12179 */
12180export declare enum ResourceComputationType {
12181 EstimationInMb = 0,
12182 NumberOfTiles = 1
12183}
12184
12185/**
12186 * A class representing RGBA colors.
12187 *
12188 * @hidden
12189 * @internal
12190 */
12191declare class RGBA {
12192 r: number;
12193 g: number;
12194 b: number;
12195 a: number;
12196 /**
12197 * Parses a string describing a color.
12198 *
12199 * @param text - The string color literal
12200 */
12201 static parse(text: string): RGBA | undefined;
12202 /**
12203 * Constructs a [[RGBA]] color using the given components in the [0..1] range.
12204 */
12205 constructor(r?: number, g?: number, b?: number, a?: number);
12206 /**
12207 * Clones this [[RGBA]] color.
12208 */
12209 clone(): RGBA;
12210 /**
12211 * Returns this color encoded as one single number.
12212 */
12213 getHex(): number;
12214 /**
12215 * Linearly interpolate the components of this color.
12216 */
12217 lerp(target: RGBA, t: number): this;
12218 /**
12219 * Returns this color encoded as JSON literal.
12220 */
12221 toJSON(): string;
12222}
12223
12224/**
12225 * A simple ring buffer to store the last `n` values of the timer. The buffer works on
12226 * a First-In-First-Out (FIFO) basis.
12227 */
12228export declare class RingBuffer<T> {
12229 readonly capacity: number;
12230 buffer: T[];
12231 size: number;
12232 head: number;
12233 tail: number;
12234 /**
12235 * Sets up the ring buffer.
12236 *
12237 * @param capacity - The buffer's capacity.
12238 */
12239 constructor(capacity: number);
12240 /**
12241 * Clears the contents, removes all elements.
12242 */
12243 clear(): void;
12244 /**
12245 * Adds a single element to the ring buffer.
12246 *
12247 * @param data - Data element.
12248 */
12249 enqOne(data: T): void;
12250 /**
12251 * Adds one or more elements.
12252 *
12253 * @param data - The elements to add.
12254 */
12255 enq(...data: T[]): void;
12256 /**
12257 * Obtains the oldest element (FIFO). May throw an exception if a buffer underrun occurs.
12258 * Before calling this method, make sure that `size > 0`.
12259 */
12260 deq(): T;
12261 /**
12262 * Obtains the oldest element (FIFO) without removing it. Throws an exception if a buffer is
12263 * empty. Before calling this method, make sure that `size > 0`.
12264 */
12265 get top(): T;
12266 /**
12267 * Obtains the latest element (LIFO) without removing it. Throws an exception if a buffer is
12268 * empty. Before calling this method, make sure that `size > 0`.
12269 */
12270 get bottom(): T;
12271 /**
12272 * Creates an iterator for the buffer.
12273 */
12274 iterator(): RingBuffer.Iterator<T>;
12275 /**
12276 * Returns a copy of the buffer, where the elements are properly sorted from oldest to newest.
12277 */
12278 asArray(): T[];
12279}
12280
12281export declare namespace RingBuffer {
12282 /**
12283 * A local class for RingBuffer<T>
12284 */
12285 export class Iterator<T> {
12286 private m_buffer;
12287 private m_index;
12288 /**
12289 * Creates an iterator for the ring buffer.
12290 *
12291 * @param m_buffer - `Ringbuffer` to iterate over.
12292 * @param m_index - Start index.
12293 */
12294 constructor(m_buffer: RingBuffer<T>, m_index?: number);
12295 /**
12296 * Gets the iterator's current value. This function does not fail even if an overrun occurs.
12297 * To detect an overrun, watch the result for [[next]].
12298 */
12299 get value(): T;
12300 /**
12301 * Advances the iterator to the next element.
12302 *
12303 * @returns `true` if the iterator is still valid; `false` if an overrun occurs.
12304 */
12305 next(): boolean;
12306 }
12307}
12308
12309/**
12310 * A timer that stores the last `n` samples in a ring buffer.
12311 */
12312export declare class SampledTimer extends SimpleTimer {
12313 statistics: Statistics;
12314 readonly name: string;
12315 /**
12316 * The number of times the timer has reset.
12317 */
12318 numResets: number;
12319 /**
12320 * Maximum samples until the statistics are reset and updated, which may destroy a median
12321 * computation.
12322 */
12323 maxNumSamples: number;
12324 /**
12325 * The array of sampled values, its length cannot exceed `maxNumSamples`.
12326 */
12327 samples: RingBuffer<number>;
12328 /**
12329 * Creates a `SampledTimer` instance. Must still be added to statistics if it should be logged!
12330 *
12331 * @param statistics - Statistics to use for management.
12332 * @param name - Name of the timer. Use colons to build a hierarchy.
12333 */
12334 constructor(statistics: Statistics, name: string);
12335 /**
12336 * Resets the timer and clears all of its historical values.
12337 * @override
12338 */
12339 reset(): void;
12340 /**
12341 * Add a single measurement to the sample.
12342 *
12343 * @param val - A measurement to add.
12344 * @override
12345 */
12346 setValue(val: number | undefined): void;
12347 /**
12348 * Updates the `min`, `max`, `avg`, and `median` values. Currently, this function is expensive,
12349 * as it requires a copy of the sampled values.
12350 */
12351 getStats(): Stats | undefined;
12352}
12353
12354declare class ScreenCollisions {
12355 /** The screen bounding box. */
12356 readonly screenBounds: Math2D.Box;
12357 /** Tree of allocated bounds. */
12358 private rtree;
12359 /**
12360 * Constructs a new ScreenCollisions object.
12361 */
12362 constructor();
12363 /**
12364 * Resets the list of allocated screen bounds.
12365 */
12366 reset(): void;
12367 /**
12368 * Updates the screen bounds that are used to check if bounding boxes are visible.
12369 *
12370 * @param width - The width of the container.
12371 * @param height - The height of the container.
12372 */
12373 update(width: number, height: number): void;
12374 /**
12375 * Marks the region of the screen intersecting with the given bounding box as allocated.
12376 *
12377 * @param bounds - The bounding box in NDC scaled coordinates (i.e. top left is -width/2,
12378 * -height/2)
12379 */
12380 allocate(bounds: Math2D.Box | CollisionBox | DetailedCollisionBox): void;
12381 /**
12382 * Inserts the given bounds into the rtree.
12383 *
12384 * @param bounds - The bounding boxes (the bounding boxes must be in the space returned from the
12385 * ScreenProjector.project method).
12386 */
12387 allocateIBoxes(bounds: IBox[]): void;
12388 /**
12389 * Search for all bounds in the tree intersecting with the given box.
12390 * @param box - The box used for the search.
12391 * @returns An array of all IBoxes intersecting with the given box.
12392 */
12393 search(box: CollisionBox): IBox[];
12394 /**
12395 * Checks if the given bounding box is already allocated.
12396 *
12397 * @param bounds - The bounding box in world coordinates.
12398 */
12399 isAllocated(bounds: Math2D.Box | CollisionBox): boolean;
12400 /**
12401 * Checks if the given screen bounds intersects with the frustum of the active camera.
12402 *
12403 * @param bounds - The bounding box in world coordinates.
12404 */
12405 isVisible(bounds: Math2D.Box): boolean;
12406 /**
12407 * Checks if the given screen bounds is contained within the frustum of the active camera.
12408 *
12409 * @param bounds - The bounding box in world coordinates.
12410 */
12411 isFullyVisible(bounds: Math2D.Box): boolean;
12412 /**
12413 * Test whether a given [[CollisionBox]] intersects with any of the details in the specified
12414 * [[IBox]]es.
12415 *
12416 * @param testBox - The box to test for intersection.
12417 * @param boxes - The candidate boxes the test box may intersect with. It's assumed that the
12418 * global bounds of these boxes intersect with the given test box.
12419 * @returns `true` if any intersection found.
12420 */
12421 intersectsDetails(testBox: CollisionBox, boxes: IBox[]): boolean;
12422 /**
12423 * Computes the intersection between the supplied CollisionBox and the LineWithBound.
12424 * @note The [[CollisionBox]] is in Screen Bounds space, whereas the line must be
12425 * in Screen Coordinate space
12426 */
12427 private intersectsLine;
12428}
12429
12430/**
12431 * @hidden
12432 * Handles the projection of world coordinates to screen coordinates.
12433 */
12434declare class ScreenProjector {
12435 private m_camera;
12436 static tempV2: THREE_2.Vector2;
12437 static tempV3: THREE_2.Vector3;
12438 private m_width;
12439 private m_height;
12440 /**
12441 * Constructs a new `ScreenProjector`.
12442 *
12443 * @param m_camera - Camera to project against.
12444 */
12445 constructor(m_camera: THREE_2.Camera);
12446 /**
12447 * Height of the screen.
12448 */
12449 get width(): number;
12450 /**
12451 * Width of the screen.
12452 */
12453 get height(): number;
12454 /**
12455 * Apply current projectionViewMatrix of the camera to project the source vector into
12456 * screen coordinates.
12457 *
12458 * @param {(Vector3Like)} source The source vector to project.
12459 * @param {THREE.Vector2} target The target vector.
12460 * @returns {THREE.Vector2} The projected vector (the parameter 'target') or undefined if
12461 * outside the near / far plane.
12462 */
12463 project(source: Vector3Like, target?: THREE_2.Vector2): THREE_2.Vector2 | undefined;
12464 /**
12465 * Apply current projectionViewMatrix of the camera to project the source vector into
12466 * screen coordinates.
12467 *
12468 * @param {(Vector3Like)} source The source vector to project.
12469 * @param {THREE.Vector2} target The target vector.
12470 * @returns {THREE.Vector2} The projected vector (the parameter 'target') or undefined if
12471 * outside the screen.
12472 */
12473 projectOnScreen(source: Vector3Like, target?: THREE_2.Vector2): THREE_2.Vector2 | undefined;
12474 /**
12475 * Apply current projectionViewMatrix of the camera to project the source vector into
12476 * screen coordinates. The z component between -1 and 1 is also returned.
12477 *
12478 * @param {(Vector3Like)} source The source vector to project.
12479 * @param {THREE.Vector3} target The target vector.
12480 * @returns {THREE.Vector3} The projected vector (the parameter 'target') or undefined if
12481 * outside the near / far plane.
12482 */
12483 project3(source: Vector3Like, target?: THREE_2.Vector3): THREE_2.Vector3 | undefined;
12484 /**
12485 * Apply current projectionViewMatrix of the camera to project the source vector. Stores
12486 * result in NDC in the target vector.
12487 *
12488 * @param {(Vector3Like)} source The source vector to project.
12489 * @param {THREE.Vector3} target The target vector.
12490 * @returns {THREE.Vector3} The projected vector (the parameter 'target').
12491 */
12492 projectVector(source: Vector3Like, target: THREE_2.Vector3): THREE_2.Vector3;
12493 /**
12494 * Fast test to check if projected point is on screen.
12495 *
12496 * @returns {boolean} `true` if point is on screen, `false` otherwise.
12497 */
12498 onScreen(source: Vector3Like): boolean;
12499 /**
12500 * Update the `ScreenProjector` with the latest values of the screen and the camera.
12501 *
12502 * @param {THREE.Camera} camera Camera to project against.
12503 * @param {number} width Width of screen/canvas.
12504 * @param {number} height Height of screen/canvas.
12505 */
12506 update(camera: THREE_2.Camera, width: number, height: number): void;
12507 private ndcToScreen;
12508}
12509
12510/**
12511 * Render feature as segments.
12512 */
12513export declare type SegmentsStyle = BaseStyle<"segments", SegmentsTechniqueParams>;
12514
12515/**
12516 * Runtime representation of [[SegmentsStyle]] as parsed by [[StyleSetEvaluator]].
12517 * For technique parameters see [[SegmentsTechniqueParams]].
12518 */
12519export declare interface SegmentsTechnique extends MakeTechniqueAttrs<SegmentsTechniqueParams> {
12520 name: "segments";
12521}
12522
12523/**
12524 * Declares a geometry as a segment.
12525 */
12526export declare interface SegmentsTechniqueParams extends BaseTechniqueParams {
12527 /**
12528 * Color of segments in a hexadecimal notation, for example: `"#e4e9ec"` or `"#fff"`.
12529 * @format color-hex
12530 */
12531 color: DynamicProperty<StyleColor>;
12532 /**
12533 * Set to `true` if line should appear transparent. Rendering transparent lines may come with a
12534 * slight performance impact.
12535 */
12536 transparent?: boolean;
12537 /**
12538 * For transparent lines, set a value between `0.0` for fully transparent, to `1.0` for fully
12539 * opaque.
12540 */
12541 opacity?: DynamicProperty<number>;
12542 /**
12543 * Width of a line in meters.
12544 */
12545 lineWidth: DynamicProperty<number>;
12546}
12547
12548/**
12549 * Sets up all the needed stencil logic needed for the depth pre-pass.
12550 *
12551 * This logic is in place to avoid z-fighting artifacts that can appear in geometries that have
12552 * coplanar triangles inside the same mesh.
12553 *
12554 * @param depthMesh - Mesh created by `createDepthPrePassMesh`.
12555 * @param colorMesh - Original mesh.
12556 */
12557export declare function setDepthPrePassStencil(depthMesh: THREE_2.Mesh, colorMesh: THREE_2.Mesh): void;
12558
12559export declare type ShaderStyle = BaseStyle<"shader", ShaderTechniqueParams>;
12560
12561/**
12562 * Special technique for user-defined shaders.
12563 * For technique parameters see [[ShaderTechniqueParams]].
12564 */
12565export declare interface ShaderTechnique extends MakeTechniqueAttrs<ShaderTechniqueParams> {
12566 name: "shader";
12567}
12568
12569export declare interface ShaderTechniqueMaterialParameters {
12570 [name: string]: any;
12571}
12572
12573/**
12574 * Special technique for user-defined shaders. See
12575 * https://threejs.org/docs/#api/harp-materials/ShaderMaterial for details.
12576 */
12577export declare interface ShaderTechniqueParams extends BaseTechniqueParams {
12578 /**
12579 * Parameters for shader. See `THREE.ShaderMaterialParameters`.
12580 */
12581 params: ShaderTechniqueMaterialParameters;
12582 /**
12583 * Type of primitive for the shader technique. Valid values are "point" | "line" | "segments" |
12584 * "mesh"
12585 */
12586 primitive: "point" | "line" | "segments" | "mesh";
12587 /**
12588 * Set to 'true' if line should appear transparent. Rendering transparent lines may come with a
12589 * slight performance impact.
12590 * See https://threejs.org/docs/#api/en/materials/Material.transparent.
12591 */
12592 transparent?: boolean;
12593 [name: string]: any;
12594}
12595
12596export declare interface SimpleFrameStatistics {
12597 configs: Map<string, string>;
12598 appResults: Map<string, number>;
12599 frames: Map<string, number | number[]>;
12600 messages: Array<string[] | undefined>;
12601 frameStats?: Map<string, Stats | undefined>;
12602 zoomLevelLabels?: string[];
12603 zoomLevelData?: Map<string, number | number[]>;
12604}
12605
12606/**
12607 * A simple timer that stores only the latest measurement.
12608 */
12609export declare class SimpleTimer implements Timer {
12610 statistics: Statistics;
12611 readonly name: string;
12612 /** `true` if timer has been started. */
12613 running: boolean;
12614 private m_currentValue?;
12615 constructor(statistics: Statistics, name: string);
12616 /**
12617 * Gets the latest measurement. This function may return `undefined` if no measurement
12618 * was done.
12619 */
12620 get value(): number | undefined;
12621 /**
12622 * Sets the measurement value for the amount of time that has elapsed from start() to stop().
12623 * Use this function to override the timer's duration.
12624 *
12625 * @param val - The timer's duration.
12626 */
12627 setValue(val: number | undefined): void;
12628 /**
12629 * Resets the value to be able to start again.
12630 */
12631 reset(): void;
12632 /**
12633 * Starts the timer. Returns the current time, based on `Performance.now()`.
12634 */
12635 start(): number;
12636 /**
12637 * Stops the timer. Requires that the timer has started.
12638 */
12639 stop(): number;
12640 /**
12641 * Samples the timer. Requires that the timer has started.
12642 *
12643 * @returns the current timer value; `-1` if statistics are disabled.
12644 */
12645 now(): number;
12646}
12647
12648/**
12649 * Interface that defines the options to configure the sky.
12650 */
12651export declare type Sky = GradientSky | CubemapSky;
12652
12653export declare type SolidLineStyle = BaseStyle<"solid-line" | "dashed-line", SolidLineTechniqueParams>;
12654
12655/**
12656 * Runtime representation of [[SolidLineStyle]] as parsed by [[StyleSetEvaluator]].
12657 * For technique parameters see [[SolidLineTechniqueParams]].
12658 */
12659export declare interface SolidLineTechnique extends MakeTechniqueAttrs<SolidLineTechniqueParams> {
12660 name: "solid-line" | "dashed-line";
12661}
12662
12663/** @internal */
12664export declare const solidLineTechniqueDescriptor: TechniqueDescriptor<SolidLineTechnique>;
12665
12666/**
12667 * Declares a a geometry as a solid line.
12668 */
12669export declare interface SolidLineTechniqueParams extends BaseTechniqueParams, PolygonalTechniqueParams {
12670 /**
12671 * Color of a line in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
12672 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
12673 * @format color-hex
12674 */
12675 color: DynamicProperty<StyleColor>;
12676 /**
12677 * Color of a line outline in hexadecimal or CSS-style notation,
12678 * for example: `"#e4e9ec"`, `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
12679 * @format color-hex
12680 */
12681 outlineColor?: DynamicProperty<StyleColor>;
12682 /**
12683 * Set to `true` if line should appear transparent. Rendering transparent lines may come with a
12684 * slight performance impact.
12685 */
12686 transparent?: boolean;
12687 /**
12688 * For transparent lines, set a value between `0.0` for fully transparent, to `1.0` for fully
12689 * opaque.
12690 */
12691 opacity?: DynamicProperty<number>;
12692 /**
12693 * @deprecated Specify metrics units as part of the value instead.
12694 * Units in which different size properties are specified. Either `Meter` (default) or `Pixel`.
12695 */
12696 metricUnit?: string;
12697 /**
12698 * Width of a line in `metricUnit` for different zoom levels.
12699 */
12700 lineWidth: DynamicProperty<StyleLength>;
12701 /**
12702 * Outline width of a line in `metricUnit`s for different zoom levels.
12703 */
12704 outlineWidth?: DynamicProperty<StyleLength>;
12705 /**
12706 * Clip the line outside the tile if `true`.
12707 */
12708 clipping?: DynamicProperty<boolean>;
12709 /**
12710 * Describes line caps type (`"None"`, `"Round"`, `"Square"`, `"TriangleOut"`, `"TriangleIn"`).
12711 * Default is `"Round"`.
12712 */
12713 caps?: DynamicProperty<LineCaps>;
12714 /**
12715 * Color of secondary line geometry in hexadecimal or CSS-style notation, for example:
12716 * `"#e4e9ec"`, `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
12717 * @format color-hex
12718 */
12719 secondaryColor?: DynamicProperty<StyleColor>;
12720 /**
12721 * Width of secondary line geometry in `metricUnit`s for different zoom levels.
12722 */
12723 secondaryWidth?: DynamicProperty<StyleLength>;
12724 /**
12725 * The render order of the secondary line geometry object created using this technique.
12726 */
12727 secondaryRenderOrder?: DynamicProperty<number>;
12728 /**
12729 * Describes secondary line caps type (`"None"`, `"Round"`, `"Square"`, `"TriangleOut"`,
12730 * `"TriangleIn"`).
12731 * Default is `"Round"`.
12732 */
12733 secondaryCaps?: DynamicProperty<LineCaps>;
12734 /**
12735 * Describes the category of the secondary geometry object created using this technique.
12736 */
12737 secondaryCategory?: DynamicProperty<string>;
12738 /**
12739 * Describes the starting drawing position for the line (in the range [0...1]).
12740 * Default is `0.0`.
12741 */
12742 drawRangeStart?: number;
12743 /**
12744 * Describes the ending drawing position for the line (in the range [0...1]).
12745 * Default is `1.0`.
12746 */
12747 drawRangeEnd?: number;
12748 /**
12749 * Describes line dash type (`"Round"`, `"Square"`, `"Diamond"`).
12750 * Default is `"Square"`.
12751 */
12752 dashes?: DynamicProperty<LineDashes>;
12753 /**
12754 * Color of a line dashes in hexadecimal or CSS-style notation,
12755 * for example: `"#e4e9ec"`, `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
12756 * @format color-hex
12757 */
12758 dashColor?: DynamicProperty<StyleColor>;
12759 /**
12760 * Length of a line in meters for different zoom levels.
12761 */
12762 dashSize?: DynamicProperty<StyleLength>;
12763 /**
12764 * Size of a gap between lines in meters for different zoom levels.
12765 */
12766 gapSize?: DynamicProperty<StyleLength>;
12767 /**
12768 * Size in world units how far to offset the line perpendicular to its direction.
12769 */
12770 offset?: DynamicProperty<number>;
12771}
12772
12773export declare const sphereProjection: Projection;
12774
12775/**
12776 * Point object that implements the raycasting of squares in screen space.
12777 */
12778export declare class Squares extends MapViewPoints {
12779 /** @override */
12780 testPoint(point: THREE_2.Vector3, screenPosition: THREE_2.Vector2, pickCoordinates: THREE_2.Vector2, index: number, distance: number, intersects: THREE_2.Intersection[]): void;
12781}
12782
12783/**
12784 * Render feature as set of squares rendered in screen space.
12785 *
12786 * @see [[PointTechniqueParams]].
12787 */
12788export declare type SquaresStyle = BaseStyle<"squares", PointTechniqueParams>;
12789
12790/**
12791 * Runtime representation of [[SquaresStyle]] as parsed by [[StyleSetEvaluator]].
12792 * For technique parameters see [[PointTechniqueParams]].
12793 */
12794export declare interface SquaresTechnique extends MakeTechniqueAttrs<PointTechniqueParams> {
12795 name: "squares";
12796}
12797
12798/** @internal */
12799export declare const squaresTechniquePropTypes: TechniqueDescriptor<SquaresTechnique>;
12800
12801export declare type StandardExtrudedLineStyle = BaseStyle<"extruded-line", StandardExtrudedLineTechniqueParams>;
12802
12803/**
12804 * Runtime representation of [[StandardExtrudedLineStyle]] as parsed by [[StyleSetEvaluator]].
12805 * For technique parameters see [[StandardExtrudedLineTechniqueParams]].
12806 */
12807export declare interface StandardExtrudedLineTechnique extends MakeTechniqueAttrs<StandardExtrudedLineTechniqueParams> {
12808 name: "extruded-line";
12809}
12810
12811/**
12812 * Declares a a geometry as a standard extruded line.
12813 */
12814export declare interface StandardExtrudedLineTechniqueParams extends StandardTechniqueParams, PolygonalTechniqueParams {
12815 /**
12816 * A value determining the shading technique. Valid values are `"basic"` and `"standard"`.
12817 * Default is `"basic"`.
12818 *
12819 * `"basic"` : Simple shading, faster to render. Only simple color and opacity are effective.
12820 * `"standard"` : Elaborate shading, with metalness, and roughness.
12821 */
12822 shading: "standard";
12823 /**
12824 * Width of a line in meters for different zoom levels.
12825 */
12826 lineWidth: DynamicProperty<number>;
12827 /**
12828 * Style of both end caps. Possible values: `"None"`, `"Circle"`. A value of undefined maps to
12829 * `"Circle"`.
12830 */
12831 caps?: DynamicProperty<"None" | "Circle">;
12832}
12833
12834/**
12835 * Standard kinds of geometry.
12836 */
12837export declare enum StandardGeometryKind {
12838 /**
12839 * Used in the enabledKinds/disabledKinds filter to match any kind.
12840 */
12841 All = "_all_",
12842 /**
12843 * Background geometry.
12844 */
12845 Background = "background",
12846 /**
12847 * Terrain geometry.
12848 */
12849 Terrain = "terrain",
12850 /**
12851 * Default value for the FillTechnique.
12852 */
12853 Area = "area",
12854 /**
12855 * Default value for all line techniques.
12856 */
12857 Line = "line",
12858 /**
12859 * Default value for the FillTechnique.
12860 */
12861 Water = "water",
12862 /**
12863 * Political borders.
12864 */
12865 Border = "border",
12866 /**
12867 * Basis for all roads.
12868 */
12869 Road = "road",
12870 /**
12871 * Default value for the ExtrudedPolygonTechnique.
12872 */
12873 Building = "building",
12874 /**
12875 * Default value for the TextTechnique, LineMarkerTechnique and the PoiTechnique.
12876 */
12877 Label = "label",
12878 /**
12879 * Anything that may show up last.
12880 */
12881 Detail = "detail"
12882}
12883
12884export declare type StandardStyle = BaseStyle<"standard", StandardTechniqueParams>;
12885
12886/**
12887 * Technique used to render a mesh geometry.
12888 * For technique parameters see [[StandardTechniqueParams]].
12889 */
12890export declare interface StandardTechnique extends MakeTechniqueAttrs<StandardTechniqueParams> {
12891 name: "standard";
12892}
12893
12894/**
12895 * Standard technique parameters.
12896 */
12897export declare interface StandardTechniqueParams extends BaseTechniqueParams {
12898 /**
12899 * Color of the feature in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`,
12900 * `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
12901 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.color.
12902 * @format color-hex
12903 */
12904 color?: DynamicProperty<StyleColor>;
12905 /**
12906 * A value of `true` creates a wireframe geometry. (May not be supported with all techniques).
12907 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.wireframe.
12908 */
12909 wireframe?: boolean;
12910 /**
12911 * If `vertexColors` is `true`, every vertex has color information, which is interpolated
12912 * between vertices.
12913 * See https://threejs.org/docs/#api/en/materials/Material.vertexColors.
12914 */
12915 vertexColors?: boolean;
12916 /**
12917 * How rough the material appears. `0.0` means a smooth mirror reflection. `1.0` means fully
12918 * diffuse. Default is `1.0`.
12919 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness.
12920 */
12921 roughness?: DynamicProperty<number>;
12922 /**
12923 * How much the material is like a metal. Nonmetallic materials such as wood or stone use `0.0`,
12924 * metallic ones use `1.0`, with nothing (usually) in between. Default is `0.0`. A value between
12925 * `0.0` and `1.0` can be used for a rusty metal look. If `metalnessMap` is also provided, both
12926 * values are multiplied.
12927 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness.
12928 */
12929 metalness?: DynamicProperty<number>;
12930 /**
12931 * The material will not be rendered if the opacity is lower than this value.
12932 * See https://threejs.org/docs/#api/en/materials/Material.alphaTest.
12933 */
12934 alphaTest?: DynamicProperty<number>;
12935 /**
12936 * Skip rendering clobbered pixels.
12937 * See https://threejs.org/docs/#api/en/materials/Material.depthTest.
12938 */
12939 depthTest?: boolean;
12940 /**
12941 * Set to 'true' if line should appear transparent. Rendering transparent lines may come with a
12942 * slight performance impact.
12943 * See https://threejs.org/docs/#api/en/materials/Material.transparent.
12944 */
12945 transparent?: boolean;
12946 /**
12947 * For transparent lines, set a value between 0.0 for totally transparent, to 1.0 for totally
12948 * opaque.
12949 * See https://threejs.org/docs/#api/en/materials/Material.opacity.
12950 */
12951 opacity?: DynamicProperty<number>;
12952 /**
12953 * Emissive (light) color of the material, essentially a solid color unaffected by other
12954 * lighting. Default is black.
12955 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.emissive.
12956 * @format color-hex
12957 */
12958 emissive?: DynamicProperty<StyleColor>;
12959 /**
12960 * Intensity of the emissive light. Modulates the emissive color. Default is `1`.
12961 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.emissiveIntensity.
12962 */
12963 emissiveIntensity?: DynamicProperty<number>;
12964 /**
12965 * The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of
12966 * the material. It is used with environment mapping modes `THREE.CubeRefractionMapping` and
12967 * `THREE.EquirectangularRefractionMapping`. The refraction ratio should not exceed `1`. Default
12968 * is `0.98`.
12969 * See https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.refractionRatio.
12970 */
12971 refractionRatio?: DynamicProperty<number>;
12972 /**
12973 * Whether and how texture coordinates should be generated. No texture coordinates are
12974 * generated if `undefined`.
12975 * Should be set if any texture assigned (e.g. `map`, `normalMap`, ...).
12976 */
12977 textureCoordinateType?: TextureCoordinateType;
12978 map?: string | TextureBuffer;
12979 mapProperties?: TextureProperties;
12980 /**
12981 * URL or texture buffer that should be used as normal map. See:
12982 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.normalMap
12983 */
12984 normalMap?: string | TextureBuffer;
12985 normalMapType?: number;
12986 normalMapProperties?: TextureProperties;
12987 /**
12988 * URL or texture buffer that should be used as displacement map. See:
12989 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.displacementMap
12990 */
12991 displacementMap?: string | TextureBuffer;
12992 displacementMapProperties?: TextureProperties;
12993 /**
12994 * URL or texture buffer that should be used as roughness map. See:
12995 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughnessMap
12996 */
12997 roughnessMap?: string | TextureBuffer;
12998 roughnessMapProperties?: TextureProperties;
12999 /**
13000 * URL or texture buffer that should be used as emissive map. See:
13001 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.emissiveMap
13002 */
13003 emissiveMap?: string | TextureBuffer;
13004 emissiveMapProperties?: TextureProperties;
13005 /**
13006 * URL or texture buffer that should be used as bump map. See:
13007 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.bumpMap
13008 */
13009 bumpMap?: string | TextureBuffer;
13010 bumpMapProperties?: TextureProperties;
13011 /**
13012 * URL or texture buffer that should be used as metalness map. See:
13013 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalnessMap
13014 */
13015 metalnessMap?: string | TextureBuffer;
13016 metalnessMapProperties?: TextureProperties;
13017 /**
13018 * URL or texture buffer that should be used as alpha map. See:
13019 * https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.alphaMap
13020 */
13021 alphaMap?: string | TextureBuffer;
13022 alphaMapProperties?: TextureProperties;
13023}
13024
13025/**
13026 * Manages a set of timers. The main objective of `Statistics` is to log these timers. You can
13027 * disable statistics to minimize their impact on performance.
13028 */
13029export declare class Statistics {
13030 name?: string | undefined;
13031 enabled: boolean;
13032 private timers;
13033 private nullTimer;
13034 /**
13035 * Sets up a group of timers.
13036 *
13037 * @param name - The statistics name, for logging purposes.
13038 * @param enabled - If `false`, the timers do not measure the performance.
13039 */
13040 constructor(name?: string | undefined, enabled?: boolean);
13041 /**
13042 * Adds a timer, based on the name specified.
13043 *
13044 * @param name - The timer's name; must be unique.
13045 */
13046 createTimer(name: string, keepSamples?: boolean): Timer;
13047 /**
13048 * Adds the timer specified.
13049 *
13050 * @param timer - The timer's name, which must be unique within this statistics object.
13051 */
13052 addTimer(timer: Timer): Timer;
13053 /**
13054 * Gets a timer by name.
13055 *
13056 * @param name - The timer's name.
13057 */
13058 getTimer(name: string): Timer;
13059 /**
13060 * Checks if a timer with the specified name already exists.
13061 *
13062 * @param name - The timer's name.
13063 * @returns `true` if a timer with `name` already exists; `false` otherwise.
13064 */
13065 hasTimer(name: string): boolean;
13066 /**
13067 * Resets all timers.
13068 */
13069 reset(): void;
13070 /**
13071 * Prints all values to the console.
13072 *
13073 * @param header - Optional header line.
13074 * @param footer - Optional footer line.
13075 */
13076 log(header?: string, footer?: string): void;
13077}
13078
13079/**
13080 * Simple statistics about the values in an array.
13081 */
13082export declare interface Stats {
13083 /**
13084 * The lowest value in the array.
13085 */
13086 min: number;
13087 /**
13088 * The highest value in the array.
13089 */
13090 max: number;
13091 /**
13092 * The average duration of all values in the array.
13093 */
13094 avg: number;
13095 /**
13096 * The median duration of all values in the array.
13097 */
13098 median: number;
13099 /**
13100 * The 75th percentile median of all values in the array.
13101 */
13102 median75: number;
13103 /**
13104 * The 90th percentile median of all values in the array.
13105 */
13106 median90: number;
13107 /**
13108 * The 95th percentile median of all values in the array.
13109 */
13110 median95: number;
13111 /**
13112 * The 97th percentile median of all values in the array.
13113 */
13114 median97: number;
13115 /**
13116 * The 99th percentile median of all values in the array.
13117 */
13118 median99: number;
13119 /**
13120 * The 99.9th percentile median of all values in the array.
13121 */
13122 median999: number;
13123 /**
13124 * The number of values in the array.
13125 */
13126 numSamples: number;
13127}
13128
13129/**
13130 * A node representing a `step` expression.
13131 */
13132export declare class StepExpr extends Expr {
13133 readonly input: Expr;
13134 readonly defaultValue: Expr;
13135 readonly stops: Array<[number, Expr]>;
13136 constructor(input: Expr, defaultValue: Expr, stops: Array<[number, Expr]>);
13137 /** @override */
13138 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
13139 /** @override */
13140 protected exprIsDynamic(): boolean;
13141}
13142
13143/**
13144 * Array of all supported [[StringEncodedNumeralFormat]]s describing color data.
13145 * @internal
13146 */
13147export declare const StringEncodedColorFormats: StringEncodedNumeralFormat[];
13148
13149/**
13150 * Array of all supported [[StringEncodedNumeralFormat]]s describing sizes, lengths and distances.
13151 * @internal
13152 */
13153export declare const StringEncodedMetricFormats: StringEncodedNumeralFormat[];
13154
13155/**
13156 * Interface containing information about a [[StringEncodedNumeral]] format, component size and
13157 * evaluation.
13158 * @internal
13159 */
13160export declare interface StringEncodedNumeralFormat {
13161 readonly type: StringEncodedNumeralType;
13162 readonly size: number;
13163 readonly regExp: RegExp;
13164 mask?: number;
13165 decoder: (encodedValue: string, target: number[]) => boolean;
13166}
13167
13168/**
13169 * @internal
13170 */
13171export declare const StringEncodedNumeralFormatMaxSize: number;
13172
13173/**
13174 * Array of supported [[StringEncodedNumeralFormat]]s (intended to be indexed with
13175 * [[StringEncodedNumeralType]] enum).
13176 * @internal
13177 */
13178export declare const StringEncodedNumeralFormats: StringEncodedNumeralFormat[];
13179
13180/**
13181 * Enumeration of supported string encoded numerals.
13182 * @internal
13183 */
13184export declare enum StringEncodedNumeralType {
13185 Meters = 0,
13186 Pixels = 1,
13187 Hex = 2
13188}
13189
13190/**
13191 * String literal expression.
13192 */
13193export declare class StringLiteralExpr extends LiteralExpr {
13194 readonly value: string;
13195 private m_promotedValue?;
13196 constructor(value: string);
13197 /**
13198 * Returns the value of parsing this string as [[RGBA]] or [[Pixels]] constant.
13199 */
13200 get promotedValue(): RGBA | Pixels | undefined;
13201 /** @override */
13202 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
13203}
13204
13205export declare type Style = SquaresStyle | CirclesStyle | PoiStyle | LineMarkerStyle | LineStyle | SegmentsStyle | SolidLineStyle | LabelRejectionLineStyle | FillStyle | StandardStyle | BasicExtrudedLineStyle | StandardExtrudedLineStyle | ExtrudedPolygonStyle | ShaderStyle | TerrainStyle | TextTechniqueStyle | NoneStyle;
13206
13207/**
13208 * Color literals.
13209 *
13210 * @remarks
13211 * Description of colors inside a style. Supports hex values as well as CSS hex, rgb and hsl values
13212 * (i.e. `0xffffff`, `#f00fab`, `#aaa`, `rgb(255, 0 120)`, `hsl(360, 100%, 100%)`, etc.).
13213 */
13214export declare type StyleColor = string | number;
13215
13216/**
13217 * Compound type that merges all raw [Style] with selector arguments from [BaseSelector], optionally
13218 * a [[Reference]].
13219 */
13220export declare type StyleDeclaration = (Style & StyleSelector) | JsonExpr;
13221
13222/**
13223 * Length literals.
13224 *
13225 * @remarks
13226 * Description of length units inside a style. Supports literal values (interpreted as `m`), `m` and
13227 * `px`(i.e. `80`, `14px`, `0.6m`, etc.).
13228 */
13229export declare type StyleLength = string | number;
13230
13231/**
13232 * A type representing symbolic render orders.
13233 */
13234export declare interface StylePriority {
13235 /**
13236 * The group of this [[StylePriority]].
13237 */
13238 group: string;
13239 /**
13240 * The category of this [[StylePriority]].
13241 */
13242 category?: string;
13243}
13244
13245/**
13246 * A dictionary of [[StyleSet]]s.
13247 */
13248export declare interface Styles {
13249 [styleSetName: string]: StyleSet;
13250}
13251
13252/**
13253 * Base [StyleSelector] attributes required to match [Style] object against given feature.
13254 *
13255 * Contains [Style]'s members related to feature matching in [[StyleSetEvaluator]].
13256 */
13257export declare interface StyleSelector {
13258 /**
13259 * Condition when this style rule applies.
13260 *
13261 * @remarks
13262 * Condition that is applied to feature properties to check if given [[Style]] this feature
13263 * should emit geometry of this style.
13264 */
13265 when: string | JsonExpr;
13266 /**
13267 * The layer containing the carto features processed by this style rule.
13268 */
13269 layer?: string;
13270 /**
13271 * Optional. If `true`, no more matching styles will be evaluated.
13272 */
13273 final?: boolean;
13274}
13275
13276/**
13277 * An array of [[StyleSelector]]s that are used together to define how a [[DataSource]] should be
13278 * rendered. `StyleSet`s are applied to sources providing vector tiles via their method
13279 * `setStyleSet`. This is also handle internally when a whole theme is passed to a [[MapView]] via
13280 * `mapview.theme`.
13281 */
13282export declare type StyleSet = StyleDeclaration[];
13283
13284/**
13285 * Interface representing a `SubdivisionScheme`.
13286 */
13287export declare interface SubdivisionScheme {
13288 /**
13289 * Returns the number of columns for the given level.
13290 *
13291 * @param level - The level.
13292 */
13293 getSubdivisionX(level: number): number;
13294 /**
13295 * Returns the number of rows for the given level.
13296 *
13297 * @param level - The level.
13298 */
13299 getSubdivisionY(level: number): number;
13300 /**
13301 * Returns the width of the partitions at the given level.
13302 *
13303 * @param level - The level.
13304 */
13305 getLevelDimensionX(level: number): number;
13306 /**
13307 * Returns the height of the partitions at the given level.
13308 *
13309 * @param level - The level.
13310 */
13311 getLevelDimensionY(level: number): number;
13312}
13313
13314export declare class SubTiles implements Iterable<TileKey> {
13315 tileKey: TileKey;
13316 sizeX: number;
13317 sizeY: number;
13318 constructor(tileKey: TileKey, sizeX: number, sizeY: number);
13319 [Symbol.iterator](): Iterator<TileKey>;
13320}
13321
13322export declare namespace SubTiles {
13323 export function RowColumnIterator(parentKey: TileKey, sizeX: number, sizeY: number): Iterator<TileKey>;
13324 export function ZCurveIterator(parentKey: TileKey): Iterator<TileKey>;
13325}
13326
13327/**
13328 * Possible techniques that can be used to draw a geometry on the map.
13329 */
13330export declare type Technique = SquaresTechnique | CirclesTechnique | PoiTechnique | LineMarkerTechnique | LineTechnique | SegmentsTechnique | SolidLineTechnique | FillTechnique | StandardTechnique | TerrainTechnique | BasicExtrudedLineTechnique | StandardExtrudedLineTechnique | ExtrudedPolygonTechnique | ShaderTechnique | TextTechnique | LabelRejectionLineTechnique;
13331
13332declare type TechniqueByName<K extends Technique["name"]> = OneThatMatches<Technique, {
13333 name: K;
13334}>;
13335
13336declare interface TechniqueDescriptor<T> {
13337 attrTransparencyColor?: string;
13338 attrScopes: TechniquePropScopes<T>;
13339}
13340
13341declare type TechniqueDescriptorRegistry = {
13342 [P in Technique["name"]]?: TechniqueDescriptor<TechniqueByName<P>>;
13343};
13344
13345/** @internal */
13346export declare const techniqueDescriptors: TechniqueDescriptorRegistry;
13347
13348declare interface TechniqueEntry {
13349 technique: Technique;
13350 material: THREE_2.Material;
13351}
13352
13353/**
13354 * Extract property names from [[Technique]]-like interface (excluding `name`) as union of string
13355 * literals.
13356 *
13357 * TechniquePropName<Base
13358 *
13359 */
13360declare type TechniquePropNames<T> = T extends {
13361 name: any;
13362} ? keyof Omit<T, "name"> : keyof T;
13363
13364declare type TechniquePropScopes<T> = {
13365 [P in TechniquePropNames<T>]?: AttrScope;
13366};
13367
13368export declare type TerrainStyle = BaseStyle<"terrain", TerrainTechniqueParams>;
13369
13370/**
13371 * Technique used to render a terrain geometry with textures.
13372 * For technique parameters see [[TerrainTechniqueParams]].
13373 */
13374export declare interface TerrainTechnique extends MakeTechniqueAttrs<TerrainTechniqueParams> {
13375 name: "terrain";
13376}
13377
13378/**
13379 * Technique used to render a terrain geometry with a texture.
13380 * When using this technique, the datasource will produce texture coordinates in
13381 * local tile space (i.e. [0,0] at south-west and [1,1] at north-east tile corner).
13382 */
13383export declare interface TerrainTechniqueParams extends StandardTechniqueParams {
13384 /**
13385 * Colors to be applied at different heights (as a results of a `displacementMap`).
13386 */
13387 heightBasedColors?: HeightBasedColors;
13388 /**
13389 * If `heightBasedColors` is defined, this value defines the interpolation method used to
13390 * generate the height-based gradient texture (defaults to `Discrete`).
13391 */
13392 heightGradientInterpolation?: "Discrete" | "Linear" | "Cubic";
13393 /**
13394 * If `heightBasedColors` is defined, this value defines the width (in pixels) of the generated
13395 * gradient texture (defaults to `128`).
13396 */
13397 heightGradientWidth?: number;
13398}
13399
13400/**
13401 * Optional parameters passed on [[TextCanvas]].`addTextBufferObject` function call.
13402 */
13403declare interface TextBufferAdditionParameters {
13404 layer?: number;
13405 position?: THREE_2.Vector3;
13406 scale?: number;
13407 rotation?: number;
13408 color?: THREE_2.Color;
13409 opacity?: number;
13410 backgroundColor?: THREE_2.Color;
13411 backgroundOpacity?: number;
13412 pickingData?: any;
13413}
13414
13415/**
13416 * Optional parameters passed on [[TextCanvas]].`createTextBufferObject` function call.
13417 */
13418declare interface TextBufferCreationParameters {
13419 /**
13420 * Path where text should be placed on. Overrides the original position parameter.
13421 */
13422 path?: THREE_2.Path | THREE_2.CurvePath<THREE_2.Vector2>;
13423 /**
13424 * If `true`, text on a path will be placed even when its size its bigger than the path's size.
13425 */
13426 pathOverflow?: boolean;
13427 /**
13428 * Output text bounding-box.
13429 */
13430 outputBounds?: boolean;
13431 /**
13432 * Output per-character bounds.
13433 */
13434 outputCharacterBounds?: boolean;
13435 /**
13436 * Array containing info on whether the glyphs are upper or lower case. Needed to support
13437 * `SmallCaps`.
13438 */
13439 letterCaseArray?: boolean[];
13440 /**
13441 * If `true`, both the [[TextRenderStyle]] and [[TextLayoutStyle]] used to generate the
13442 * [[TextBufferObject]] will be stored in it.
13443 */
13444 storeStyles?: boolean;
13445}
13446
13447/**
13448 * Object containing vertex buffer data generated by [[TextCanvas]].
13449 */
13450declare class TextBufferObject {
13451 readonly glyphs: GlyphData[];
13452 readonly buffer: Float32Array;
13453 readonly bounds?: THREE_2.Box2 | undefined;
13454 readonly characterBounds?: THREE_2.Box2[] | undefined;
13455 readonly textRenderStyle?: TextRenderStyle | undefined;
13456 readonly textLayoutStyle?: TextLayoutStyle | undefined;
13457 /**
13458 * Constructs a new `TextBufferObject`.
13459 *
13460 * @param glyphs - Input glyphs.
13461 * @param buffer - Buffer containing the data generated by [[TextCanvas]].
13462 * @param bounds - Optional text bounds.
13463 * @param characterBounds - Optional character bounds.
13464 * @param textRenderStyle - [[TextRenderStyle]] applied by [[TextCanvas]].
13465 * @param textLayoutStyle - [[TextLayoutStyle]] applied by [[TextCanvas]].
13466 *
13467 * @returns New `TextBufferObject`.
13468 */
13469 constructor(glyphs: GlyphData[], buffer: Float32Array, bounds?: THREE_2.Box2 | undefined, characterBounds?: THREE_2.Box2[] | undefined, textRenderStyle?: TextRenderStyle | undefined, textLayoutStyle?: TextLayoutStyle | undefined);
13470}
13471
13472/**
13473 * three.js text rendering engine which can manage and render high-quality, transformable, stylable
13474 * and properly layout SDF and MSDF text.
13475 */
13476declare class TextCanvas {
13477 private static defaultTextRenderStyle;
13478 private static defaultTextLayoutStyle;
13479 /**
13480 * Minimum amount of glyphs each [[TextCanvas]] layer can store.
13481 */
13482 readonly minGlyphCount: number;
13483 /**
13484 * Maximum amount of glyphs each [[TextCanvas]] layer can store.
13485 */
13486 readonly maxGlyphCount: number;
13487 private m_renderer;
13488 private m_fontCatalog;
13489 private m_currentTextRenderStyle;
13490 private m_currentTextLayoutStyle;
13491 private m_material;
13492 private m_bgMaterial;
13493 private m_ownsMaterial;
13494 private m_ownsBgMaterial;
13495 private m_defaultLayer;
13496 private m_layers;
13497 private m_lineTypesetter;
13498 private m_pathTypesetter;
13499 /**
13500 * Constructs a new `TextCanvas`.
13501 *
13502 * @param params - `TextCanvas` construction parameters.
13503 *
13504 * @returns New `TextCanvas`.
13505 */
13506 constructor(params: TextCanvasParameters);
13507 /**
13508 * Currently active [[FontCatalog]].
13509 */
13510 get fontCatalog(): FontCatalog;
13511 set fontCatalog(value: FontCatalog);
13512 /**
13513 * Currently active text rendering material.
13514 */
13515 get material(): THREE_2.Material;
13516 set material(value: THREE_2.Material);
13517 /**
13518 * Currently active text background rendering material.
13519 */
13520 get backgroundMaterial(): THREE_2.Material;
13521 set backgroundMaterial(value: THREE_2.Material);
13522 /**
13523 * Currently active text rendering style.
13524 */
13525 get textRenderStyle(): TextRenderStyle;
13526 set textRenderStyle(style: TextRenderStyle);
13527 /**
13528 * Currently active text layout style.
13529 */
13530 get textLayoutStyle(): TextLayoutStyle;
13531 set textLayoutStyle(style: TextLayoutStyle);
13532 /**
13533 * Clears all the placed glyphs in this `TextCanvas` (as well as resetting the current style).
13534 */
13535 clear(): void;
13536 /**
13537 * Renders the content of this `TextCanvas`.
13538 *
13539 * @param camera - Orthographic camera.
13540 * @param target - Optional render target.
13541 * @param clear - Optional render target clear operation.
13542 */
13543 render(camera: THREE_2.OrthographicCamera, target?: THREE_2.WebGLRenderTarget, clear?: boolean): void;
13544 /**
13545 * Creates a new `TextCanvas` rendering layer and returns. If there was already a layer for the
13546 * input `layerId`, it just returns this one instead.
13547 *
13548 * @param layerId - Desired layer identifier.
13549 *
13550 * @returns Created [[TextCanvasLayer]].
13551 */
13552 addLayer(layerId: number): TextCanvasLayer;
13553 /**
13554 * Retrieves a specific `TextCanvas` rendering layer.
13555 *
13556 * @param layerId - Desired layer identifier.
13557 *
13558 * @returns Selected [[TextCanvasLayer]].
13559 */
13560 getLayer(layerId: number): TextCanvasLayer | undefined;
13561 /**
13562 * Retrieves all `TextCanvas` rendering layers.
13563 *
13564 * @returns Array of [[TextCanvasLayer]]s.
13565 */
13566 getAllLayers(): TextCanvasLayer[];
13567 /**
13568 * Returns the computed bounding box for the input text. The current [[TextRenderStyle]] and
13569 * [[TextLayoutStyle]] will influence the results of this function.
13570 *
13571 * @param text - Input text. Provide an array of [[GlyphData]] for better performance.
13572 * @param outputBounds - Output text bounding box.
13573 * @param params - Optional measurement parameters.
13574 *
13575 * @returns Result of the measurement. If `false`, some error occurred during execution and the
13576 * input text couldn't be properly measured.
13577 */
13578 measureText(text: string | GlyphData[], outputBounds: THREE_2.Box2, params?: MeasurementParameters): boolean;
13579 /**
13580 * Adds the input text to this `TextCanvas` in the specified screen position. The current
13581 * [[TextRenderStyle]] and [[TextLayoutStyle]] will influence the results of this function.
13582 *
13583 * @param text - Input text. Provide an array of [[GlyphData]] for better performance.
13584 * @param position - Screen position.
13585 * @param params - Optional addition parameters.
13586 *
13587 * @returns Result of the addition. If `false`, some error occurred during execution and the
13588 * input text couldn't be properly added.
13589 */
13590 addText(text: string | GlyphData[], position: THREE_2.Vector3, params?: AdditionParameters): boolean;
13591 /**
13592 * Creates a new [[TextBufferObject]]. The computed text vertex buffer is equivalent to the
13593 * result of performing the `addText` function for the input text in the screen origin.
13594 *
13595 * @param text - Input text. Provide an array of [[GlyphData]] for better performance.
13596 * @param params - Optional creation parameters.
13597 *
13598 * @returns New [[TextBufferObject]] (or `undefined` if requested text glyphs couldn't be
13599 * retrieved from the current [[FontCatalog]]).
13600 */
13601 createTextBufferObject(text: string | GlyphData[], params?: TextBufferCreationParameters): TextBufferObject | undefined;
13602 /**
13603 * Adds a previously created [[TextBufferObject]] to the `TextCanvas`. Additional parameters can
13604 * be provided to override the attributes stored in the buffer.
13605 *
13606 * @param textBufferObject - [[TextBufferObject]] to add.
13607 * @param params - Optional addition parameters.
13608 *
13609 * @returns Result of the addition. If `false`, some error occurred during execution and the
13610 * input text couldn't be properly added.
13611 */
13612 addTextBufferObject(textBufferObject: TextBufferObject, params?: TextBufferAdditionParameters): boolean;
13613 /**
13614 * Executes the `pickCallback` for all previously stored picking data for text covering the
13615 * specified screen position.
13616 *
13617 * @param screenPosition - Screen coordinate of picking position.
13618 * @param pickCallback - Callback to be called for every picked element.
13619 */
13620 pickText(position: THREE_2.Vector2, callback: (pickData: any | undefined) => void): void;
13621 /**
13622 * Update the info with the memory footprint caused by objects owned by the `TextCanvas`.
13623 *
13624 * @param info - The info object to increment with the values from this `TextCanvas`.
13625 */
13626 getMemoryUsage(info: MemoryUsage): void;
13627 private placeText;
13628}
13629
13630declare class TextCanvasFactory {
13631 private readonly m_renderer;
13632 private m_minGlyphCount;
13633 private m_maxGlyphCount;
13634 /**
13635 * Creates an instance of text canvas factory.
13636 * @param m_renderer -
13637 */
13638 constructor(m_renderer: THREE.WebGLRenderer);
13639 setGlyphCountLimits(min: number, max: number): void;
13640 /**
13641 * Creates text canvas
13642 * @param fontCatalog - Initial [[FontCatalog]].
13643 */
13644 createTextCanvas(fontCatalog: FontCatalog): TextCanvas;
13645}
13646
13647/**
13648 * [[TextCanvas]] rendering layer.
13649 */
13650declare interface TextCanvasLayer {
13651 id: number;
13652 storage: TextGeometry_2;
13653}
13654
13655/**
13656 * [[TextCanvas]] construction parameters.
13657 */
13658declare interface TextCanvasParameters {
13659 /**
13660 * WebGLRenderer internally used by this `TextCanvas`.
13661 */
13662 renderer: THREE_2.WebGLRenderer;
13663 /**
13664 * Initial [[FontCatalog]].
13665 */
13666 fontCatalog: FontCatalog;
13667 /**
13668 * Minimum amount of glyphs each [[TextCanvas]] layer can store.
13669 */
13670 minGlyphCount: number;
13671 /**
13672 * Maximum amount of glyphs each [[TextCanvas]] layer can store.
13673 */
13674 maxGlyphCount: number;
13675 /**
13676 * Material used to render text.
13677 */
13678 material?: THREE_2.Material;
13679 /**
13680 * Material used to render text background.
13681 */
13682 backgroundMaterial?: THREE_2.Material;
13683}
13684
13685declare interface TextCanvasRenderer {
13686 fontCatalog: string;
13687 textCanvas: TextCanvas;
13688 poiRenderer: PoiRenderer;
13689}
13690
13691/**
13692 * `TextElement` is used to create 2D text elements (for example, labels).
13693 */
13694export declare class TextElement {
13695 readonly text: string;
13696 readonly points: THREE_2.Vector3[] | THREE_2.Vector3;
13697 readonly renderParams: TextRenderParameters | TextRenderStyle;
13698 readonly layoutParams: TextLayoutParameters | TextLayoutStyle;
13699 priority: number;
13700 xOffset: number;
13701 yOffset: number;
13702 featureId?: number | undefined;
13703 style?: string | undefined;
13704 fadeNear?: number | undefined;
13705 fadeFar?: number | undefined;
13706 readonly tileOffset?: number | undefined;
13707 readonly offsetDirection?: number | undefined;
13708 /**
13709 * Text elements with this priority are placed on screen before any others.
13710 */
13711 static readonly HIGHEST_PRIORITY: number;
13712 /**
13713 * Determines visibility. If set to `false`, it will not be rendered.
13714 */
13715 visible: boolean;
13716 /**
13717 * Determines minimum zoom level for visibility. Can be used to reduce the number of visible
13718 * `TextElement`s based on zoom level.
13719 */
13720 minZoomLevel?: number;
13721 /**
13722 * Determines maximum zoom level for visibility. Can be used to reduce the number of visible
13723 * `TextElement`s based on zoom level.
13724 */
13725 maxZoomLevel?: number;
13726 /**
13727 * If `true`, label is allowed to overlap other labels or icons of lower priority.
13728 * @default `false`
13729 */
13730 mayOverlap?: boolean;
13731 /**
13732 * If `true`, label will reserve screen space, other markers of lower priority will not be
13733 * able to overlap.
13734 * @default `true`
13735 */
13736 reserveSpace?: boolean;
13737 /**
13738 * If `true`, the label will always be rendered on top. If overlapping with other labels, the
13739 * render order is undefined;
13740 * @default `false`
13741 */
13742 alwaysOnTop?: boolean;
13743 /**
13744 * Ignore distance limit. Used for label in labeled-icons.
13745 */
13746 ignoreDistance?: boolean;
13747 /**
13748 * Scaling factor of text. Defaults to 0.5, reducing the size ot 50% in the distance.
13749 */
13750 distanceScale: number;
13751 /**
13752 * Optional user data. Will be retrieved during picking.
13753 */
13754 userData?: any;
13755 /**
13756 * If specified, determines the render order between `TextElement`s. The number different
13757 * renderOrders should be as small as possible, because every specific `renderOrder` may result
13758 * in one or more draw calls.
13759 *
13760 * TextElements with the same integer `renderOrder` will be rendered in the same batch.
13761 *
13762 * The `renderOrder` of `TextElement`s are only relative to other `TextElement`s, and not other
13763 * map elements.
13764 *
13765 * A `TextElement` with a higher `renderOrder` will be rendered after a `TextElement` with a
13766 * lower `renderOrder`.
13767 */
13768 renderOrder?: number;
13769 /**
13770 * Specified kind of geometry. One kind is set as default in the technique, and can be
13771 * overridden in the style.
13772 */
13773 kind?: GeometryKind | GeometryKindSet;
13774 /**
13775 * @hidden
13776 * Used during rendering.
13777 */
13778 loadingState?: LoadingState;
13779 /**
13780 * If set to `true` the geometry has been already overlaid on elevation.
13781 */
13782 elevated: boolean;
13783 /**
13784 * @hidden
13785 * Array storing the style {@link @here/harp-text-canvas#GlyphData} for
13786 * this `TextElement` to speed up label placement in
13787 * {@link TextElementsRenderer}. Valid after `loadingState` is `Initialized`.
13788 */
13789 glyphs?: GlyphData[];
13790 /**
13791 * @hidden
13792 * Array storing the casing (`true`: uppercase, `false`: lowercase)
13793 * for this `TextElement`.
13794 * Used by labels in {@link TextElementsRenderer} to support
13795 * `SmallCaps`. Valid after `loadingState`
13796 * is `Initialized`.
13797 */
13798 glyphCaseArray?: boolean[];
13799 /**
13800 * Screen space bounds for this `TextElement`.
13801 *
13802 * @remarks
13803 * Used by point labels in {@link TextElementsRenderer}.
13804 * Valid after `loadingState` is `Initialized`.
13805 */
13806 bounds?: THREE_2.Box2;
13807 /**
13808 * @hidden
13809 * Pre-computed text vertex buffer. Used by point labels in {@link TextElementsRenderer}. Valid
13810 * after label becomes visible for the first time.
13811 */
13812 textBufferObject?: TextBufferObject;
13813 /**
13814 * @hidden
13815 * If `true`, the estimated bounding box of the path is too small for the label to fit, so it is
13816 * being ignored for rendering in the latest frame.
13817 */
13818 dbgPathTooSmall?: boolean;
13819 pathLengthSqr?: number;
13820 /**
13821 * Time to fade in text in milliseconds.
13822 * @default [[DEFAULT_FADE_TIME]] 800
13823 */
13824 textFadeTime?: number;
13825 type: TextElementType;
13826 private m_poiInfo?;
13827 private m_renderStyle?;
13828 private m_layoutStyle?;
13829 /**
13830 * Creates a new `TextElement`.
13831 *
13832 * @param text - The text to display.
13833 * @param points - The position or a list of points for a curved text, both in world space.
13834 * @param renderParams - `TextElement` text rendering parameters.
13835 * @param layoutParams - `TextElement` text layout parameters.
13836 * @param priority - The priority of the `TextElement. Elements with the highest priority get
13837 * placed first, elements with priority of `0` are placed last, elements with a
13838 * negative value are always rendered, ignoring priorities and allowing overrides.
13839 * @param xOffset - Optional X offset of this `TextElement` in screen coordinates.
13840 * @param yOffset - Optional Y offset of this `TextElement` in screen coordinates.
13841 * @param featureId - Optional number to identify feature (originated from `OmvDataSource`).
13842 * @param fadeNear - Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the
13843 * label starts fading out (opacity decreases).
13844 * @param fadeFar - Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the
13845 * label becomes transparent. A value of <= 0.0 disables fading.
13846 * @param offsetDirection - Direction represented as an angle in degrees clockwise from north to
13847 * offset the icon in world space.
13848 */
13849 constructor(text: string, points: THREE_2.Vector3[] | THREE_2.Vector3, renderParams: TextRenderParameters | TextRenderStyle, layoutParams: TextLayoutParameters | TextLayoutStyle, priority?: number, xOffset?: number, yOffset?: number, featureId?: number | undefined, style?: string | undefined, fadeNear?: number | undefined, fadeFar?: number | undefined, tileOffset?: number | undefined, offsetDirection?: number | undefined);
13850 /**
13851 * The text element position or the first point of the path used to render a curved text, both
13852 * in world space.
13853 */
13854 get position(): THREE_2.Vector3;
13855 /**
13856 * The list of points in world space used to render the text along a path or `undefined`.
13857 */
13858 get path(): THREE_2.Vector3[] | undefined;
13859 /**
13860 * If `true`, `TextElement` is allowed to overlap other labels or icons of lower priority.
13861 *
13862 * @default `false`
13863 */
13864 get textMayOverlap(): boolean;
13865 set textMayOverlap(mayOverlap: boolean);
13866 /**
13867 * If `true`, `TextElement` will reserve screen space, other markers of lower priority will not
13868 * be able to overlap.
13869 *
13870 * @default `true`
13871 */
13872 get textReservesSpace(): boolean;
13873 set textReservesSpace(reserveSpace: boolean);
13874 /**
13875 * Contains additional information about icon to be rendered along with text.
13876 */
13877 get poiInfo(): PoiInfo | undefined;
13878 set poiInfo(poiInfo: PoiInfo | undefined);
13879 /**
13880 * @returns The style used to render this text element, undefined if not set yet.
13881 */
13882 get renderStyle(): TextRenderStyle | undefined;
13883 /**
13884 * Sets style used for text rendering.
13885 * @param style - The style to use.
13886 */
13887 set renderStyle(style: TextRenderStyle | undefined);
13888 /**
13889 * @returns The style used to layout this text element, undefined if not set yet.
13890 */
13891 get layoutStyle(): TextLayoutStyle | undefined;
13892 /**
13893 * Sets the style used for text layout.
13894 * @param style - The style to use.
13895 */
13896 set layoutStyle(style: TextLayoutStyle | undefined);
13897 hasFeatureId(): boolean;
13898 /**
13899 * Update the minZoomLevel and maxZoomLevel from the values set in {@link PoiInfo}.
13900 * Selects the smaller/larger one of the two min/max values for icon and text, because the
13901 * TextElement is a container for both.
13902 */
13903 updateMinMaxZoomLevelsFromPoiInfo(): void;
13904}
13905
13906/**
13907 * Group of {@link TextElement} sharing same priority.
13908 */
13909declare class TextElementGroup extends PriorityListGroup<TextElement> {
13910}
13911
13912/**
13913 * List of {@link TextElement} groups sorted by priority.
13914 */
13915declare class TextElementGroupPriorityList extends GroupedPriorityList<TextElement> {
13916}
13917
13918export declare interface TextElementIndex {
13919 groupIndex: number;
13920 elementIndex: number;
13921}
13922
13923/**
13924 *
13925 * Internal class to manage all text rendering.
13926 */
13927export declare class TextElementsRenderer {
13928 private m_viewState;
13929 private m_viewCamera;
13930 private m_viewUpdateCallback;
13931 private m_screenCollisions;
13932 private m_screenProjector;
13933 private m_textCanvasFactory;
13934 private m_poiManager;
13935 private m_poiRendererFactory;
13936 private m_fontCatalogLoader;
13937 private m_theme;
13938 private m_initialized;
13939 private m_initPromise;
13940 private m_glyphLoadingCount;
13941 private m_loadPromise;
13942 private readonly m_options;
13943 private readonly m_textStyleCache;
13944 private m_textRenderers;
13945 private m_overlayTextElements?;
13946 private m_debugGlyphTextureCacheMesh?;
13947 private m_debugGlyphTextureCacheWireMesh?;
13948 private m_tmpVector;
13949 private m_tmpVector3;
13950 private m_cameraLookAt;
13951 private m_overloaded;
13952 private m_cacheInvalidated;
13953 private m_forceNewLabelsPass;
13954 private m_addNewLabels;
13955 private readonly m_textElementStateCache;
13956 /**
13957 * Create the `TextElementsRenderer` which selects which labels should be placed on screen as
13958 * a preprocessing step, which is not done every frame, and also renders the placed
13959 * {@link TextElement}s every frame.
13960 *
13961 * @param m_viewState - State of the view for which this renderer will draw text.
13962 * @param m_viewCamera - Camera used by the view for which this renderer will draw text.
13963 * @param m_viewUpdateCallback - To be called whenever the view needs to be updated.
13964 * @param m_screenCollisions - General 2D screen occlusion management, may be shared between
13965 * instances.
13966 * @param m_screenProjector - Projects 3D coordinates into screen space.
13967 * @param m_textCanvasFactory - To create TextCanvas instances.
13968 * @param m_poiRendererFactory - To create PoiRenderer instances.
13969 * @param m_poiManager - To prepare pois for rendering.
13970 * @param m_fontCatalogLoader - To load font catalogs.
13971 * @param m_theme - Theme defining text styles.
13972 * @param options - Configuration options for the text renderer. See
13973 * [[TextElementsRendererOptions]].
13974 */
13975 constructor(m_viewState: ViewState, m_viewCamera: THREE_2.Camera, m_viewUpdateCallback: ViewUpdateCallback, m_screenCollisions: ScreenCollisions, m_screenProjector: ScreenProjector, m_textCanvasFactory: TextCanvasFactory, m_poiManager: PoiManager, m_poiRendererFactory: PoiRendererFactory, m_fontCatalogLoader: FontCatalogLoader, m_theme: Theme, options: TextElementsRendererOptions);
13976 /**
13977 * Disable all fading animations (for debugging and performance measurement). Defaults to
13978 * `false`.
13979 */
13980 set disableFading(disable: boolean);
13981 get disableFading(): boolean;
13982 get styleCache(): TextStyleCache;
13983 get delayLabelsUntilMovementFinished(): boolean;
13984 set delayLabelsUntilMovementFinished(delay: boolean);
13985 /**
13986 * Render the text using the specified camera into the current canvas.
13987 *
13988 * @param camera - Orthographic camera to use.
13989 */
13990 renderText(camera: THREE_2.OrthographicCamera): void;
13991 /**
13992 * Forces update of text elements in the next call to [[placeText]].
13993 */
13994 invalidateCache(): void;
13995 /**
13996 * Notify `TextElementsRenderer` that the camera has started a movement.
13997 */
13998 movementStarted(): void;
13999 /**
14000 * Notify `TextElementsRenderer` that the camera has finished its movement.
14001 */
14002 movementFinished(): void;
14003 /**
14004 * Is `true` if number of {@link TextElement}s in visible tiles is larger than the recommended
14005 * number `OVERLOAD_LABEL_LIMIT`.
14006 */
14007 get overloaded(): boolean;
14008 /**
14009 * Places text elements for the current frame.
14010 * @param dataSourceTileList - List of tiles to be rendered for each data source.
14011 * @param time - Current frame time.
14012 */
14013 placeText(dataSourceTileList: DataSourceTileList[], time: number): void;
14014 /**
14015 * Adds new overlay text elements to this `MapView`.
14016 *
14017 * @param textElements - Array of {@link TextElement} to be added.
14018 */
14019 addOverlayText(textElements: TextElement[]): void;
14020 /**
14021 * Adds new overlay text elements to this `MapView`.
14022 *
14023 * @param textElements - Array of {@link TextElement} to be added.
14024 */
14025 clearOverlayText(): void;
14026 /**
14027 * @returns Whether there's overlay text to be rendered.
14028 */
14029 hasOverlayText(): boolean;
14030 get overlayText(): TextElement[] | undefined;
14031 /**
14032 * Fill the picking results for the pixel with the given screen coordinate. If multiple
14033 * {@link TextElement}s are found, the order of the results is unspecified.
14034 *
14035 * Note: {@link TextElement}s with identical `featureId` or
14036 * identical `userData` will only appear
14037 * once in the list `pickResults`.
14038 *
14039 * @param screenPosition - Screen coordinate of picking position.
14040 * @param pickResults - Array filled with pick results.
14041 */
14042 pickTextElements(screenPosition: THREE_2.Vector2, pickResults: PickResult[]): void;
14043 /**
14044 * `true` if any resource used by any `FontCatalog` is still loading.
14045 */
14046 get loading(): boolean;
14047 /**
14048 * Waits till all pending resources from any `FontCatalog` are loaded.
14049 */
14050 waitLoaded(): Promise<boolean>;
14051 /**
14052 * Reset the current text render states of all visible tiles.
14053 *
14054 * @remarks
14055 * All {@link TextElement}s will fade in
14056 * after that as if they have just been added.
14057 */
14058 clearRenderStates(): void;
14059 /**
14060 * Return memory used by all objects managed by `TextElementsRenderer`.
14061 *
14062 * @returns `MemoryUsage` Heap and GPU memory used by this `TextElementsRenderer`.
14063 */
14064 getMemoryUsage(): MapViewUtils.MemoryUsage;
14065 get initialized(): boolean;
14066 get initializing(): boolean;
14067 /**
14068 * Waits until initialization is done.
14069 * @returns Promise resolved to true if initialization was done, false otherwise.
14070 */
14071 waitInitialized(): Promise<boolean>;
14072 /**
14073 * Initializes the text renderer once there's any text element available for rendering.
14074 * @param textElementsAvailable - Indicates whether there's any text element to be rendered.
14075 * @returns Whether the text renderer is initialized.
14076 */
14077 private initialize;
14078 /**
14079 * Reset internal state at the beginning of a frame.
14080 */
14081 private reset;
14082 /**
14083 * Update state at the end of a frame.
14084 */
14085 private updateTextRenderers;
14086 /**
14087 * Fills the screen with lines projected from world space, see [[Tile.blockingElements]].
14088 * @note These boxes have highest priority, so will block all other labels.
14089 * @param dataSourceTileList - List of tiles to be rendered for each data source.
14090 */
14091 private prepopulateScreenWithBlockingElements;
14092 /**
14093 * @returns True if whole group was processed for placement,
14094 * false otherwise (e.g. placement limit reached).
14095 */
14096 private placeTextElementGroup;
14097 private initializeGlyphs;
14098 private initializeDefaultAssets;
14099 private initializeTextCanvases;
14100 private updateGlyphDebugMesh;
14101 private initializeGlyphDebugMesh;
14102 /**
14103 * Visit all visible tiles and add/ their text elements to cache.
14104 *
14105 * @remarks
14106 * The update of {@link TextElement}s is a time consuming process,
14107 * and cannot be done every frame, but should only
14108 * be done when the camera moved (a lot) of whenever the set of visible tiles change.
14109 *
14110 * The actually rendered {@link TextElement}s are stored internally
14111 * until the next update is done
14112 * to speed up rendering when no camera movement was detected.
14113 * @param dataSourceTileList - List of tiles to be rendered for each data source.
14114 */
14115 private updateTextElements;
14116 private updateTextElementsFromSource;
14117 private prepareTextElementGroup;
14118 private createSortedGroupsForSorting;
14119 private selectTextElementsToUpdateByDistance;
14120 private placeTextElements;
14121 private placeNewTextElements;
14122 private placeOverlayTextElements;
14123 private getDistanceScalingFactor;
14124 private getDistanceFadingFactor;
14125 private addPointLabel;
14126 private addPoiLabel;
14127 private addLineMarkerLabel;
14128 private addPathLabel;
14129 private checkIfOverloaded;
14130}
14131
14132declare interface TextElementsRendererOptions {
14133 /**
14134 * The path to the font catalog file. Default is [[DEFAULT_FONT_CATALOG]].
14135 */
14136 fontCatalog?: string;
14137 /**
14138 * Optional initial number of glyphs (characters) for labels. In situations with limited,
14139 * available memory, decreasing this number may be beneficial.
14140 *
14141 * @default [[MIN_GLYPH_COUNT]]
14142 */
14143 minNumGlyphs?: number;
14144 /**
14145 * Optional limit of number of glyphs (characters) for labels. In situations with limited,
14146 * available memory, decreasing this number may be beneficial.
14147 *
14148 * @default [[MAX_GLYPH_COUNT]]
14149 */
14150 maxNumGlyphs?: number;
14151 /**
14152 * Limits the number of {@link DataSource} labels visible, such as road names and POIs.
14153 * On small devices, you can reduce this number to to increase performance.
14154 * @default [[DEFAULT_MAX_NUM_RENDERED_TEXT_ELEMENTS]].
14155 */
14156 maxNumVisibleLabels?: number;
14157 /**
14158 * The number of {@link TextElement}s that the {@link TextElementsRenderer} tries to render even
14159 * if they were not visible during placement. This property only applies to {@link TextElement}s
14160 * that were culled by the frustum; useful for map movements and animations.
14161 * @default [[DEFAULT_MAX_NUM_SECOND_CHANCE_ELEMENTS]].
14162 */
14163 numSecondChanceLabels?: number;
14164 /**
14165 * The maximum distance for {@link TextElement} to be rendered, expressed as a fraction of
14166 * the distance between the near and far plane [0, 1.0].
14167 * @default [[DEFAULT_MAX_DISTANCE_RATIO_FOR_LABELS]].
14168 */
14169 maxDistanceRatioForTextLabels?: number;
14170 /**
14171 * The maximum distance for {@link TextElement} with icons to be rendered,
14172 * expressed as a fraction of the distance
14173 * between the near and far plane [0, 1.0].
14174 * @default [[DEFAULT_MAX_DISTANCE_RATIO_FOR_LABELS]].
14175 */
14176 maxDistanceRatioForPoiLabels?: number;
14177 /**
14178 * The minimum scaling factor that may be applied to {@link TextElement}s due to their distance.
14179 * If not defined the default value specified in {@link TextElementsRenderer} will be used.
14180 * @default [[DEFAULT_LABEL_DISTANCE_SCALE_MIN]].
14181 */
14182 labelDistanceScaleMin?: number;
14183 /**
14184 * The maximum scaling factor that may be applied to {@link TextElement}s due to their distance.
14185 * If not defined the default value specified in {@link TextElementsRenderer} will be used.
14186 * @default [[DEFAULT_LABEL_DISTANCE_SCALE_MAX]].
14187 */
14188 labelDistanceScaleMax?: number;
14189 /**
14190 * Disable all fading animations for debugging and performance measurement.
14191 * @default `false`
14192 */
14193 disableFading?: boolean;
14194 /**
14195 * Enable that new labels are delayed until movement is finished
14196 * @default `true`
14197 */
14198 delayLabelsUntilMovementFinished?: boolean;
14199}
14200
14201/**
14202 * {@link TextElementsRenderer} representation of a
14203 * {@link @here/harp-datasource-protocol#Theme}'s TextStyle.
14204 */
14205export declare interface TextElementStyle {
14206 name: string;
14207 fontCatalog: string;
14208 renderParams: TextRenderParameters;
14209 layoutParams: TextLayoutParameters;
14210 textCanvas?: TextCanvas;
14211 poiRenderer?: PoiRenderer;
14212}
14213
14214/**
14215 * Types of text elements.
14216 */
14217declare enum TextElementType {
14218 PoiLabel = 0,
14219 PathLabel = 1,
14220 LineMarker = 2
14221}
14222
14223/**
14224 * Structured clone compliant version of a `three.js` geometry object with text to be rendered.
14225 * It is composed of buffers with metadata for text objects.
14226 */
14227export declare interface TextGeometry {
14228 positions: BufferAttribute;
14229 texts: number[];
14230 technique?: number;
14231 stringCatalog?: Array<string | undefined>;
14232 objInfos?: AttributeMap[];
14233}
14234
14235/**
14236 * Procedural geometry that holds vertex attribute data for all glyphs in a [[TextCanvas]].
14237 */
14238declare class TextGeometry_2 {
14239 readonly scene: THREE_2.Scene;
14240 /**
14241 * Count of currently drawn glyphs.
14242 */
14243 get drawCount(): number;
14244 /**
14245 * Mesh used to render foreground glyphs.
14246 */
14247 get mesh(): THREE_2.Mesh;
14248 /**
14249 * Mesh used to render background glyphs.
14250 */
14251 get backgroundMesh(): THREE_2.Mesh;
14252 /**
14253 * Maximum glyph capacity.
14254 */
14255 readonly capacity: number;
14256 private m_currentCapacity;
14257 private m_drawCount;
14258 private m_updateOffset;
14259 private m_vertexBuffer;
14260 private m_positionAttribute;
14261 private m_uvAttribute;
14262 private m_colorAttribute;
14263 private m_bgColorAttribute;
14264 private m_indexBuffer;
14265 private m_geometry;
14266 private m_mesh;
14267 private m_bgMesh;
14268 private m_pickingCount;
14269 private m_pickingDataArray;
14270 /**
14271 * Creates a new `TextGeometry`.
14272 *
14273 * @param material - Material used to render foreground glyphs.
14274 * @param backgroundMaterial - Material used to render background glyphs.
14275 * @param initialSize - Initial amount of glyphs that can be stored.
14276 * @param capacity - Maximum glyph capacity.
14277 *
14278 * @returns New `TextGeometry`.
14279 */
14280 constructor(scene: THREE_2.Scene, material: THREE_2.Material, backgroundMaterial: THREE_2.Material, initialSize: number, capacity: number);
14281 /**
14282 * Release all allocated resources.
14283 */
14284 dispose(): void;
14285 /**
14286 * Clear the geometry.
14287 */
14288 clear(): void;
14289 /**
14290 * Update the GPU resources to reflect the latest additions to the geometry.
14291 */
14292 update(): void;
14293 /**
14294 * Add a new glyph to the `TextGeometry`.
14295 *
14296 * @param glyphData - [[GlyphData]] holding the glyph description.
14297 * @param corners - Transformed glyph corners.
14298 * @param weight - Foreground glyph sampling weight.
14299 * @param bgWeight - Foreground glyph sampling weight.
14300 * @param mirrored - If `true`, UVs will be horizontally mirrored (needed for RTL punctuation).
14301 * @param style - Currently set [[TextRenderStyle]].
14302 *
14303 * @returns Result of the addition.
14304 */
14305 add(glyphData: GlyphData, corners: THREE_2.Vector3[], weight: number, bgWeight: number, mirrored: boolean, style: TextRenderStyle): boolean;
14306 /**
14307 * Add a new glyph to a text buffer.
14308 *
14309 * @param buffer - Target buffer where glyph attributes will be stored.
14310 * @param offset - Offset of the target buffer.
14311 * @param glyphData - [[GlyphData]] holding the glyph description.
14312 * @param corners - Transformed glyph corners.
14313 * @param weight - Foreground glyph sampling weight.
14314 * @param bgWeight - Foreground glyph sampling weight.
14315 * @param mirrored - If `true`, UVs will be mirrored (needed for RTL punctuation).
14316 * @param style - Currently set [[TextRenderStyle]].
14317 */
14318 addToBuffer(buffer: Float32Array, offset: number, glyphData: GlyphData, corners: THREE_2.Vector3[], weight: number, bgWeight: number, mirrored: boolean, style: TextRenderStyle): void;
14319 /**
14320 * Add a previously computed [[TextBufferObject]] to the `TextGeometry`. Extra parameters can
14321 * be passed to override the passed attribute data.
14322 *
14323 * @param textBufferObject - [[TextBufferObject]] containing computed glyphs.
14324 * @param position - Override position value.
14325 * @param scale - Override scale value.
14326 * @param rotation - Override rotation value.
14327 * @param color - Override color value.
14328 * @param opacity - Override opacity value.
14329 * @param bgColor - Override background color value.
14330 * @param bgOpacity - Override background opacity value.
14331 *
14332 * @returns Result of the addition.
14333 */
14334 addTextBufferObject(textBufferObject: TextBufferObject, position?: THREE_2.Vector3, scale?: number, rotation?: number, color?: THREE_2.Color, opacity?: number, bgColor?: THREE_2.Color, bgOpacity?: number): boolean;
14335 /**
14336 * Adds picking data for glyphs from the specified start until the last glyph added.
14337 *
14338 * @param startIdx - First glyph index that this picking data is associated to.
14339 * @param endIdx - Last glyph index that this picking data is associated to.
14340 * @param pickingData - Picking data to be added.
14341 */
14342 addPickingData(startIdx: number, endIdx: number, pickingData: any): boolean;
14343 /**
14344 * Fill the picking results for the pixel with the given screen coordinate. If multiple glyphs
14345 * are found, the order of the results is unspecified.
14346 *
14347 * @param screenPosition - Screen coordinate of picking position.
14348 * @param pickCallback - Callback to be called for every picked element.
14349 */
14350 pick(screenPosition: THREE_2.Vector2, pickCallback: (pickData: any | undefined) => void): void;
14351 /**
14352 * Update the info with the memory footprint caused by objects owned by the `TextGeometry`.
14353 *
14354 * @param info - The info object to increment with the values from this `TextGeometry`.
14355 */
14356 updateMemoryUsage(info: MemoryUsage): void;
14357 private resizeBuffers;
14358}
14359
14360/**
14361 * [[TextCanvas]] text layout parameters.
14362 */
14363declare interface TextLayoutParameters {
14364 tracking?: number;
14365 leading?: number;
14366 maxLines?: number;
14367 lineWidth?: number;
14368 canvasRotation?: number;
14369 lineRotation?: number;
14370 wrappingMode?: WrappingMode_2;
14371 verticalAlignment?: VerticalAlignment;
14372 horizontalAlignment?: HorizontalAlignment;
14373 placements?: TextPlacements;
14374}
14375
14376/**
14377 * [[TextCanvas]] text rendering style.
14378 */
14379declare class TextLayoutStyle {
14380 private m_params;
14381 /**
14382 * Creates a new `TextLayoutStyle`.
14383 *
14384 * @param params - Input [[TextLayoutParameters]].
14385 *
14386 * @returns New `TextLayoutStyle`.
14387 */
14388 constructor(params?: TextLayoutParameters);
14389 /**
14390 * Current [[TextLayoutParameters]] for this style.
14391 */
14392 get params(): TextLayoutParameters;
14393 set params(value: TextLayoutParameters);
14394 /**
14395 * Inter-glyph spacing (pixels). Scaled by [[FontSize]].
14396 */
14397 get tracking(): number;
14398 set tracking(value: number);
14399 /**
14400 * Inter-line spacing (pixels). Scaled by [[FontSize]].
14401 */
14402 get leading(): number;
14403 set leading(value: number);
14404 /**
14405 * Maximum number of lines to be considered when using [[TextCanvas]].
14406 */
14407 get maxLines(): number;
14408 set maxLines(value: number);
14409 /**
14410 * Maximum line width (pixels).
14411 */
14412 get lineWidth(): number;
14413 set lineWidth(value: number);
14414 /**
14415 * [[TextCanvas]] rotation (radians).
14416 */
14417 get canvasRotation(): number;
14418 set canvasRotation(value: number);
14419 /**
14420 * Line typesetting rotation (radians).
14421 */
14422 get lineRotation(): number;
14423 set lineRotation(value: number);
14424 /**
14425 * Wrapping (line-breaking) mode.
14426 */
14427 get wrappingMode(): WrappingMode_2;
14428 set wrappingMode(value: WrappingMode_2);
14429 /**
14430 * Text position regarding the baseline.
14431 */
14432 get verticalAlignment(): VerticalAlignment;
14433 set verticalAlignment(value: VerticalAlignment);
14434 /**
14435 * Text position inside a line.
14436 */
14437 get horizontalAlignment(): HorizontalAlignment;
14438 set horizontalAlignment(value: HorizontalAlignment);
14439 /**
14440 * Text placement options relative to label anchor (origin).
14441 *
14442 * @note [[TextPlacement]]s options may override alignment settings.
14443 */
14444 get placements(): TextPlacements;
14445 set placements(value: TextPlacements);
14446 /**
14447 * Clone this [[TextLayoutStyle]].
14448 *
14449 * @param params - Input [[TextLayoutParameters]].
14450 *
14451 * @returns Cloned [[TextLayoutStyle]].
14452 */
14453 clone(params?: TextLayoutParameters): TextLayoutStyle;
14454 /**
14455 * Copy other [[TextLayoutStyle]] properties into this object instance.
14456 *
14457 * @param other - The object to be copied.
14458 *
14459 * @returns reference to `this` object.
14460 */
14461 copy(other: TextLayoutStyle): TextLayoutStyle;
14462}
14463
14464/**
14465 * This object keeps textual data together with metadata to place it on the map.
14466 */
14467export declare interface TextPathGeometry {
14468 path: number[];
14469 pathLengthSqr: number;
14470 text: string;
14471 technique: number;
14472 objInfos?: AttributeMap;
14473}
14474
14475export declare interface TextPickResult extends PickResult {
14476 /**
14477 * Text of the picked {@link TextElement}
14478 */
14479 text?: string;
14480}
14481
14482declare interface TextPlacement {
14483 v: VerticalPlacement;
14484 h: HorizontalPlacement;
14485}
14486
14487declare type TextPlacements = TextPlacement[];
14488
14489/**
14490 * [[TextCanvas]] text rendering parameters.
14491 */
14492declare interface TextRenderParameters {
14493 fontName?: string;
14494 fontSize?: FontSize;
14495 fontStyle?: FontStyle;
14496 fontVariant?: FontVariant;
14497 rotation?: number;
14498 color?: THREE_2.Color;
14499 backgroundColor?: THREE_2.Color;
14500 opacity?: number;
14501 backgroundOpacity?: number;
14502}
14503
14504/**
14505 * [[TextCanvas]] text rendering style.
14506 */
14507declare class TextRenderStyle {
14508 private m_params;
14509 /**
14510 * Creates a new `TextRenderStyle`.
14511 *
14512 * @param params - Input [[TextRenderParameters]].
14513 *
14514 * @returns New `TextRenderStyle`.
14515 */
14516 constructor(params?: TextRenderParameters);
14517 /**
14518 * Current [[TextRenderParameters]] for this style.
14519 */
14520 get params(): TextRenderParameters;
14521 set params(value: TextRenderParameters);
14522 /**
14523 * Name of the preferred [[Font]] to be used when rendering.
14524 */
14525 get fontName(): string;
14526 set fontName(value: string);
14527 /**
14528 * Collection of unit and sizes to apply for the currently active [[Font]].
14529 */
14530 get fontSize(): FontSize;
14531 set fontSize(value: FontSize);
14532 /**
14533 * Glyph style to apply for the currently active [[Font]].
14534 */
14535 get fontStyle(): FontStyle;
14536 set fontStyle(value: FontStyle);
14537 /**
14538 * Glyph variant to apply for the currently active [[Font]].
14539 */
14540 get fontVariant(): FontVariant;
14541 set fontVariant(value: FontVariant);
14542 /**
14543 * Glyph local rotation (radians).
14544 */
14545 get rotation(): number;
14546 set rotation(value: number);
14547 /**
14548 * Glyph color.
14549 */
14550 get color(): THREE_2.Color;
14551 set color(value: THREE_2.Color);
14552 /**
14553 * Glyph background color.
14554 */
14555 get backgroundColor(): THREE_2.Color;
14556 set backgroundColor(value: THREE_2.Color);
14557 /**
14558 * Glyph opacity.
14559 */
14560 get opacity(): number;
14561 set opacity(value: number);
14562 /**
14563 * Glyph background opacity.
14564 */
14565 get backgroundOpacity(): number;
14566 set backgroundOpacity(value: number);
14567 /**
14568 * Clone this [[TextRenderStyle]].
14569 *
14570 * @param params - Input [[TextRenderParameters]].
14571 *
14572 * @returns Cloned [[TextRenderStyle]].
14573 */
14574 clone(params?: TextRenderParameters): TextRenderStyle;
14575 /**
14576 * Copy other [[TextRenderStyle]] properties into this object instance.
14577 *
14578 * @param source - The source object to be copied.
14579 *
14580 * @returns reference to `this` object.
14581 */
14582 copy(source: TextRenderStyle): TextRenderStyle;
14583}
14584
14585export declare class TextStyleCache {
14586 private m_theme;
14587 private m_textStyles;
14588 private m_defaultStyle;
14589 constructor(m_theme: Theme);
14590 initializeDefaultTextElementStyle(defaultFontCatalogName: string): void;
14591 initializeTextElementStyles(defaultPoiRenderer: PoiRenderer, defaultTextCanvas: TextCanvas, textRenderers: TextCanvasRenderer[]): void;
14592 /**
14593 * Retrieves a {@link TextElementStyle} for {@link @here/harp-datasource-protocol#Theme}'s
14594 * [[TextStyle]] id.
14595 */
14596 getTextElementStyle(styleId?: string): TextElementStyle;
14597 /**
14598 * Gets the appropriate {@link @here/harp-text-canvas#TextRenderStyle}
14599 * to use for a label. Depends heavily on the label's
14600 * [[Technique]] and the current zoomLevel.
14601 */
14602 createRenderStyle(tile: Tile, technique: TextTechnique | PoiTechnique | LineMarkerTechnique): TextRenderStyle;
14603 /**
14604 * Create the appropriate {@link @here/harp-text-canvas#TextLayoutStyle}
14605 * to use for a label. Depends heavily on the label's
14606 * [[Technique]] and the current zoomLevel.
14607 *
14608 * @param tile - The {@link Tile} to process.
14609 * @param technique - Label's technique.
14610 */
14611 createLayoutStyle(tile: Tile, technique: TextTechnique | PoiTechnique | LineMarkerTechnique): TextLayoutStyle;
14612 private createTextElementStyle;
14613}
14614
14615/**
14616 * Various text styles used with labels and texts.
14617 */
14618export declare interface TextStyleDefinition {
14619 name?: string;
14620 fontCatalogName?: string;
14621 fontName?: string;
14622 size?: number;
14623 backgroundSize?: number;
14624 fontStyle?: "Regular" | "Bold" | "Italic" | "BoldItalic";
14625 fontVariant?: "Regular" | "AllCaps" | "SmallCaps";
14626 rotation?: number;
14627 /**
14628 * @format color-hex
14629 */
14630 color?: string;
14631 /**
14632 * @format color-hex
14633 */
14634 backgroundColor?: string;
14635 opacity?: number;
14636 backgroundOpacity?: number;
14637 tracking?: number;
14638 leading?: number;
14639 maxLines?: number;
14640 lineWidth?: number;
14641 canvasRotation?: number;
14642 lineRotation?: number;
14643 wrappingMode?: "None" | "Character" | "Word";
14644 hAlignment?: "Left" | "Center" | "Right";
14645 vAlignment?: "Above" | "Center" | "Below";
14646 /**
14647 * @format comma separated list of placement tokens, i.e. "TR, TL, C"
14648 * @see [[PlacementToken]]
14649 */
14650 placements?: string;
14651}
14652
14653/**
14654 * Runtime representation of [[TextStyle]] as parsed by [[StyleSetEvaluator]].
14655 * For technique parameters see [[TextTechniqueParams]].
14656 */
14657export declare interface TextTechnique extends MakeTechniqueAttrs<TextTechniqueParams> {
14658 name: "text";
14659}
14660
14661/**
14662 * Render geometry as a text.
14663 */
14664export declare interface TextTechniqueParams extends BaseTechniqueParams {
14665 /**
14666 * Text to be displayed for feature.
14667 *
14668 * Defaults to first defined:
14669 * - feature property `label` if present in technique (depreacted);
14670 * - `["get", "name:short"]` is `useAbbreviation` is true;
14671 * - `["get", "iso_code"]` is `useIsoCode` is true;
14672 * - `["get", "name:$LANGUAGE"]` for each specified language;
14673 * - `["get", "name"]`.
14674 *
14675 * See [[ExtendedTileInfo.getFeatureText]].
14676 */
14677 text?: DynamicProperty<string>;
14678 /**
14679 * Field name of object containing the text to be rendered.
14680 *
14681 * @deprecated Use `["get", "FIELD"]`.
14682 */
14683 label?: string;
14684 /**
14685 * If `true`, the abbreviation (field `name:short`) of the elements is used as text.
14686 *
14687 * @deprecated Use proper expression with [`get`, `name:short`] for this purpose.
14688 */
14689 useAbbreviation?: boolean;
14690 /**
14691 * If `true`, the iso code (field 'iso_code') of the elements is used as text.
14692 * The `iso_code` field contains the ISO 3166-1 2-letter country code.
14693 *
14694 * @deprecated Use proper expression with [`get`, `iso_code`] for this purpose.
14695 */
14696 useIsoCode?: boolean;
14697 /**
14698 * Priority of text, defaults to `0`. Elements with highest priority get placed first.
14699 */
14700 priority?: DynamicProperty<number>;
14701 /**
14702 * Minimal zoom level. If the current zoom level is smaller, the technique will not be used.
14703 */
14704 minZoomLevel?: number;
14705 /**
14706 * Maximum zoom level. If the current zoom level is larger, the technique will not be used.
14707 */
14708 maxZoomLevel?: number;
14709 /**
14710 * Scaling factor of the text. Defaults to 0.5, reducing the size ot 50% in the distance.
14711 */
14712 distanceScale?: number;
14713 /**
14714 * If `true`, icon is allowed to overlap other labels or icons of lower priority.
14715 * @default `false`
14716 */
14717 mayOverlap?: boolean;
14718 /**
14719 * If `true`, element will reserve screen space, other markers of lower priority will not be
14720 * able to overlap.
14721 * @default `true`
14722 */
14723 reserveSpace?: boolean;
14724 /**
14725 * Fading time for labels in seconds.
14726 */
14727 textFadeTime?: number;
14728 /**
14729 * Horizontal offset (to the right) in screen pixels.
14730 */
14731 xOffset?: number;
14732 /**
14733 * Vertical offset (up) in screen pixels.
14734 */
14735 yOffset?: number;
14736 /**
14737 * Name of the text style.
14738 */
14739 style?: string;
14740 /**
14741 * Name of the preferred [[Font]] to be used when rendering.
14742 */
14743 fontName?: string;
14744 /**
14745 * Size of the text (pixels).
14746 */
14747 size?: DynamicProperty<number>;
14748 /**
14749 * Size of the text background (pixels).
14750 */
14751 backgroundSize?: DynamicProperty<number>;
14752 /**
14753 * Glyph style to apply for the currently active [[Font]].
14754 */
14755 fontStyle?: "Regular" | "Bold" | "Italic" | "BoldItalic";
14756 /**
14757 * Glyph variant to apply for the currently active [[Font]].
14758 */
14759 fontVariant?: "Regular" | "AllCaps" | "SmallCaps";
14760 /**
14761 * Glyph local rotation (radians).
14762 */
14763 rotation?: number;
14764 /**
14765 * Text color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`, `"#fff"`,
14766 * `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
14767 * @format color-hex
14768 */
14769 color?: DynamicProperty<StyleColor>;
14770 /**
14771 * Text background color in hexadecimal or CSS-style notation, for example: `"#e4e9ec"`,
14772 * `"#fff"`, `"rgb(255, 0, 0)"`, or `"hsl(35, 11%, 88%)"`.
14773 * @format color-hex
14774 */
14775 backgroundColor?: DynamicProperty<StyleColor>;
14776 /**
14777 * For transparent text, set a value between 0.0 for totally transparent, to 1.0 for totally
14778 * opaque.
14779 */
14780 opacity?: DynamicProperty<number>;
14781 /**
14782 * Background text opacity value.
14783 */
14784 backgroundOpacity?: DynamicProperty<number>;
14785 /**
14786 * Inter-glyph spacing (pixels). Scaled by `size`.
14787 */
14788 tracking?: DynamicProperty<number>;
14789 /**
14790 * Inter-line spacing (pixels). Scaled by `size`.
14791 */
14792 leading?: DynamicProperty<number>;
14793 /**
14794 * Maximum number of lines for this label.
14795 */
14796 maxLines?: DynamicProperty<number>;
14797 /**
14798 * Maximum line width (pixels).
14799 */
14800 lineWidth?: DynamicProperty<number>;
14801 /**
14802 * [[TextCanvas]] rotation (radians).
14803 */
14804 canvasRotation?: DynamicProperty<number>;
14805 /**
14806 * Line typesetting rotation (radians).
14807 */
14808 lineRotation?: DynamicProperty<number>;
14809 /**
14810 * Wrapping (line-breaking) mode.
14811 */
14812 wrappingMode?: DynamicProperty<"None" | "Character" | "Word">;
14813 /**
14814 * Text position regarding the baseline.
14815 */
14816 hAlignment?: DynamicProperty<"Left" | "Center" | "Right">;
14817 /**
14818 * Text position inside a line.
14819 */
14820 vAlignment?: DynamicProperty<"Above" | "Center" | "Below">;
14821}
14822
14823export declare type TextTechniqueStyle = BaseStyle<"text", TextTechniqueParams>;
14824
14825/**
14826 * Names of the supported texture properties.
14827 * @internal
14828 */
14829export declare const TEXTURE_PROPERTY_KEYS: string[];
14830
14831/**
14832 * Buffer holding a texture.
14833 */
14834export declare interface TextureBuffer {
14835 /**
14836 * Buffer containing the (compressed) image or the raw texture data.
14837 */
14838 buffer: ArrayBuffer;
14839 /**
14840 * Mime type of the image or 'image/raw' in case of raw texture data.
14841 */
14842 type: string;
14843 /**
14844 * Properties for creating a three.js DataTexture
14845 * (https://threejs.org/docs/#api/en/textures/DataTexture).
14846 */
14847 dataTextureProperties?: DataTextureProperties;
14848}
14849
14850export declare enum TextureCoordinateType {
14851 /**
14852 * Texture coordinates are in tile space.
14853 * SW of the tile will have (0,0) and NE will have (1,1).
14854 */
14855 TileSpace = "tile-space",
14856 /**
14857 * Texture coordinates are in equirectangular space.
14858 * (u, v) = ( (longitude+180) / 360, (latitude+90) / 180).
14859 */
14860 EquirectangularSpace = "equirectangular-space",
14861 /**
14862 * Texture coordinates in feature space.
14863 *
14864 * To compute texture coordinates in feature space,
14865 * the feature must have a property named `bbox` with value
14866 * the tuple `[west, south, east, north]`.
14867 */
14868 FeatureSpace = "feature-space"
14869}
14870
14871/**
14872 * Get the texture coordinate type if the technique supports it.
14873 */
14874export declare function textureCoordinateType(technique: Technique): TextureCoordinateType | undefined;
14875
14876export declare type TextureDataType = "UnsignedByte" | "Byte" | "Short" | "UnsignedShort" | "Int" | "UnsignedInt" | "Float" | "HalfFloat";
14877
14878/**
14879 * A texture loader that supports request headers(e.g. for Authorization)
14880 */
14881export declare class TextureLoader {
14882 private m_textureLoader;
14883 /**
14884 * Load an image from url and create a texture
14885 * @param url - URL to the image
14886 * @param requestHeaders - Optional request headers to load image(e.g. Authorization)
14887 * @param crossOrigin - Enable/disable CORS
14888 */
14889 load(url: string, requestHeaders?: RequestHeaders | undefined, crossOrigin?: boolean): Promise<THREE_2.Texture>;
14890 private loadWithThreeLoader;
14891}
14892
14893/**
14894 * Properties of a Texture (https://threejs.org/docs/#api/en/textures/Texture).
14895 */
14896export declare interface TextureProperties {
14897 /**
14898 * Texture horizontal wrapping mode.
14899 * See: https://threejs.org/docs/#api/en/textures/Texture.wrapS.
14900 */
14901 wrapS?: WrappingMode;
14902 /**
14903 * Texture vertical wrapping mode.
14904 * See: https://threejs.org/docs/#api/en/textures/Texture.wrapT.
14905 */
14906 wrapT?: WrappingMode;
14907 /**
14908 * Texture magnification filter.
14909 */
14910 magFilter?: MagFilter;
14911 /**
14912 * Texture minification filter.
14913 */
14914 minFilter?: MinFilter;
14915 /**
14916 * Flip texture vertically.
14917 * See: https://threejs.org/docs/#api/en/textures/Texture.flipY.
14918 */
14919 flipY?: boolean;
14920 /**
14921 * Texture horizontal repetition rate.
14922 * See: https://threejs.org/docs/#api/en/textures/Texture.repeat.
14923 */
14924 repeatU?: number;
14925 /**
14926 * Texture vertical repetition rate.
14927 * See: https://threejs.org/docs/#api/en/textures/Texture.repeat.
14928 */
14929 repeatV?: number;
14930}
14931
14932/**
14933 * Map theme is used to define what features are shown and how the map is styled, for example
14934 * which lightning is used or whether fog should be displayed.
14935 */
14936export declare interface Theme {
14937 /**
14938 * The URI of the JSON schema describing themes.
14939 */
14940 $schema?: string;
14941 /**
14942 * The base `Theme`s or `theme` URLs to extend.
14943 *
14944 * @remarks
14945 * If used, base themes are loaded first, and then all the properties from inherited theme
14946 * overwrite these defined in base theme.
14947 */
14948 extends?: string | Theme | Array<string | Theme>;
14949 /**
14950 * Actual URL the theme has been loaded from.
14951 */
14952 url?: string;
14953 /**
14954 * Color to be used as a clear background - no map objects.
14955 * @format color-hex
14956 */
14957 clearColor?: string;
14958 /**
14959 * Alpha to be used as a clear background - no map objects.
14960 * @format 0-1
14961 */
14962 clearAlpha?: number;
14963 /**
14964 * Define the default text style for styling labels and texts.
14965 */
14966 defaultTextStyle?: TextStyleDefinition;
14967 /**
14968 * Define the lightning available on the three.js scene.
14969 */
14970 lights?: Light[];
14971 /**
14972 * Define the style of the sky presented in the map scene.
14973 */
14974 sky?: Sky;
14975 /**
14976 * Define the fog used in the map scene.
14977 */
14978 fog?: Fog;
14979 /**
14980 * The definitions exported by these theme.
14981 */
14982 definitions?: Definitions;
14983 /**
14984 * Map styles available for datasources used to render the map.
14985 */
14986 styles?: Styles;
14987 /**
14988 * Define the style to render different types of text used on the map.
14989 */
14990 textStyles?: TextStyleDefinition[];
14991 /**
14992 * List available fonts to be used while rendering text.
14993 */
14994 fontCatalogs?: FontCatalogConfig[];
14995 /**
14996 * Optional images to be rendered on the map view.
14997 */
14998 images?: ImageDefinitions;
14999 /**
15000 * Image textures to be used while rendering geometries on the map view.
15001 */
15002 imageTextures?: ImageTexture[];
15003 /**
15004 * Optional list of [[ThemePoiTableDef]]s.
15005 */
15006 poiTables?: PoiTableRef[];
15007 /**
15008 * Optional list of symbolic priorities for the object
15009 * created using this {@link Theme}.
15010 *
15011 * @remarks
15012 * The attribute `styleSet` and `category` of the [[Technique]]
15013 * are used together with [[Theme.priorities]] to sort
15014 * the objects created using this {@link Theme}, for example:
15015 *
15016 * ```json
15017 * {
15018 * "priorities": [
15019 * { "group": "tilezen", "category": "outline-1" }
15020 * ],
15021 * "styles": [
15022 * {
15023 * "technique": "solid-line",
15024 * "styleSet": "tilezen",
15025 * "category": "outline-1"
15026 * }
15027 * ]
15028 * }
15029 * ```
15030 */
15031 priorities?: StylePriority[];
15032 /**
15033 * Optional list of priorities for the screen-space
15034 * objects created using this style.
15035 *
15036 * @remarks
15037 * The name of the `category` attribute of the screen-space
15038 * technique (e.g. `"text"`) must match on the strings
15039 * defined by this [[Theme.labelPriorities]], for example:
15040 *
15041 * ```json
15042 * {
15043 * "labelPriorities": [
15044 * "continent-labels",
15045 * "country-labels",
15046 * "state-labels"
15047 * ],
15048 * "styles": [
15049 * {
15050 * "technique": "text",
15051 * "category": "state-labels"
15052 * }
15053 * ]
15054 * }
15055 * ```
15056 */
15057 labelPriorities?: string[];
15058}
15059
15060/**
15061 * Loads and validates a theme from URL objects.
15062 */
15063export declare class ThemeLoader {
15064 /**
15065 * Loads a {@link @here/harp-datasource-protocol#Theme} from a
15066 * remote resource, provided as a URL that points to a
15067 * JSON-encoded theme.
15068 *
15069 * By default, resolves following features of theme:
15070 *
15071 * - `extends` - loads and merges all inherited themes (see [[resolveBaseTheme]])
15072 * - `ref` - resolves all `ref` instances to their values defined in `definitions` section
15073 * of theme (see [[resolveThemeReferences]])
15074 *
15075 * Relative URIs of reference resources are resolved to full URL using the document's base URL
15076 * (see [[resolveUrls]]).
15077 *
15078 * Custom URIs (of theme itself and of resources referenced by theme) may be resolved with by
15079 * providing {@link @here/harp-utils#UriResolver} using {@link ThemeLoadOptions.uriResolver}
15080 * option.
15081 *
15082 * @param theme - {@link @here/harp-datasource-protocol#Theme} instance or theme URL
15083 * to the theme.
15084 * @param options - Optional, a {@link ThemeLoadOptions} objects
15085 * containing any custom settings for
15086 * this load request.
15087 */
15088 static load(theme: string | Theme | FlatTheme, options?: ThemeLoadOptions): Promise<Theme>;
15089 /**
15090 * Checks if `theme` instance is completely loaded, meaning that `extends` property is resolved.
15091 *
15092 * @param theme -
15093 */
15094 static isThemeLoaded(theme: Theme | FlatTheme): boolean;
15095 /**
15096 * @deprecated Please use `ThemeLoader.load`
15097 *
15098 * Loads a {@link @here/harp-datasource-protocol#Theme} from a remote resource,
15099 * provided as a URL that points to a JSON-encoded
15100 * theme.
15101 *
15102 * @param themeUrl - The URL to the theme.
15103 *
15104 */
15105 static loadAsync(themeUrl: string): Promise<Theme>;
15106 /**
15107 * Resolves all {@link @here/harp-datasource-protocol#Theme}'s relatives URLs
15108 * to full URL using the {@link @here/harp-datasource-protocol#Theme}'s URL
15109 * (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2).
15110 *
15111 * This method mutates original `theme` instance.
15112 *
15113 * @param theme - The {@link @here/harp-datasource-protocol#Theme} to resolve.
15114 */
15115 private static resolveUrls;
15116 private static checkTechniqueSupport;
15117 /**
15118 * Expand all `ref` expressions in {@link @here/harp-datasource-protocol#Theme}
15119 * basing on `definitions`.
15120 *
15121 * @remarks
15122 * This method mutates original `theme` instance.
15123 */
15124 private static resolveThemeReferences;
15125 /**
15126 * Expand all `ref` in [[StyleSet]] basing on `definitions`.
15127 */
15128 private static resolveStyleSet;
15129 /**
15130 * Expand all `ref` in [[Style]] instance basing on `definitions`.
15131 */
15132 private static resolveStyle;
15133 /**
15134 * Resolve `[ref, ...]` in expressions.
15135 *
15136 * Returns `undefined` some reference was invalid (missing or wrong type).
15137 */
15138 private static resolveExpressionReferences;
15139 /**
15140 * Realize `extends` clause by merging `theme` with
15141 * its base {@link @here/harp-datasource-protocol#Theme}.
15142 *
15143 * @param theme - {@link @here/harp-datasource-protocol#Theme} object
15144 * @param options - Optional, a {@link ThemeLoadOptions} objects
15145 * containing any custom settings for
15146 * this load request.
15147 */
15148 private static resolveBaseThemes;
15149 private static mergeThemes;
15150 private static convertFlatTheme;
15151 private static resolveResources;
15152}
15153
15154/**
15155 * Options to customize {@link @here/harp-datasource-protocol#Theme} loading process.
15156 *
15157 * @see {@link ThemeLoader.load}
15158 */
15159export declare interface ThemeLoadOptions {
15160 /**
15161 * Whether to resolve `ref` expressions in `definition` and `styles` elements.
15162 *
15163 * @default `false`, as datasources resolve definitions in [[StyleSetEvaluator]].
15164 */
15165 resolveDefinitions?: boolean;
15166 /**
15167 * Resolve the URIs to resources like fonts, icons, ...
15168 * If true, [[uriResolver]] will be used to resolve the URI
15169 * @default true
15170 */
15171 resolveResourceUris?: boolean;
15172 /**
15173 * Resolve the URIs of inherited themes (using `extends` feature).
15174 * If true, [[uriResolver]] will be used to resolve the URI
15175 * @default true
15176 */
15177 resolveIncludeUris?: boolean;
15178 /**
15179 * An `AbortSignal` object instance; allows you to communicate with a loading process
15180 * (including fetch requests) request and abort it if desired via an `AbortController`.
15181 *
15182 * Modeled after Web APIs `fetch`s `init.signal`.
15183 *
15184 * @see https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
15185 * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController
15186 */
15187 signal?: AbortSignal;
15188 /**
15189 * Maximum recursion depth when resolving base themes
15190 * through [{@link @here/harp-datasource-protocol#Theme}s `extends` property.
15191 *
15192 * @default [[DEFAULT_MAX_THEME_INTHERITANCE_DEPTH]]
15193 */
15194 maxInheritanceDepth?: number;
15195 /**
15196 * Custom logging channel on which diagnostics and warnings will be reported.
15197 *
15198 * If not specified, {@link ThemeLoader.load} will log to `console`.
15199 */
15200 logger?: ISimpleChannel;
15201 /**
15202 * Resolve asset `URI`s referenced in `Theme` assets using this resolver.
15203 */
15204 uriResolver?: UriResolver;
15205}
15206
15207/**
15208 * The ThemeVisitor visits every style in the theme in a depth-first fashion.
15209 */
15210export declare class ThemeVisitor {
15211 readonly theme: Theme;
15212 constructor(theme: Theme);
15213 /**
15214 * Applies a function to every style in the theme.
15215 *
15216 * @param visitFunc - Function to be called with `style` as an argument. Function should return
15217 * `true` to cancel visitation.
15218 * @returns `true` if function has finished prematurely.
15219 */
15220 visitStyles(visitFunc: (style: StyleDeclaration) => boolean): boolean;
15221}
15222
15223/**
15224 * The class that holds the tiled data for a {@link DataSource}.
15225 */
15226export declare class Tile implements CachedResource {
15227 readonly dataSource: DataSource;
15228 readonly tileKey: TileKey;
15229 /**
15230 * A list of the THREE.js objects stored in this `Tile`.
15231 */
15232 readonly objects: TileObject[];
15233 /**
15234 * The optional list of HERE TileKeys of tiles with geometries that cross
15235 * the boundaries of this `Tile`.
15236 */
15237 readonly dependencies: string[];
15238 /**
15239 * The bounding box of this `Tile` in geocoordinates.
15240 */
15241 readonly geoBox: GeoBox;
15242 /**
15243 * Copyright information of this `Tile`'s data.
15244 */
15245 copyrightInfo?: CopyrightInfo[];
15246 /**
15247 * Keeping some stats for the individual {@link Tile}s to analyze caching behavior.
15248 *
15249 * The frame the {@link Tile} was last requested. This is
15250 * required to know when the given {@link Tile}
15251 * can be removed from the cache.
15252 */
15253 frameNumLastRequested: number;
15254 /**
15255 * The frame the `Tile` was first visible.
15256 */
15257 frameNumVisible: number;
15258 /**
15259 * The last frame this `Tile` has been rendered (or was in the visible set). Used to determine
15260 * visibility of `Tile` at the end of a frame, if the number is the current frame number, it is
15261 * visible.
15262 */
15263 frameNumLastVisible: number;
15264 /**
15265 * After removing from cache, this is the number of frames the `Tile` was visible.
15266 */
15267 numFramesVisible: number;
15268 /**
15269 * Version stamp of the visibility set in the [[TileManager]]. If the counter is different, the
15270 * visibility of the Tile's objects has to be calculated. Optimization to reduce overhead of
15271 * computing visibility.
15272 */
15273 visibilityCounter: number;
15274 /**
15275 * @hidden
15276 *
15277 * Used to tell if the Tile is used temporarily as a fallback tile.
15278 *
15279 * levelOffset is in in the range [-quadTreeSearchDistanceUp,
15280 * quadTreeSearchDistanceDown], where these values come from the
15281 * {@link VisibleTileSetOptions}
15282 */
15283 levelOffset: number;
15284 /**
15285 * If the tile should not be rendered, this is used typically when the tile in question
15286 * is completely covered by another tile and therefore can be skipped without any visual
15287 * impact. Setting this value directly affects the [[willRender]] method, unless
15288 * overriden by deriving classes.
15289 */
15290 skipRendering: boolean;
15291 /**
15292 * @hidden
15293 *
15294 * Prepared text geometries optimized for display.
15295 */
15296 protected preparedTextPaths: TextPathGeometry[] | undefined;
15297 /**
15298 * The bounding box of this `Tile` in world coordinates.
15299 */
15300 private readonly m_boundingBox;
15301 private m_disposed;
15302 private m_disposeCallback?;
15303 private m_localTangentSpace;
15304 private m_forceHasGeometry;
15305 private m_tileLoader?;
15306 private m_decodedTile?;
15307 private m_tileGeometryLoader?;
15308 private m_textElementGroups;
15309 private readonly m_pathBlockingElements;
15310 private m_textElementsChanged;
15311 private readonly m_worldCenter;
15312 private m_visibleArea;
15313 private readonly m_elevationRange;
15314 private m_maxGeometryHeight?;
15315 private m_resourceInfo;
15316 private m_ownedTextures;
15317 private m_textStyleCache;
15318 private m_uniqueKey;
15319 private m_offset;
15320 /**
15321 * Creates a new {@link Tile}.
15322 *
15323 * @param dataSource - The {@link DataSource} that created this {@link Tile}.
15324 * @param tileKey - The unique identifier for this {@link Tile}.
15325 * Currently only up to level 24 is
15326 * supported, because of the use of the upper bits for the offset.
15327 * @param offset - The optional offset, this is an integer which represents what multiple of 360
15328 * degrees to shift, only useful for flat projections, hence optional.
15329 * @param localTangentSpace - Whether the tile geometry is in local tangent space or not.
15330 */
15331 constructor(dataSource: DataSource, tileKey: TileKey, offset?: number, localTangentSpace?: boolean);
15332 /**
15333 * The visibility status of the {@link Tile}. It is actually
15334 * visible or planned to become visible.
15335 */
15336 get isVisible(): boolean;
15337 set isVisible(visible: boolean);
15338 /**
15339 * The {@link @here/harp-geoutils#Projection} currently used by the {@link MapView}.
15340 */
15341 get projection(): Projection;
15342 /**
15343 * The {@link MapView} this `Tile` belongs to.
15344 */
15345 get mapView(): MapView;
15346 /**
15347 * Whether the data of this tile is in local tangent space or not.
15348 * If the data is in local tangent space (i.e. up vector is (0,0,1) for high zoomlevels) then
15349 * {@link MapView} will rotate the objects before rendering using the rotation matrix of the
15350 * oriented [[boundingBox]].
15351 */
15352 get localTangentSpace(): boolean;
15353 get memoryUsage(): number;
15354 /**
15355 * The center of this `Tile` in world coordinates.
15356 */
15357 get center(): THREE_2.Vector3;
15358 /**
15359 * Gets the key to uniquely represent this tile (based on
15360 * the {@link tileKey} and {@link offset}), note
15361 * this key is only unique within the given {@link DataSource},
15362 * to get a key which is unique across
15363 * {@link DataSource}s see [[DataSourceCache.getKeyForTile]].
15364 */
15365 get uniqueKey(): number;
15366 /**
15367 * The optional offset, this is an integer which represents what multiple of 360 degrees to
15368 * shift, only useful for flat projections, hence optional.
15369 */
15370 get offset(): number;
15371 /**
15372 * The optional offset, this is an integer which represents what multiple of 360 degrees to
15373 * shift, only useful for flat projections, hence optional.
15374 * @param offset - Which multiple of 360 degrees to apply to the {@link Tile}.
15375 */
15376 set offset(offset: number);
15377 /**
15378 * Compute {@link TileResourceInfo} of this `Tile`. May be using a cached value. The method
15379 * `invalidateResourceInfo` can be called beforehand to force a recalculation.
15380 *
15381 * @returns `TileResourceInfo` for this `Tile`.
15382 */
15383 getResourceInfo(): TileResourceInfo;
15384 /**
15385 * Force invalidation of the cached {@link TileResourceInfo}. Useful after the `Tile` has been
15386 * modified.
15387 */
15388 invalidateResourceInfo(): void;
15389 /**
15390 * Add ownership of a texture to this tile. The texture will be disposed if the `Tile` is
15391 * disposed.
15392 * @param texture - Texture to be owned by the `Tile`
15393 */
15394 addOwnedTexture(texture: THREE_2.Texture): void;
15395 /**
15396 * @internal
15397 * @deprecated User text elements are deprecated.
15398 *
15399 * Gets the list of developer-defined {@link TextElement} in this `Tile`. This list is always
15400 * rendered first.
15401 */
15402 get userTextElements(): TextElementGroup;
15403 /**
15404 * Adds a developer-defined {@link TextElement} to this `Tile`.
15405 *
15406 * @remarks
15407 * The {@link TextElement} is always
15408 * visible, if it's in the map's currently visible area.
15409 *
15410 * @deprecated use [[addTextElement]].
15411 *
15412 * @param textElement - The Text element to add.
15413 */
15414 addUserTextElement(textElement: TextElement): void;
15415 /**
15416 * Removes a developer-defined {@link TextElement} from this `Tile`.
15417 *
15418 * @deprecated use [[removeTextElement]].
15419 *
15420 * @param textElement - A developer-defined TextElement to remove.
15421 * @returns `true` if the element has been removed successfully; `false` otherwise.
15422 */
15423 removeUserTextElement(textElement: TextElement): boolean;
15424 /**
15425 * Adds a {@link TextElement} to this `Tile`, which is added to the visible set of
15426 * {@link TextElement}s based on the capacity and visibility. The {@link TextElement}'s priority
15427 * controls if or when it becomes visible.
15428 *
15429 * To ensure that a TextElement is visible, use a high value for its priority, such as
15430 * `TextElement.HIGHEST_PRIORITY`. Since the number of visible TextElements is limited by the
15431 * screen space, not all TextElements are visible at all times.
15432 *
15433 * @param textElement - The TextElement to add.
15434 */
15435 addTextElement(textElement: TextElement): void;
15436 /**
15437 * Adds a [[PathBlockingElement]] to this `Tile`. This path has the highest priority and blocks
15438 * all other labels. There maybe in future a use case to give it a priority, but as that isn't
15439 * yet required, it is left to be implemented later if required.
15440 * @param blockingElement - Element which should block all other labels.
15441 */
15442 addBlockingElement(blockingElement: PathBlockingElement): void;
15443 /**
15444 * Removes a {@link TextElement} from this `Tile`.
15445 *
15446 * @remarks
15447 * For the element to be removed successfully, the
15448 * priority of the {@link TextElement} has to be equal to its priority when it was added.
15449 *
15450 * @param textElement - The TextElement to remove.
15451 * @returns `true` if the TextElement has been removed successfully; `false` otherwise.
15452 */
15453 removeTextElement(textElement: TextElement): boolean;
15454 /**
15455 * @internal
15456 *
15457 * Gets the current [[GroupedPriorityList]] which
15458 * contains a list of all {@link TextElement}s to be
15459 * selected and placed for rendering.
15460 */
15461 get textElementGroups(): TextElementGroupPriorityList;
15462 /**
15463 * Gets the current modification state for the list
15464 * of {@link TextElement}s in the `Tile`. If the
15465 * value is `true` the TextElement is placed for
15466 * rendering during the next frame.
15467 */
15468 get textElementsChanged(): boolean;
15469 set textElementsChanged(changed: boolean);
15470 /**
15471 * Returns true if the `Tile` has any text elements to render.
15472 */
15473 hasTextElements(): boolean;
15474 /**
15475 * Get the current blocking elements.
15476 */
15477 get blockingElements(): PathBlockingElement[];
15478 /**
15479 * Called before {@link MapView} starts rendering this `Tile`.
15480 *
15481 * @param zoomLevel - The current zoom level.
15482 * @returns Returns `true` if this `Tile` should be rendered. Influenced directly by the
15483 * [[skipRendering]] property unless specifically overriden in deriving classes.
15484 */
15485 willRender(_zoomLevel: number): boolean;
15486 /**
15487 * Called after {@link MapView} has rendered this `Tile`.
15488 */
15489 didRender(): void;
15490 /**
15491 * Estimated visible area of tile used for sorting the priorities during loading.
15492 */
15493 get visibleArea(): number;
15494 set visibleArea(area: number);
15495 /**
15496 * @internal
15497 * Gets the tile's ground elevation range in meters.
15498 */
15499 get elevationRange(): ElevationRange;
15500 /**
15501 * @internal
15502 * Sets the tile's ground elevation range in meters.
15503 *
15504 * @param elevationRange - The elevation range.
15505 */
15506 set elevationRange(elevationRange: ElevationRange);
15507 /**
15508 * Gets the decoded tile; it is removed after geometry handling.
15509 */
15510 get decodedTile(): DecodedTile | undefined;
15511 /**
15512 * Applies the decoded tile to the tile.
15513 * If the geometry is empty, then the tile's forceHasGeometry flag is set.
15514 * Map is updated.
15515 * @param decodedTile - The decoded tile to set.
15516 */
15517 set decodedTile(decodedTile: DecodedTile | undefined);
15518 /**
15519 * Remove the decodedTile when no longer needed.
15520 */
15521 removeDecodedTile(): void;
15522 /**
15523 * Called by the {@link @here/harp-mapview-decoder#TileLoader}
15524 *
15525 * @remarks
15526 * after the `Tile` has finished loading its map data. Can be used
15527 * to add content to the `Tile`.
15528 * The {@link @here/harp-datasource-protocol#DecodedTile} should still be available.
15529 */
15530 loadingFinished(): void;
15531 /**
15532 * Called when the default implementation of `dispose()` needs
15533 * to free the geometry of a `Tile` object.
15534 *
15535 * @param object - The object that references the geometry.
15536 * @returns `true` if the geometry can be disposed.
15537 */
15538 shouldDisposeObjectGeometry(object: TileObject): boolean;
15539 /**
15540 * Called when the default implementation of `dispose()` needs
15541 * to free a `Tile` object's material.
15542 *
15543 * @param object - The object referencing the geometry.
15544 * @returns `true` if the material can be disposed.
15545 */
15546 shouldDisposeObjectMaterial(object: TileObject): boolean;
15547 /**
15548 * Called when the default implementation of `dispose()` needs
15549 * to free a Texture that is part of a `Tile` object's material.
15550 *
15551 * @param texture - The texture about to be disposed.
15552 * @returns `true` if the texture can be disposed.
15553 */
15554 shouldDisposeTexture(texture: THREE_2.Texture): boolean;
15555 /**
15556 * Returns `true` if this `Tile` has been disposed.
15557 */
15558 get disposed(): boolean;
15559 /**
15560 * Gets the [[TileGeometryLoader]] that manages this tile.
15561 */
15562 get tileGeometryLoader(): TileGeometryLoader | undefined;
15563 /**
15564 * Sets the [[TileGeometryLoader]] to manage this tile.
15565 *
15566 * @param tileGeometryLoader - A [[TileGeometryLoader]] instance to manage the geometry creation
15567 * for this tile.
15568 */
15569 set tileGeometryLoader(tileGeometryLoader: TileGeometryLoader | undefined);
15570 /**
15571 * `True` if the basic geometry has been loaded, and the `Tile` is ready for display.
15572 */
15573 get basicGeometryLoaded(): boolean;
15574 /**
15575 * `True` if all geometry of the `Tile` has been loaded.
15576 */
15577 get allGeometryLoaded(): boolean;
15578 /**
15579 * MapView checks if this `Tile` is ready to be rendered while culling.
15580 *
15581 * By default, MapView checks if the [[objects]] list is not empty. However, you can override
15582 * this check by manually setting this property.
15583 */
15584 get hasGeometry(): boolean;
15585 /**
15586 * Overrides the default value for [[hasGeometry]] if value is not `undefined`.
15587 *
15588 * @param value - A new value for the [[hasGeometry]] flag.
15589 */
15590 forceHasGeometry(value: boolean | undefined): void;
15591 /**
15592 * Reset the visibility counter. This will force the visibility check to be rerun on all objects
15593 * in this `Tile`.
15594 */
15595 resetVisibilityCounter(): void;
15596 /**
15597 * Gets the {@link ITileLoader} that manages this tile.
15598 */
15599 get tileLoader(): ITileLoader | undefined;
15600 /**
15601 * Sets the {@link ITileLoader} to manage this tile.
15602 *
15603 * @param tileLoader - A {@link ITileLoader} instance to manage
15604 * the loading process for this tile.
15605 */
15606 set tileLoader(tileLoader: ITileLoader | undefined);
15607 /**
15608 * Loads this `Tile` geometry.
15609 */
15610 load(): void;
15611 /**
15612 * Text style cache for this tile.
15613 * @hidden
15614 */
15615 get textStyleCache(): TileTextStyleCache;
15616 /**
15617 * Frees the rendering resources allocated by this `Tile`.
15618 *
15619 * The default implementation of this method frees the geometries and the materials for all the
15620 * reachable objects.
15621 * Textures are freed if they are owned by this `Tile` (i.e. if they where created by this
15622 * `Tile`or if the ownership was explicitely set to this `Tile` by [[addOwnedTexture]]).
15623 */
15624 clear(): void;
15625 /**
15626 * Removes all {@link TextElement} from the tile.
15627 */
15628 clearTextElements(): void;
15629 /**
15630 * Adds a callback that will be called whenever the tile is disposed. Multiple callbacks may be
15631 * added.
15632 * @internal
15633 * @param callback - The callback to be called when the tile is disposed.
15634 */
15635 addDisposeCallback(callback: TileCallback): void;
15636 /**
15637 * Disposes this `Tile`, freeing all geometries and materials for the reachable objects.
15638 */
15639 dispose(): void;
15640 /**
15641 * Computes the offset in the x world coordinates corresponding to this tile, based on
15642 * its [[offset]].
15643 * @returns The x offset.
15644 */
15645 computeWorldOffsetX(): number;
15646 /**
15647 * Update tile for current map view zoom level
15648 * @param zoomLevel - Zoom level of the map view
15649 */
15650 update(zoomLevel: number): void;
15651 /**
15652 * Gets the tile's bounding box.
15653 */
15654 get boundingBox(): OrientedBox3;
15655 /**
15656 * Updates the tile's world bounding box.
15657 * @param [newBoundingBox] The new bounding box to set. If undefined, the bounding box will be
15658 * computed by projecting the tile's geoBox.
15659 */
15660 private updateBoundingBox;
15661 /**
15662 * Elevates the tile's geo box using the elevation range and maximum geometry height.
15663 */
15664 private elevateGeoBox;
15665 private computeResourceInfo;
15666}
15667
15668declare type TileCallback = (tile: Tile) => void;
15669
15670/**
15671 * An accessor for all geometries in a tile.
15672 *
15673 * @remarks
15674 * This class uses a client-provided {@link ITileDataVisitor}
15675 * to visit all objects, based on filtering options specified
15676 * by both, the `TileDataAccessor` and
15677 * the visitor itself.
15678 */
15679export declare class TileDataAccessor {
15680 tile: Tile;
15681 private visitor;
15682 private m_wantsPoints;
15683 private m_wantsLines;
15684 private m_wantsAreas;
15685 private m_wantsObject3D;
15686 /**
15687 * Constructs a `TileDataAccessor` instance.
15688 *
15689 * @param tile - The tile to access.
15690 * @param visitor - The visitor.
15691 * @param options - Options for the tile.
15692 */
15693 constructor(tile: Tile, visitor: ITileDataVisitor, options: TileDataAccessorOptions);
15694 /**
15695 * Calls the visitor on all objects in the tile.
15696 */
15697 visitAll(): void;
15698 /**
15699 * Visits a single object. This function should normally be called during visiting.
15700 *
15701 * @param object - The object to visit.
15702 */
15703 protected visitObject(object: THREE_2.Object3D): void;
15704 /**
15705 * Gets the `BufferGeometry` from the specified object. This function requires the
15706 * attribute `position` in `BufferGeometry` to be set.
15707 *
15708 * @param object - The object from which to get the geometry.
15709 * @returns the geometry of the object, or `undefined`.
15710 */
15711 protected getBufferGeometry(object: THREE_2.Mesh): THREE_2.BufferGeometry | undefined;
15712 /**
15713 * Obtains an accessor for the nonindexed geometry. This function may return `undefined`
15714 * if the accessor is not implemented.
15715 *
15716 * @param geometryType - The type of geometry.
15717 * @param object - The object for which to access the attributes and geometry.
15718 * @param bufferGeometry - The object's `BufferGeometry`.
15719 * @returns an accessor for a specified object, if available.
15720 */
15721 protected getGeometryAccessor(geometryType: GeometryType, object: THREE_2.Mesh, bufferGeometry: THREE_2.BufferGeometry): IGeometryAccessor | undefined;
15722 /**
15723 * Obtains an accessor for the indexed geometry. This function may return `undefined`
15724 * if the accessor is not implemented.
15725 *
15726 * @param geometryType - The type of geometry.
15727 * @param object - The object for which to access the attributes and geometry.
15728 * @param bufferGeometry - The object's `BufferGeometry`.
15729 * @returns an accessor for a specified object, if available.
15730 */
15731 protected getIndexedGeometryAccessor(geometryType: GeometryType, object: THREE_2.Mesh, bufferGeometry: THREE_2.BufferGeometry): IGeometryAccessor | undefined;
15732 /**
15733 * Visit the object.
15734 *
15735 * @param meshObject - Object of type `Mesh`.
15736 * @param featureData - Dataset stored along with the object.
15737 */
15738 protected visitMesh(meshObject: THREE_2.Mesh, featureData: TileFeatureData): void;
15739}
15740
15741/**
15742 * An interface that provides options for {@link TileDataAccessor}.
15743 */
15744export declare interface TileDataAccessorOptions {
15745 /** Limit to objects that have `featureID`s. */
15746 onlyWithFeatureIds?: boolean;
15747 /** Sets and overrides `wantPoints`, `wantLines`, `wantAreas`, `wantObject3D`. */
15748 wantsAll?: boolean;
15749 /** `true` to visit points. */
15750 wantsPoints?: boolean;
15751 /** `true` to visit lines. */
15752 wantsLines?: boolean;
15753 /** `true` to visit area objects. */
15754 wantsAreas?: boolean;
15755 /** `true` to visit general 3D objects. */
15756 wantsObject3D?: boolean;
15757}
15758
15759/**
15760 * Common base class for the typical [[DataSource]] which uses an [[ITileDecoder]] to decode the
15761 * tile content asynchronously. The decoder can be passed in as an option, or a default
15762 * asynchronous one is generated.
15763 */
15764export declare class TileDataSource<TileType extends Tile> extends DataSource {
15765 private readonly m_tileFactory;
15766 private readonly m_options;
15767 protected readonly logger: ILogger;
15768 protected readonly m_decoder: ITileDecoder;
15769 private m_isReady;
15770 /**
15771 * Set up the `TileDataSource`.
15772 *
15773 * @param m_tileFactory - Factory to create the [[Tile]] instances.
15774 * @param m_options - Options specifying the parameters of the [[DataSource]].
15775 */
15776 constructor(m_tileFactory: TileFactory<TileType>, m_options: TileDataSourceOptions);
15777 /** @override */
15778 dispose(): void;
15779 /** @override */
15780 ready(): boolean;
15781 /**
15782 * Get the [[ITileDecoder]] of this `ITileDataSource`, which has either been passed in with
15783 * the options, or has been supplied by the [[ConcurrentDecoderFacade]].
15784 */
15785 get decoder(): ITileDecoder;
15786 /** @override */
15787 connect(): Promise<void>;
15788 /** @override */
15789 setStyleSet(styleSet?: StyleSet, definitions?: Definitions, languages?: string[]): void;
15790 /**
15791 * Apply the [[Theme]] to this data source.
15792 *
15793 * Applies new [[StyleSet]] and definitions from theme only if matching styleset (see
15794 * `styleSetName` property) is found in `theme`.
15795 * @override
15796 */
15797 setTheme(theme: Theme, languages?: string[]): void;
15798 /**
15799 * Get the [[DataProvider]] that has been passed in with the options.
15800 */
15801 dataProvider(): DataProvider;
15802 /** @override */
15803 getTilingScheme(): TilingScheme;
15804 /**
15805 * Create a [[Tile]] and start the asynchronous download of the tile content. The [[Tile]] will
15806 * be empty, but the download and decoding will be scheduled immediately. [[Tile]] instance is
15807 * initialized with default copyrights, concatenated with copyrights from copyright provider of
15808 * this data source.
15809 *
15810 * @param tileKey - Quadtree address of the requested tile.
15811 * @override
15812 */
15813 getTile(tileKey: TileKey): TileType | undefined;
15814 /**
15815 * Get [[TileInfo]] of a tile.
15816 *
15817 * @param tileKey - Quadtree address of the requested tile.
15818 * @returns A promise which will contain the [[TileInfo]] when resolved.
15819 */
15820 getTileInfo(tileKey: TileKey): Promise<TileInfo | undefined>;
15821}
15822
15823/**
15824 * Set of common options for all [[TileDataSource]]s.
15825 */
15826export declare interface TileDataSourceOptions extends DataSourceOptions {
15827 /**
15828 * The [[TilingScheme]] the data source is using.
15829 */
15830 tilingScheme: TilingScheme;
15831 /**
15832 * The [[DataProvider]] to use for downloading the actual data.
15833 */
15834 dataProvider: DataProvider;
15835 /**
15836 * Optional: Specify [[ITileDecoder]] instance.
15837 */
15838 decoder?: ITileDecoder;
15839 /**
15840 * Optional name of decoder service class.
15841 * @see [[ConcurrentDecoderFacade]]
15842 * @see [[ConcurrentWorkerSet]]
15843 */
15844 concurrentDecoderServiceName?: string;
15845 /**
15846 * Optional URL for decoder bundle to be loaded into web worker.
15847 */
15848 concurrentDecoderScriptUrl?: string;
15849 /**
15850 * Optional count of web workers to use with the decoder bundle.
15851 */
15852 concurrentDecoderWorkerCount?: number;
15853 /**
15854 * Optional, default copyright information of tiles provided by this data source.
15855 * Implementation should provide this information from the source data if possible.
15856 */
15857 copyrightInfo?: CopyrightInfo[];
15858 /**
15859 * Optional copyright info provider for tiles provided by this data source. Copyrights from
15860 * provider are concatenated with default ones from `copyrightInfo`.
15861 */
15862 copyrightProvider?: CopyrightProvider;
15863}
15864
15865export declare interface TileDisplacementMap {
15866 tileKey: TileKey;
15867 texture: THREE.DataTexture;
15868 displacementMap: DisplacementMap;
15869 geoBox: GeoBox;
15870}
15871
15872/**
15873 * Templated factory class to create instances of [[Tile]].
15874 */
15875export declare class TileFactory<TileType extends Tile> {
15876 private m_modelConstructor;
15877 /**
15878 * Initialize the factory using the constructor of the element to be called when a [[Tile]] is
15879 * created.
15880 *
15881 * @param m_modelConstructor - Constructor of (subclass of) [[Tile]].
15882 */
15883 constructor(m_modelConstructor: new (dataSource: DataSource, tileKey: TileKey) => TileType);
15884 /**
15885 * Create an instance of (subclass of) [[Tile]]. The required parameters are passed as arguments
15886 * to the constructor of [[Tile]].
15887 *
15888 * @param dataSource - [[Datasource]] this class belongs to.
15889 * @param tileKey - Quadtree address of the [[Tile]].
15890 */
15891 create(dataSource: DataSource, tileKey: TileKey): TileType;
15892}
15893
15894/**
15895 * An interface for optional feature data that is saved in a `THREE.Object3D`'s `userData`
15896 * property.
15897 */
15898export declare interface TileFeatureData {
15899 /**
15900 * The original type of geometry.
15901 */
15902 geometryType?: GeometryType;
15903 /**
15904 * An optional array of sorted indices into geometry where the feature starts. The lists of IDs
15905 * and starting indices (starts) must have the same size.
15906 * Feature i starts at starts[i] and ends at starts[i+1]-1, except for the last feature, which
15907 * ends at the last index in the object's geometry.
15908 */
15909 starts?: number[];
15910 /**
15911 * An optional object containing properties defined by the developer. It has the same size as
15912 * the list of IDs and the starting indices (starts).
15913 */
15914 objInfos?: Array<{} | undefined>;
15915}
15916
15917/**
15918 * Loads the geometry for its {@link Tile}. Loads all geometry in a single step.
15919 */
15920declare class TileGeometryLoader {
15921 private m_tile;
15922 /**
15923 * Make sure that all technique have their geometryKind set, either from the theme or their
15924 * default value.
15925 *
15926 * Also gather set of the [[GeometryKind]]s found in the techniques and return it.
15927 *
15928 * @param {DecodedTile} decodedTile
15929 * @returns {GeometryKindSet} The set of kinds used in the decodeTile.
15930 */
15931 static prepareAvailableGeometryKinds(decodedTile: DecodedTile): GeometryKindSet;
15932 /**
15933 * Make sure that the technique has its geometryKind set, either from the theme or their default
15934 * value.
15935 *
15936 * @param {Technique} technique
15937 */
15938 static compileGeometryKind(technique: Technique): GeometryKind | GeometryKindSet;
15939 private m_decodedTile?;
15940 private m_isFinished;
15941 private m_availableGeometryKinds;
15942 private m_enabledKinds;
15943 private m_disabledKinds;
15944 private m_timeout;
15945 constructor(m_tile: Tile);
15946 /**
15947 * The {@link Tile} this `TileGeometryLoader` is managing.
15948 */
15949 get tile(): Tile;
15950 /**
15951 * `True` if all geometry of the `Tile` has been loaded and the loading process is finished.
15952 */
15953 get isFinished(): boolean;
15954 /**
15955 * `True` if geometry of a `Tile` has been loaded but is not fully processed.
15956 */
15957 get geometryCreationPending(): boolean;
15958 /**
15959 * `True` if the basic geometry has been loaded, and the `Tile` is ready for display.
15960 */
15961 get basicGeometryLoaded(): boolean;
15962 /**
15963 * `True` if all geometry of the `Tile` has been loaded.
15964 */
15965 get allGeometryLoaded(): boolean;
15966 /**
15967 * Set the {@link @here/harp-datasource-protocol#DecodedTile} of the tile.
15968 *
15969 * @remarks
15970 * Is called after the decoded tile has been loaded, and
15971 * prepares its content for later processing in the 'updateXXX' methods.
15972 *
15973 * @param {DecodedTile} decodedTile The decoded tile with the flat geometry data belonging to
15974 * this tile.
15975 * @returns {DecodedTile} The processed decoded tile.
15976 */
15977 setDecodedTile(decodedTile: DecodedTile): DecodedTile;
15978 /**
15979 * The kinds of geometry stored in this {@link Tile}.
15980 */
15981 get availableGeometryKinds(): GeometryKindSet | undefined;
15982 /**
15983 * Start with or continue with loading geometry. Called repeatedly until `isFinished` is `true`.
15984 */
15985 update(enabledKinds: GeometryKindSet | undefined, disabledKinds: GeometryKindSet | undefined): void;
15986 /**
15987 * Dispose of any resources.
15988 */
15989 dispose(): void;
15990 /**
15991 * Reset the loader to its initial state and cancels any asynchronous work.
15992 */
15993 reset(): void;
15994 private finish;
15995 /**
15996 * Called by {@link VisibleTileSet} to mark that {@link Tile} is
15997 * visible and it should prepare geometry.
15998 */
15999 private prepareForRender;
16000 private discardNeedlessTile;
16001 /**
16002 * Stores geometry kinds used to load decoded tile geometry.
16003 *
16004 * This values are stored to detect geometry kind changes during loading.
16005 *
16006 * @param enabledKinds - Set of geometry kinds to be displayed or undefined.
16007 * @param disabledKinds - Set of geometry kinds that won't be rendered.
16008 */
16009 private setGeometryKinds;
16010 /**
16011 * Compare enabled and disabled geometry kinds with currently set.
16012 *
16013 * Method compares input sets with recently used geometry kinds in performance wise
16014 * manner, taking special care of undefined and zero size sets.
16015 *
16016 * @param enabledKinds - Set of geometry kinds to be displayed or undefined.
16017 * @param disabledKinds - Set of geometry kinds that won't be rendered.
16018 * @return `true` only if sets are logically equal, meaning that undefined and empty sets
16019 * may result in same geometry (techniques kind) beeing rendered.
16020 */
16021 private compareGeometryKinds;
16022}
16023
16024/**
16025 * Manages the content (the geometries) of a tile.
16026 */
16027declare class TileGeometryManager {
16028 protected mapView: MapView;
16029 /**
16030 * The set of geometry kinds that is enabled. Their geometry will be created after decoding.
16031 */
16032 get enabledGeometryKinds(): GeometryKindSet;
16033 set enabledGeometryKinds(kinds: GeometryKindSet);
16034 /**
16035 * The set of geometry kinds that is disabled. Their geometry will not be created after
16036 * decoding.
16037 */
16038 get disabledGeometryKinds(): GeometryKindSet;
16039 set disabledGeometryKinds(kinds: GeometryKindSet);
16040 /**
16041 * The set of geometry kinds that is hidden. Their geometry may be created, but it is hidden
16042 * until the method `hideKind` with an argument of `addOrRemoveToHiddenSet:false` is called.
16043 */
16044 get hiddenGeometryKinds(): GeometryKindSet;
16045 set hiddenGeometryKinds(kinds: GeometryKindSet);
16046 /**
16047 * If set to `true`, the filters of enabled/disabledGeometryKinds are applied, otherwise they
16048 * are ignored.
16049 */
16050 enableFilterByKind: boolean;
16051 protected get visibilityCounter(): number;
16052 protected enabledKinds: GeometryKindSet;
16053 protected disabledKinds: GeometryKindSet;
16054 protected hiddenKinds: GeometryKindSet;
16055 protected m_tileUpdateCallback: TileUpdateCallback | undefined;
16056 /**
16057 * Optimization for evaluation in `update()` method. Only if a kind is hidden/unhidden, the
16058 * visibility of the kinds is applied to their geometries.
16059 */
16060 private m_visibilityCounter;
16061 /**
16062 * Creates an instance of `TileGeometryManager` with a reference to the {@link MapView}.
16063 */
16064 constructor(mapView: MapView);
16065 /**
16066 * Initialize the {@link Tile} with the TileGeometryManager.
16067 */
16068 initTile(tile: Tile): void;
16069 /**
16070 * Process the {@link Tile}s for rendering. May alter the content of the tile per frame.
16071 */
16072 updateTiles(tiles: Tile[]): void;
16073 /**
16074 * Clear the enabled, disabled and hidden sets.
16075 */
16076 clear(): void;
16077 /**
16078 * Enable a [[GeometryKind]] by adding it to the enabled set, or remove it from that set.
16079 *
16080 * @param {(GeometryKind | GeometryKind[] | GeometryKindSet)} kind The kind to add or remove
16081 * from the enabled set.
16082 * @param {boolean} addOrRemoveToEnabledSet Pass in `true` to add the kind to the set, pass in
16083 * `false` to remove from that set.
16084 */
16085 enableKind(kind: GeometryKind | GeometryKind[] | GeometryKindSet, addOrRemoveToEnabledSet?: boolean): void;
16086 /**
16087 * Disable a [[GeometryKind]] by adding it to the disabled set, or remove it from that set.
16088 *
16089 * @param {(GeometryKind | GeometryKind[] | GeometryKindSet)} kind The kind to add or remove
16090 * from the disabled set.
16091 * @param {boolean} addOrRemoveToHiddenSet Pass in `true` to add the kind to the set, pass in
16092 * `false` to remove from that set.
16093 */
16094 disableKind(kind: GeometryKind | GeometryKind[] | GeometryKindSet, addOrRemoveToDisabledSet?: boolean): void;
16095 /**
16096 * Hide a [[GeometryKind]] by adding it to the hidden set, or remove it from that set.
16097 *
16098 * @param {(GeometryKind | GeometryKind[] | GeometryKindSet)} kind The kind to add or remove
16099 * from the hidden set.
16100 * @param {boolean} addOrRemoveToHiddenSet Pass in `true` to hide the kind(s), `false` to show
16101 * it again.
16102 */
16103 hideKind(kind: GeometryKind | GeometryKind[] | GeometryKindSet, addOrRemoveToHiddenSet?: boolean): void;
16104 /**
16105 * Return all [[GeometryKind]]s that are contained in the tiles.
16106 *
16107 * @param {IterableIterator<Tile>} tiles The
16108 * @returns {GeometryKindSet}
16109 */
16110 getAvailableKinds(tiles: IterableIterator<Tile>): GeometryKindSet;
16111 /**
16112 * Apply the visibility status taken from the `hiddenKinds` to all geometries in the specified
16113 * tiles.
16114 *
16115 * @param {Tile[]} tiles List of [[Tiles]] to process the visibility status of.
16116 */
16117 updateTileObjectVisibility(tiles: Tile[]): boolean;
16118 /**
16119 * Sets a callback that will be called for every updated tile on [[updateTiles]].
16120 *
16121 * @param {TileUpdateCallback} callback The callback that will be called after a tile has been
16122 * updated, passing the updated tile as argument. If `undefined`, a previously set callback will
16123 * be cleared.
16124 */
16125 setTileUpdateCallback(callback?: TileUpdateCallback): void;
16126 protected incrementVisibilityCounter(): number;
16127 /**
16128 * Add or remove a kind|array of kinds|set of kinds from the specified kind set.
16129 *
16130 * @hidden
16131 * @param {GeometryKindSet} set
16132 * @param {(GeometryKind | GeometryKind[] | GeometryKindSet)} kind
16133 * @param {boolean} addToSet
16134 */
16135 private enableDisableKinds;
16136 /**
16137 * Add or remove a single kind from the specified kind set.
16138 *
16139 * @hidden
16140 * @param {GeometryKindSet} set
16141 * @param {(GeometryKind | GeometryKind[] | GeometryKindSet)} kind
16142 * @param {boolean} addToSet
16143 */
16144 private addRemove;
16145}
16146
16147/**
16148 * Defines a map tile metadata.
16149 */
16150export declare interface TileInfo {
16151 readonly tileKey: TileKey;
16152 readonly setupTime: number;
16153 readonly transferList?: ArrayBuffer[];
16154 readonly numBytes: number;
16155}
16156
16157/**
16158 * Subclass of [[TileLoader]] which is used by [[TileDataSource]] to load the [[TileInfo]] meta
16159 * data, not the tile data itself.
16160 */
16161export declare class TileInfoLoader extends TileLoader {
16162 tileInfo?: TileInfo;
16163 /** @override */
16164 protected startDecodeTile(): void;
16165}
16166
16167/**
16168 * The `TileKey` instances are used to address a tile in a quadtree.
16169 *
16170 * A tile key is defined by a row, a column, and a level. The tree has a root at level 0, with one
16171 * single tile. On every level, each tile is divided into four children (therefore the name
16172 * quadtree).
16173 *
16174 * Within each [[level]], any particular tile is addressed with [[row]] and [[column]]. The number
16175 * of rows and columns in each level is 2 to the power of the level. This means: On level 0, only
16176 * one tile exists, [[columnsAtLevel]]() and [[rowsAtLevel]]() are both 1. On level 1, 4 tiles
16177 * exist, in 2 rows and 2 columns. On level 2 we have 16 tiles, in 4 rows and 4 columns. And so on.
16178 *
16179 * A tile key is usually created using [[fromRowColumnLevel]]() method.
16180 *
16181 * `TileKey` instances are immutable, all members return new instances of `TileKey` and do not
16182 * modify the original object.
16183 *
16184 * Utility functions like [[parent]](), [[changedLevelBy]](), and [[changedLevelTo]]() allow for
16185 * easy vertical navigation of the tree. The number of available rows and columns in the tile's
16186 * level is given with [[rowCount]]() and [[columnCount]]().
16187 *
16188 * Tile keys can be created from and converted into various alternative formats:
16189 *
16190 * - [[toQuadKey]]() / [[fromQuadKey]]() - string representation 4-based
16191 * - [[toHereTile]]() / [[fromHereTile]]() - string representation 10-based
16192 * - [[mortonCode]]() / [[fromMortonCode]]() - number representation
16193 *
16194 * Note - as JavaScript's number type can hold 53 bits in its mantissa, only levels up to 26 can be
16195 * represented in the number representation returned by [[mortonCode]]().
16196 */
16197export declare class TileKey {
16198 readonly row: number;
16199 readonly column: number;
16200 readonly level: number;
16201 /**
16202 * Creates a tile key.
16203 *
16204 * @param row - The requested row. Must be less than 2 to the power of level.
16205 * @param column - The requested column. Must be less than 2 to the power of level.
16206 * @param level - The requested level.
16207 */
16208 static fromRowColumnLevel(row: number, column: number, level: number): TileKey;
16209 /**
16210 * Creates a tile key from a quad string.
16211 *
16212 * The quad string can be created with [[toQuadKey]].
16213 *
16214 * @param quadkey - The quadkey to convert.
16215 * @returns A new instance of `TileKey`.
16216 */
16217 static fromQuadKey(quadkey: string): TileKey;
16218 /**
16219 * Creates a tile key from a numeric Morton code representation.
16220 *
16221 * You can convert a tile key into a numeric Morton code with [[mortonCode]].
16222 *
16223 * @param quadKey64 - The Morton code to be converted.
16224 * @returns A new instance of {@link TileKey}.
16225 */
16226 static fromMortonCode(quadKey64: number): TileKey;
16227 /**
16228 * Creates a tile key from a heretile code string.
16229 *
16230 * The string can be created with [[toHereTile]].
16231 *
16232 * @param quadkey64 - The string representation of the HERE tile key.
16233 * @returns A new instance of `TileKey`.
16234 */
16235 static fromHereTile(quadkey64: string): TileKey;
16236 /**
16237 * Returns the number of available columns at a given level.
16238 *
16239 * This is 2 to the power of the level.
16240 *
16241 * @param level - The level for which to return the number of columns.
16242 * @returns The available columns at the given level.
16243 */
16244 static columnsAtLevel(level: number): number;
16245 /**
16246 * Returns the number of available rows at a given level.
16247 *
16248 * This is 2 to the power of the level.
16249 *
16250 * @param level - The level for which to return the number of rows.
16251 * @returns The available rows at the given level.
16252 */
16253 static rowsAtLevel(level: number): number;
16254 /**
16255 * Returns the closest matching `TileKey` in a cartesian coordinate system.
16256 *
16257 * @param level - The level for the tile key.
16258 * @param coordX - The X coordinate.
16259 * @param coordY - The Y coordinate.
16260 * @param totalWidth - The maximum X coordinate.
16261 * @param totalHeight - The maximum Y coordinate.
16262 * @returns A new tile key at the given level that includes the given coordinates.
16263 */
16264 static atCoords(level: number, coordX: number, coordY: number, totalWidth: number, totalHeight: number): TileKey;
16265 /**
16266 * Computes the Morton code of the parent tile key of the given Morton code.
16267 *
16268 * Note: The parent key of the root key is the root key itself.
16269 *
16270 * @param mortonCode - A Morton code, for example, obtained from [[mortonCode]].
16271 * @returns The Morton code of the parent tile.
16272 */
16273 static parentMortonCode(mortonCode: number): number;
16274 private m_mortonCode?;
16275 private m_hereTile?;
16276 /**
16277 * Constructs a new immutable instance of a `TileKey`.
16278 *
16279 * For the better readability, {@link TileKey.fromRowColumnLevel} should be preferred.
16280 *
16281 * Note - row and column must not be greater than the maximum rows/columns for the given level.
16282 *
16283 * @param row - Represents the row in the quadtree.
16284 * @param column - Represents the column in the quadtree.
16285 * @param level - Represents the level in the quadtree.
16286 */
16287 constructor(row: number, column: number, level: number);
16288 /**
16289 * Returns a tile key representing the parent of the tile addressed by this tile key.
16290 *
16291 * Throws an exception is this tile is already the root.
16292 */
16293 parent(): TileKey;
16294 /**
16295 * Returns a new tile key at a level that differs from this tile's level by delta.
16296 *
16297 * Equivalent to `changedLevelTo(level() + delta)`.
16298 *
16299 * Note - root key is returned if `delta` is smaller than the level of this tile key.
16300 *
16301 * @param delta - The numeric difference between the current level and the requested level.
16302 */
16303 changedLevelBy(delta: number): TileKey;
16304 /**
16305 * Returns a new tile key at the requested level.
16306 *
16307 * If the requested level is smaller than the tile's level, then the key of an ancestor of this
16308 * tile is returned. If the requested level is larger than the tile's level, then the key of
16309 * first child or grandchild of this tile is returned, for example, the child with the lowest
16310 * row and column number. If the requested level equals this tile's level, then the tile key
16311 * itself is returned. If the requested level is negative, the root tile key is returned.
16312 *
16313 * @param level - The requested level.
16314 */
16315 changedLevelTo(level: number): TileKey;
16316 /**
16317 * Converts the tile key to a numeric code representation.
16318 *
16319 * You can create a tile key from a numeric Morton code with [[fromMortonCode]].
16320 *
16321 * Note - only levels <= 26 are supported.
16322 */
16323 mortonCode(): number;
16324 /**
16325 * Converts the tile key into a string for using in REST API calls.
16326 *
16327 * The string is a quadkey Morton code representation as a string.
16328 *
16329 * You can convert back from a quadkey string with [[fromHereTile]].
16330 */
16331 toHereTile(): string;
16332 /**
16333 * Converts the tile key into a string for using in REST API calls.
16334 *
16335 * If the tile is the root tile, the quadkey is '-'. Otherwise the string is a number to the
16336 * base of 4, but without the leading 1, with the following properties:
16337 * 1. the number of digits equals the level.
16338 * 2. removing the last digit gives the parent tile's quadkey string, i.e. appending 0,1,2,3
16339 * to a quadkey string gives the tiles's children.
16340 *
16341 * You can convert back from a quadkey string with [[fromQuadKey]].
16342 */
16343 toQuadKey(): string;
16344 /**
16345 * Equality operator.
16346 *
16347 * @param qnr - The tile key to compare to.
16348 * @returns `true` if this tile key has identical row, column and level, `false` otherwise.
16349 */
16350 equals(qnr: TileKey): boolean;
16351 /**
16352 * Returns the absolute quadkey that is constructed from its sub quadkey.
16353 *
16354 * @param sub - The sub key.
16355 * @returns The absolute tile key in the quadtree.
16356 */
16357 addedSubKey(sub: string): TileKey;
16358 /**
16359 * Returns the absolute quadkey that is constructed from its sub HERE tile key.
16360 *
16361 * @param sub - The sub HERE key.
16362 * @returns The absolute tile key in the quadtree.
16363 */
16364 addedSubHereTile(sub: string): TileKey;
16365 /**
16366 * Returns a sub quadkey that is relative to its parent.
16367 *
16368 * This function can be used to generate sub keys that are relative to a parent that is delta
16369 * levels up in the quadtree.
16370 *
16371 * This function can be used to create shortened keys for quads on lower levels if the parent is
16372 * known.
16373 *
16374 * Note - the sub quadkeys fit in a 16-bit unsigned integer if the `delta` is smaller than 8. If
16375 * `delta` is smaller than 16, the sub quadkey fits into an unsigned 32-bit integer.
16376 *
16377 * Deltas larger than 16 are not supported.
16378 *
16379 * @param delta - The number of levels relative to its parent quadkey. Must be greater or equal
16380 * to 0 and smaller than 16.
16381 * @returns The quadkey relative to its parent that is `delta` levels up the tree.
16382 */
16383 getSubHereTile(delta: number): string;
16384 /**
16385 * Returns the number of available rows in the tile's [[level]].
16386 *
16387 * This is 2 to the power of the level.
16388 */
16389 rowCount(): number;
16390 /**
16391 * Returns the number of available columns in the tile's [[level]].
16392 *
16393 * This is 2 to the power of the level.
16394 */
16395 columnCount(): number;
16396}
16397
16398/**
16399 * Map tile keys to TileKeyEntry.
16400 * Keys are a combination of morton code and tile offset,
16401 * see [[TileOffsetUtils.getKeyForTileKeyAndOffset]].
16402 */
16403declare type TileKeyEntries = Map<number, TileKeyEntry>;
16404
16405/**
16406 * Represents a unique TileKey and the area it takes up on screen.
16407 *
16408 * Note, in certain tiling projections, it is possible to have an offset, which represents a tile
16409 * which has fully wrapped around, hence this defaults to 0 to simplify usage for projections which
16410 * don't require it.
16411 */
16412declare class TileKeyEntry {
16413 tileKey: TileKey;
16414 area: number;
16415 offset: number;
16416 minElevation: number;
16417 maxElevation: number;
16418 distance: number;
16419 constructor(tileKey: TileKey, area: number, offset?: number, minElevation?: number, maxElevation?: number, distance?: number);
16420}
16421
16422export declare class TileKeyUtils {
16423 static geoCoordinatesToTileKey(tilingScheme: TilingScheme, geoPoint: GeoCoordinatesLike, level: number): TileKey | null;
16424 static worldCoordinatesToTileKey(tilingScheme: TilingScheme, worldPoint: Vector3Like, level: number): TileKey | null;
16425 static geoRectangleToTileKeys(tilingScheme: TilingScheme, geoBox: GeoBox, level: number): TileKey[];
16426}
16427
16428/**
16429 * The [[TileLoader]] manages the different states of loading and decoding for a [[Tile]]. Used by
16430 * the [[TileDataSource]].
16431 */
16432export declare class TileLoader {
16433 protected dataSource: DataSource;
16434 protected tileKey: TileKey;
16435 protected dataProvider: DataProvider;
16436 protected tileDecoder: ITileDecoder;
16437 priority: number;
16438 /**
16439 * Current state of `TileLoader`.
16440 */
16441 state: TileLoaderState;
16442 /**
16443 * Error object if loading or decoding failed.
16444 */
16445 error?: Error;
16446 /**
16447 * The binary data in form of [[ArrayBufferLike]], or any object.
16448 */
16449 payload?: ArrayBufferLike | {};
16450 /**
16451 * The result of decoding the `payload`: The [[DecodedTile]].
16452 */
16453 decodedTile?: DecodedTile;
16454 /**
16455 * The abort controller notifying the [[DataProvider]] to cancel loading.
16456 */
16457 protected loadAbortController: AbortController;
16458 /**
16459 * The notifying the [[ITileDecoder]] to cancel decoding.
16460 */
16461 protected requestController?: RequestController;
16462 /**
16463 * The promise which is resolved when loading and decoding have finished.
16464 */
16465 protected donePromise?: Promise<TileLoaderState>;
16466 /**
16467 * The internal function that is called when loading and decoding have finished successfully.
16468 */
16469 protected resolveDonePromise?: (state: TileLoaderState) => void;
16470 /**
16471 * The internal function that is called when loading and decoding failed.
16472 */
16473 protected rejectedDonePromise?: (state: TileLoaderState) => void;
16474 /**
16475 * Set up loading of a single [[Tile]].
16476 *
16477 * @param dataSource - The [[DataSource]] the tile belongs to.
16478 * @param tileKey - The quadtree address of a [[Tile]].
16479 * @param dataProvider - The [[DataProvider]] that retrieves the binary tile data.
16480 * @param tileDecoder - The [[ITileDecoder]] that decodes the binary tile to a [[DecodeTile]].
16481 * @param priority - The priority given to the loading job. Highest number will be served first.
16482 */
16483 constructor(dataSource: DataSource, tileKey: TileKey, dataProvider: DataProvider, tileDecoder: ITileDecoder, priority: number);
16484 /**
16485 * Start loading and/or proceed through the various states of loading of this tile.
16486 *
16487 * @returns A promise which resolves the [[TileLoaderState]].
16488 */
16489 loadAndDecode(): Promise<TileLoaderState>;
16490 /**
16491 * Return the current state in form of a promise. Caller can then wait for the promise to be
16492 * resolved.
16493 *
16494 * @returns A promise which resolves the current [[TileLoaderState]].
16495 */
16496 waitSettled(): Promise<TileLoaderState>;
16497 /**
16498 * Cancel loading of the [[Tile]].
16499 * Cancellation token is notified, an internal state is cleaned up.
16500 */
16501 cancel(): void;
16502 /**
16503 * Return `true` if [[Tile]] is still loading, `false` otherwise.
16504 */
16505 get isFinished(): boolean;
16506 /**
16507 * Update the priority of this [[Tile]]'s priority. Is effective to sort the decoding requests
16508 * in the request queue (used during heavy load).
16509 */
16510 updatePriority(priority: number): void;
16511 /**
16512 * Start loading. Only call if loading did not start yet.
16513 */
16514 protected startLoading(): void;
16515 /**
16516 * Called when binary data has been loaded. The loading state is now progressing to decoding.
16517 *
16518 * @param payload - Binary data in form of [[ArrayBufferLike]], or any object.
16519 */
16520 protected onLoaded(payload: ArrayBufferLike | {}): void;
16521 /**
16522 * Start decoding the payload.
16523 */
16524 protected startDecodeTile(): void;
16525 /**
16526 * Called when the decoding is finished, and the [[DecodedTile]] has been created.
16527 *
16528 * @param decodedTile - The [[DecodedTile]].
16529 */
16530 protected onDecoded(decodedTile: DecodedTile): void;
16531 /**
16532 * Cancel the decoding process.
16533 */
16534 protected cancelDecoding(): void;
16535 /**
16536 * Called when loading and decoding has finished successfully. Resolves loading promise if the
16537 * state is Ready, otherwise it rejects the promise with the supplied state.
16538 *
16539 * @param doneState - The latest state of loading.
16540 */
16541 protected onDone(doneState: TileLoaderState): void;
16542 /**
16543 * Called when loading or decoding has finished with an error.
16544 *
16545 * @param error - Error object describing the failing.
16546 */
16547 protected onError(error: Error): void;
16548}
16549
16550/**
16551 * Missing Typedoc
16552 */
16553export declare enum TileLoaderState {
16554 Initialized = 0,
16555 Loading = 1,
16556 Loaded = 2,
16557 Decoding = 3,
16558 Ready = 4,
16559 Canceled = 5,
16560 Failed = 6
16561}
16562
16563export declare type TileObject = THREE_2.Object3D & {
16564 /**
16565 * Distance of this object from the {@link Tile}'s center.
16566 */
16567 displacement?: THREE_2.Vector3;
16568 /**
16569 * This stores the THREE.Object3D renderOrder property, we need to back it up because we need to
16570 * reduce it if the tile is used as fall back. When it is used normally, the renderOrder needs
16571 * to be reset.
16572 * @hidden
16573 */
16574 _backupRenderOrder?: number;
16575};
16576
16577export declare namespace TileOffsetUtils {
16578 /**
16579 * Creates a unique key based on the supplied parameters. Note, the uniqueness is bounded by the
16580 * bitshift. The [[TileKey.mortonCode()]] supports currently up to 26 levels (this is because
16581 * 26*2 equals 52, and 2^52 is the highest bit that can be set in an integer in Javascript), the
16582 * bitshift reduces this accordingly, so given the default bitshift of four, we support up to 24
16583 * levels. Given the current support up to level 19 this should be fine.
16584 *
16585 * @param tileKey - The unique {@link @here/harp-geoutils#TileKey}
16586 * from which to compute the unique key.
16587 * @param offset - How much the given {@link @here/harp-geoutils#TileKey} is offset
16588 * @param bitshift - How much space we have to store the offset. The default of 4 means we have
16589 * enough space to store 16 unique tiles in a single view.
16590 */
16591 export function getKeyForTileKeyAndOffset(tileKey: TileKey, offset: number, bitshift?: number): number;
16592 /**
16593 * Extracts the offset and morton key from the given key (must be created by:
16594 * [[getKeyForTileKeyAndOffset]])
16595 *
16596 * Note, we can't use bitshift operators in Javascript because they work on 32-bit integers, and
16597 * would truncate the numbers, hence using powers of two.
16598 *
16599 * @param key - Key to extract offset and morton key.
16600 * @param bitshift - How many bits to shift by, must be the same as was used when creating the
16601 * key.
16602 */
16603 export function extractOffsetAndMortonKeyFromKey(key: number, bitshift?: number): {
16604 offset: number;
16605 mortonCode: number;
16606 };
16607 /**
16608 * Returns the key of the parent. Key must have been computed using the function
16609 * [[getKeyForTileKeyAndOffset]].
16610 *
16611 * @param calculatedKey - Key to decompose
16612 * @param bitshift - Bit shift used to create the key
16613 */
16614 export function getParentKeyFromKey(calculatedKey: number, bitshift?: number): number;
16615}
16616
16617/**
16618 * Simple information about resource usage by the {@link Tile}. Heap and GPU information are
16619 * estimations.
16620 */
16621export declare interface TileResourceInfo {
16622 /**
16623 * Estimated number of bytes used on the heap.
16624 */
16625 heapSize: number;
16626 /**
16627 * Estimated number of bytes used on the GPU.
16628 */
16629 gpuSize: number;
16630 /**
16631 * Number of [[THREE.Object3D]] in this tile.
16632 */
16633 num3dObjects: number;
16634 /**
16635 * Number of {@link TextElement}s in this tile.
16636 */
16637 numTextElements: number;
16638 /**
16639 * @deprecated This counter has been merged with numTextElements.
16640 * Number of user {@link TextElement}s in this tile.
16641 */
16642 numUserTextElements: number;
16643}
16644
16645/**
16646 * An object that contains information about resources used by a tile.
16647 */
16648export declare interface TileResourceUsage {
16649 /**
16650 * The estimated memory usage, in bytes.
16651 */
16652 estimatedMemoryUsage: number;
16653 /**
16654 * The amount of vertices used by a tile.
16655 */
16656 numVertices: number;
16657 /**
16658 * The amount of colors used by a tile.
16659 */
16660 numColors: number;
16661 /**
16662 * The amount of objects used by a tile.
16663 */
16664 numObjects: number;
16665 /**
16666 * The amount of geometries used by a tile.
16667 */
16668 numGeometries: number;
16669 /**
16670 * The amount of materials used by a tile.
16671 */
16672 numMaterials: number;
16673}
16674
16675declare class TileTextStyleCache {
16676 private textRenderStyles;
16677 private textLayoutStyles;
16678 private tile;
16679 constructor(tile: Tile);
16680 clear(): void;
16681 getRenderStyle(technique: (TextTechnique | PoiTechnique | LineMarkerTechnique) & IndexedTechniqueParams): TextRenderStyle;
16682 getLayoutStyle(technique: (TextTechnique | PoiTechnique | LineMarkerTechnique) & IndexedTechniqueParams): TextLayoutStyle;
16683}
16684
16685export declare class TileTreeTraverse {
16686 private m_subdivisionScheme;
16687 constructor(subdivisionScheme: SubdivisionScheme);
16688 subTiles(tileKey: TileKey): Iterable<TileKey>;
16689}
16690
16691declare type TileUpdateCallback = (tile: Tile) => void;
16692
16693/**
16694 * The `TilingScheme` represents how the data is tiled.
16695 */
16696export declare class TilingScheme {
16697 readonly subdivisionScheme: SubdivisionScheme;
16698 readonly projection: Projection;
16699 readonly boundingBoxGenerator: FlatTileBoundingBoxGenerator;
16700 readonly tileTreeTraverse: TileTreeTraverse;
16701 /**
16702 * Constructs a new `TilingScheme` with the given subdivision scheme and projection.
16703 *
16704 * @param subdivisionScheme - The subdivision scheme used by this `TilingScheme`.
16705 * @param projection - The projection used by this `TilingScheme`.
16706 */
16707 constructor(subdivisionScheme: SubdivisionScheme, projection: Projection);
16708 /**
16709 * Returns the sub tile keys of the given tile.
16710 *
16711 * @param tileKey - The {@link TileKey}.
16712 * @returns The list of the sub tile keys.
16713 */
16714 getSubTileKeys(tileKey: TileKey): Iterable<TileKey>;
16715 /**
16716 * Gets the {@link TileKey} from the given geo position and level.
16717 *
16718 * @param geoPoint - The position in geo coordinates.
16719 * @param level - The level of the resulting `TileKey`.
16720 */
16721 getTileKey(geoPoint: GeoCoordinatesLike, level: number): TileKey | null;
16722 /**
16723 * Gets the list of {@link TileKey}s contained in the given {@link GeoBox}.
16724 *
16725 * @param geoBox - The bounding box in geo coordinates.
16726 * @param level - The level of the resulting `TileKey`.
16727 */
16728 getTileKeys(geoBox: GeoBox, level: number): TileKey[];
16729 /**
16730 * Returns the bounding box in geo coordinates for the given {@link TileKey}.
16731 *
16732 * @param tileKey - The `TileKey`.
16733 */
16734 getGeoBox(tileKey: TileKey): GeoBox;
16735 /**
16736 * Returns the bounding box in world coordinates.
16737 *
16738 * @param tileKey - The `TileKey`.
16739 * @param result - The optional object that will contain the resulting bounding box.
16740 */
16741 getWorldBox(tileKey: TileKey, result?: Box3Like): Box3Like;
16742}
16743
16744export declare enum TiltState {
16745 Tilted = 0,
16746 Down = 1
16747}
16748
16749/**
16750 * Evaluates camera clipping planes taking into account ground distance and camera angles.
16751 *
16752 * This evaluator provides support for camera with varying tilt (pitch) angle, the angle
16753 * between camera __look at__ vector and the ground surface normal.
16754 */
16755export declare class TiltViewClipPlanesEvaluator extends TopViewClipPlanesEvaluator {
16756 /**
16757 * Calculate the lengths of frustum planes intersection with the ground plane.
16758 * This evaluates distances between eye vector (or eye plane in orthographic projection) and
16759 * ground intersections of top and bottom frustum planes.
16760 * @note This method assumes the world surface (ground) to be flat and
16761 * works only with planar projections.
16762 *
16763 * @param camera - The [[THREE.Camera]] instance in use,
16764 * @param projection - The geo-projection used to convert geographic to world coordinates.
16765 */
16766 protected getFrustumGroundIntersectionDist(camera: THREE_2.Camera, projection: Projection): {
16767 top: number;
16768 bottom: number;
16769 };
16770 /** @override */
16771 protected evaluateDistancePlanarProj(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
16772 /** @override */
16773 protected evaluateDistanceSphericalProj(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
16774 protected getTiltedFovBasedFarPlane(d: number, r: number, halfFovAngle: number, cameraPitch: number): number;
16775 private getCameraPitch;
16776}
16777
16778/**
16779 * An interface for a Timer class, that abstracts the basic functions of a Timer. Implemented
16780 * by SimpleTimer, SampledTimer, and MultiStageTimer.
16781 */
16782export declare interface Timer {
16783 readonly name: string;
16784 readonly value?: number;
16785 /**
16786 * Resets value to be able to start again.
16787 */
16788 reset(): void;
16789 /**
16790 * Starts the timer. Returns the current time, based on `Performance.now()`.
16791 */
16792 start(): number;
16793 /**
16794 * Stops the timer. Requires that the timer has started.
16795 */
16796 stop(): number;
16797 /**
16798 * Samples the timer. Requires that the timer has started. This function does not modify
16799 * the timer's internal state.
16800 *
16801 * @returns Current timer value. `-1` if statistics are disabled.
16802 */
16803 now(): number;
16804 /**
16805 * Sets the measurement value for the amount of time that has elapsed from start() to stop().
16806 * Use this function to override the timer's duration.
16807 *
16808 * @param val - The timer's duration.
16809 */
16810 setValue(val: number | undefined): void;
16811}
16812
16813/**
16814 * Options for authentication with [[authenticationCode]].
16815 */
16816declare interface TokenAuthentication {
16817 /**
16818 * Authentication code used for the different APIs.
16819 *
16820 * When [[AuthenticationProvider]] is is used as value, the provider is called before each
16821 * to get currently valid authentication code/token.
16822 */
16823 authenticationCode: string | AuthenticationProvider;
16824}
16825
16826/**
16827 * Top view, clip planes evaluator that computes view ranges based on ground distance and elevation.
16828 *
16829 * This evaluator supports both planar and spherical projections, although it behavior is
16830 * slightly different in each case. General algorithm sets near plane and far plane close
16831 * to ground level, but taking into account maximum and minimum elevation of features on the ground.
16832 *
16833 * @note This evaluator supports only cameras which are always looking down the ground surface
16834 * (top-down view) along surface normal and does not preserve correct clip planes when
16835 * modifying camera pitch (tilt) angle. In simple words it is suitable only for top view camera
16836 * settings.
16837 */
16838export declare class TopViewClipPlanesEvaluator extends ElevationBasedClipPlanesEvaluator {
16839 readonly nearMin: number;
16840 readonly nearFarMarginRatio: number;
16841 readonly farMaxRatio: number;
16842 /**
16843 * Helper for reducing number of objects created at runtime.
16844 */
16845 protected m_tmpVectors: THREE_2.Vector3[];
16846 /**
16847 * Helper object for reducing performance impact.
16848 */
16849 protected m_tmpQuaternion: THREE_2.Quaternion;
16850 private m_minimumViewRange;
16851 /**
16852 * Allows to setup near/far offsets (margins), rendered geometry elevation relative to sea
16853 * level as also minimum near plane and maximum far plane distance constraints.
16854 * It is strongly recommended to set some reasonable [[nearFarMargin]] (offset) between near
16855 * and far planes to avoid flickering.
16856 * @param maxElevation - defines near plane offset from the ground in the surface normal
16857 * direction, positive values allows to render elevated terrain features (mountains,
16858 * buildings). Defaults to Burj Khalifa building height.
16859 * @param minElevation - defines far plane offset from the ground surface, negative values moves
16860 * far plane below the ground level (use it to render depressions). Default zero - sea level.
16861 * @param nearMin - minimum allowable near plane distance from camera, must be bigger than zero.
16862 * @param nearFarMarginRatio - minimum distance between near and far plane, as a ratio of
16863 * average near/far plane distance, it have to be significantly bigger than zero (especially if
16864 * [[maxElevation]] and [[minElevation]] are equal), otherwise you may notice flickering when
16865 * rendering, or even render empty scene if frustum planes are almost equal.
16866 * @param farMaxRatio - maximum ratio between ground and far plane distance, allows to limit
16867 * viewing distance at overall. Have to be bigger than 1.0.
16868 * @note Keep in mind that this evaluator does not evaluate terrain (or building) elevation
16869 * automatically, to keep such features rendered (between frustum planes) use [[minElevation]],
16870 * [[maxElevation]] constraints. You may change this parameters at any time, but it requires
16871 * repeating [[evaluatePlanes]] step, if your camera is moving you need to evaluate planes
16872 * anyway.
16873 * @note You may treat [[minElevation]] and [[maxElevation]] parameters as the maximum and
16874 * minimum renderable elevation respectively along the surface normal, when camera is
16875 * constantly looking downwards (top-down view). If you need {@link ClipPlanesEvaluator} for
16876 * cameras that support tilt or yaw please use {@link TiltViewClipPlanesEvaluator}.
16877 * @note [[nearFarMaxRatio]] does not limit far plane when spherical projection is in use,
16878 * the algorithm used there estimates distance to point on tangent where line from camera
16879 * touches the sphere horizon and there is no reason to clamp it.
16880 */
16881 constructor(maxElevation?: number, minElevation?: number, nearMin?: number, nearFarMarginRatio?: number, farMaxRatio?: number);
16882 /** @override */
16883 evaluateClipPlanes(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
16884 /**
16885 * Get minimum view range that is possible to achieve with current evaluator settings.
16886 * @note This value will not change after evaluator is constructed.
16887 */
16888 protected get minimumViewRange(): ViewRanges;
16889 /**
16890 * Calculate camera altitude (closest distance) to ground level in world units.
16891 * @param camera -
16892 * @param projection -
16893 */
16894 protected getCameraAltitude(camera: THREE_2.Camera, projection: Projection): number;
16895 protected evaluateDistancePlanarProj(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
16896 protected evaluateDistanceSphericalProj(camera: THREE_2.Camera, projection: Projection, elevationProvider?: ElevationProvider): ViewRanges;
16897 /**
16898 * Calculate distance from a point to the tangent point of a sphere.
16899 *
16900 * Returns zero if point is below surface or only very slightly above surface of sphere.
16901 * @param d - Distance from point to center of sphere
16902 * @param r - Radius of sphere
16903 */
16904 protected getTangentDistance(d: number, r: number): number;
16905 /**
16906 * Calculate far plane depending on furthest visible distance from camera position.
16907 *
16908 * Furthest visible distance is assumed to be distance from camera to horizon
16909 * plus distance from elevated geometry to horizon(so that high objects behind horizon
16910 * remain visible).
16911 * @param camera - The camera of the mapview
16912 * @param d - Distance from camera to origin
16913 * @param r - Radius of earth
16914 * @param alpha - Angle between camera eye vector and tangent
16915 */
16916 protected getTangentBasedFarPlane(camera: THREE_2.PerspectiveCamera, d: number, r: number, alpha: number): number;
16917 protected getFovBasedFarPlane(camera: THREE_2.PerspectiveCamera, d: number, r: number, fovAngle: number, projection: Projection): number;
16918 protected getOrthoBasedFarPlane(d: number, r: number): number;
16919}
16920
16921/**
16922 * The interface {@link TransformLike} is used to represent transforms with
16923 * only translation and rotation.
16924 */
16925export declare interface TransformLike {
16926 /**
16927 * The position of this transform.
16928 */
16929 readonly position: Vector3Like;
16930 /**
16931 * The x-axis of this transform.
16932 */
16933 readonly xAxis: Vector3Like;
16934 /**
16935 * The y-axis of this transform.
16936 */
16937 readonly yAxis: Vector3Like;
16938 /**
16939 * The z-axis of this transform.
16940 */
16941 readonly zAxis: Vector3Like;
16942}
16943
16944/**
16945 * Names of the properties controlling transparency.
16946 * @internal
16947 */
16948export declare const TRANSPARENCY_PROPERTY_KEYS: string[];
16949
16950/**
16951 * Transverse Mercator {@link Projection} used to convert geo coordinates to world coordinates
16952 * and vice versa.
16953 */
16954export declare const transverseMercatorProjection: Projection;
16955
16956export declare class TransverseMercatorUtils {
16957 static POLE_EDGE: number;
16958 static POLE_EDGE_DEG: number;
16959 static POLE_RADIUS: number;
16960 static POLE_RADIUS_SQ: number;
16961 /**
16962 * There are two regions on projected space that have same geo coordinates,
16963 * it's the entire lines { x: [0..1], y: 0 } and { x: [0..1], y: 1 }
16964 * they both have geo coordinates of (0, [-90..+90])
16965 * and should be aligned somehow to fall into first or second region
16966 * to make proper bounding boxes, tile bounds, etc.
16967 */
16968 static alignLatitude(points: GeoCoordinatesLike[], referencePoint: GeoCoordinatesLike): void;
16969 /**
16970 * There are two regions on projected plane,
16971 * { x: 0.5, y: [0..0.25] } and { x: 0.5, y: [0.75..1] }
16972 * that represent longitude edge where -180 and +180 met.
16973 * Points falling in this regions should be aligned to get proper boxes etc.
16974 */
16975 static alignLongitude(points: GeoCoordinatesLike[], referencePoint: GeoCoordinatesLike): void;
16976}
16977
16978/**
16979 * Description of a continuous range of Unicode code points (as well as information on which fonts
16980 * supports it).
16981 */
16982declare interface UnicodeBlock {
16983 name: string;
16984 min: number;
16985 max: number;
16986 fonts: string[];
16987}
16988
16989/**
16990 * Namespace containing useful information when dealing with Unicode's code points.
16991 */
16992declare namespace UnicodeUtils {
16993 /**
16994 * Range of Unicode code points considered as white space.
16995 * https://en.wikipedia.org/wiki/Whitespace_character
16996 */
16997 const whiteSpaceRanges: number[][];
16998 /**
16999 * Checks if a character should be considered as a white space.
17000 *
17001 * @param codePoint - Character's Unicode code point.
17002 *
17003 * @returns Result of the test.
17004 */
17005 function isWhiteSpace(codePoint: number): boolean;
17006 /**
17007 * Range of Unicode code points considered as `NewLine`.
17008 * https://en.wikipedia.org/wiki/Newline#Unicode
17009 */
17010 const newLineRanges: number[][];
17011 /**
17012 * Checks if a character should be considered as a new line.
17013 *
17014 * @param codePoint - Character's Unicode code point.
17015 *
17016 * @returns Result of the test.
17017 */
17018 function isNewLine(codePoint: number): boolean;
17019 /**
17020 * Range of Unicode code points considered as non-printable.
17021 * https://en.wikipedia.org/wiki/Unicode_control_characters
17022 */
17023 const nonPrintableRanges: number[][];
17024 /**
17025 * Checks if a character's can be printed (rendered).
17026 *
17027 * @param codePoint - Character's Unicode code point.
17028 *
17029 * @returns Result of the test.
17030 */
17031 function isPrintable(codePoint: number): boolean;
17032 /**
17033 * Unicode code point direction.
17034 */
17035 enum Direction {
17036 Neutral = 0,
17037 Weak = 0.5,
17038 LTR = 1,
17039 RTL = -1
17040 }
17041 /**
17042 * Unicode Blocks which have inherent RTL direction.
17043 * These blocks correspond to the scripts described here:
17044 * https://en.wikipedia.org/wiki/Right-to-left#List_of_RTL_scripts
17045 */
17046 const rtlBlocks: string[];
17047 /**
17048 * ASCII punctuation is considered to have neutral direction:
17049 * https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters
17050 */
17051 const neutralBidirectionalRanges: number[][];
17052 /**
17053 * Latin and arabic numerals are considered to have weak directionality:
17054 * https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters
17055 * https://en.wikipedia.org/wiki/Arabic_(Unicode_block)#Block
17056 */
17057 const weakBidirectionalRanges: number[][];
17058 /**
17059 * Returns the Unicode's character direction.
17060 *
17061 * @param codePoint - Character's Unicode code point.
17062 * @param block - Character's Unicode block.
17063 *
17064 * @returns Character's direction.
17065 */
17066 function getDirection(codePoint: number, block: string): Direction;
17067 /**
17068 * Some punctuation characters (like: (, ), <, >, [,], {, }) need to be mirrored when rendering
17069 * a RTL string to preserve their intrinsic meaning.
17070 * https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters
17071 */
17072 const rtlMirroredCodePoints: number[];
17073 /**
17074 * Checks if a character should be mirrored on an RTL run.
17075 *
17076 * @param codePoint - Character's Unicode code point.
17077 *
17078 * @returns Result of the test.
17079 */
17080 function isRtlMirrored(codePoint: number): boolean;
17081}
17082
17083/**
17084 * Custom, app-specific URI resolver interface.
17085 */
17086declare interface UriResolver {
17087 /**
17088 * Attempt to resolve `URI` to `URL`.
17089 *
17090 * If given resolver doesn't know about this specific kind of `URI`, it should return string as
17091 * received.
17092 *
17093 * @param input - `URI`
17094 * @returns actual `URL` if this handler knows how locate given `uri` or original `uri`
17095 */
17096 resolveUri(uri: string): string;
17097}
17098
17099/**
17100 * Copyright provider which retrieves copyright coverage information from provided URL.
17101 */
17102export declare class UrlCopyrightProvider extends CopyrightCoverageProvider {
17103 private m_fetchURL;
17104 private m_baseScheme;
17105 private m_requestHeaders?;
17106 private m_transferManager;
17107 private m_cachedCopyrightResponse;
17108 /**
17109 * Default constructor.
17110 *
17111 * @param m_fetchURL - URL to fetch copyrights data from.
17112 * @param m_baseScheme - Scheme to get copyrights from.
17113 * @param m_requestHeaders - Optional request headers for requests(e.g. Authorization)
17114 */
17115 constructor(m_fetchURL: string, m_baseScheme: string, m_requestHeaders?: RequestHeaders_2 | undefined, m_transferManager?: ITransferManager);
17116 /**
17117 * Sets request headers.
17118 * @param headers -
17119 */
17120 setRequestHeaders(headers: RequestHeaders_2 | undefined): void;
17121 /**
17122 * @inheritdoc
17123 * @override
17124 */
17125 getCopyrightCoverageData(): Promise<AreaCopyrightInfo[]>;
17126}
17127
17128/**
17129 * Determines if a technique uses THREE.Object3D instances.
17130 * @param technique - The technique to check.
17131 * @returns true if technique uses THREE.Object3D, false otherwise.
17132 */
17133export declare function usesObject3D(technique: Technique): boolean;
17134
17135/**
17136 * The type representing the value of a property.
17137 */
17138export declare type Value = null | boolean | number | string | object;
17139
17140/**
17141 * An interface defining a collection of named properties.
17142 *
17143 * @example
17144 * ```typescript
17145 * const properties: ValueMap = {
17146 * $id: 123,
17147 * color: "rgba(255, 0, 0, 1)"
17148 * }
17149 * ```
17150 */
17151export declare interface ValueMap {
17152 [name: string]: Value;
17153}
17154
17155/**
17156 * A node representing a `get` expression.
17157 */
17158export declare class VarExpr extends Expr {
17159 readonly name: string;
17160 constructor(name: string);
17161 /** @override */
17162 accept<Result, Context>(visitor: ExprVisitor<Result, Context>, context: Context): Result;
17163 /** @override */
17164 protected exprIsDynamic(): boolean;
17165}
17166
17167/**
17168 * Interface representing a Vector3.
17169 */
17170export declare interface Vector3Like {
17171 /**
17172 * The X position.
17173 */
17174 x: number;
17175 /**
17176 * The Y position.
17177 */
17178 y: number;
17179 /**
17180 * The Z position.
17181 */
17182 z: number;
17183}
17184
17185/**
17186 * Describes vertex attribute parameters of interleaved buffer.
17187 */
17188declare interface VertexAttributeDescriptor {
17189 name: string;
17190 itemSize: number;
17191 offset: number;
17192}
17193
17194/**
17195 * Vertical alignment to be used when placing text.
17196 */
17197declare enum VerticalAlignment {
17198 Above = 0,
17199 Center = -0.5,
17200 Below = -1
17201}
17202
17203/**
17204 * Vertical position of text area relative to the placement context (point, line).
17205 */
17206declare enum VerticalPlacement {
17207 Top = 0,
17208 Center = -0.5,
17209 Bottom = -1
17210}
17211
17212/**
17213 * Structure that holds near, far planes distances and maximum visibility range.
17214 */
17215declare interface ViewRanges {
17216 /**
17217 * Distance from camera to near clipping plane along camera eye vector.
17218 * @note This value is always positive and in camera space, should be bigger then zero.
17219 */
17220 near: number;
17221 /**
17222 * Far clipping plane distance in camera space, along its eye vector.
17223 * @note Should be always positive and bigger then [[near]] plane distance.
17224 */
17225 far: number;
17226 /**
17227 * Minimum distance that may be applied to near plane.
17228 *
17229 * Reflects minimum possible near plane distance regardless of camera orientation.
17230 *
17231 * @note Such constraint is always required because near plane can not be placed at zero
17232 * distance from camera (regardless of rendering Api used). Moreover this value may be
17233 * used as input for algorighms related to frustum planes, but rather based on visibility
17234 * ranges such as it does not change during tilt. Frustum planes may change dynamically with
17235 * camera orientation changes, while this value preserve constness for certain camera
17236 * position and may be used for effects like near geometry fading.
17237 */
17238 minimum: number;
17239 /**
17240 * Maximum possible distance for far plane placement.
17241 *
17242 * This accounts for maximum visibility range in camera space, regardless of camera
17243 * orientation. Far plane will never be placed beyond that distance, this value says
17244 * about viewing distance limit, thus it is constrained for performance reasons and
17245 * allows to compute effects applied at the end of viewing range such as fog or
17246 * geometry fading.
17247 *
17248 * @note Holds the maximum distance that may be applied for [[far]] plane at
17249 * certain camera position, it is const in between orientation changes. You may use this
17250 * value to calculate fog or other depth effects that are related to frustum planes,
17251 * but should not change as dynamically as current near/far planes distances.
17252 */
17253 maximum: number;
17254}
17255
17256/**
17257 * State parameters of a view that are required by the text renderer.
17258 */
17259declare interface ViewState {
17260 worldCenter: THREE.Vector3;
17261 cameraIsMoving: boolean;
17262 maxVisibilityDist: number;
17263 zoomLevel: number;
17264 env: Env;
17265 frameNumber: number;
17266 lookAtVector: THREE.Vector3;
17267 lookAtDistance: number;
17268 isDynamic: boolean;
17269 hiddenGeometryKinds?: GeometryKindSet;
17270 renderedTilesChanged: boolean;
17271 projection: Projection;
17272 elevationProvider?: ElevationProvider;
17273}
17274
17275export declare type ViewUpdateCallback = () => void;
17276
17277/**
17278 * Manages visible {@link Tile}s for {@link MapView}.
17279 *
17280 * Responsible for election of rendered tiles:
17281 * - quad-tree traversal
17282 * - frustum culling
17283 * - sorting tiles by relevance (visible area) to prioritize load
17284 * - limiting number of visible tiles
17285 * - caching tiles
17286 * - searching cache to replace visible but yet empty tiles with already loaded siblings in nearby
17287 * zoom levels
17288 */
17289export declare class VisibleTileSet {
17290 private readonly m_frustumIntersection;
17291 private readonly m_tileGeometryManager;
17292 options: VisibleTileSetOptions;
17293 dataSourceTileList: DataSourceTileList[];
17294 allVisibleTilesLoaded: boolean;
17295 private readonly m_cameraOverride;
17296 private m_dataSourceCache;
17297 private m_viewRange;
17298 private m_coveringMap;
17299 private m_resourceComputationType;
17300 constructor(m_frustumIntersection: FrustumIntersection, m_tileGeometryManager: TileGeometryManager, options: VisibleTileSetOptions);
17301 /**
17302 * Returns cache size.
17303 */
17304 getDataSourceCacheSize(): number;
17305 /**
17306 * Sets cache size.
17307 *
17308 * @param size - cache size
17309 * @param computationType - Optional value specifying the way a {@link Tile}s cache usage is
17310 * computed, either based on size in MB (mega bytes) or in number of tiles. Defaults to
17311 * `ResourceComputationType.EstimationInMb`.
17312 */
17313 setDataSourceCacheSize(size: number, computationType?: ResourceComputationType): void;
17314 /**
17315 * Retrieves maximum number of visible tiles.
17316 */
17317 getNumberOfVisibleTiles(): number;
17318 /**
17319 * Sets maximum number of visible tiles.
17320 *
17321 * @param size - size of visible tiles array
17322 */
17323 setNumberOfVisibleTiles(size: number): void;
17324 /**
17325 * The way the cache usage is computed, either based on size in MB (mega bytes) or in number of
17326 * tiles.
17327 */
17328 get resourceComputationType(): ResourceComputationType;
17329 /**
17330 * Sets the way tile cache is managing its elements.
17331 *
17332 * Cache may be either keeping number of elements stored or the memory consumed by them.
17333 *
17334 * @param computationType - Type of algorith used in cache for checking full saturation,
17335 * may be counting number of elements or memory consumed by them.
17336 */
17337 set resourceComputationType(computationType: ResourceComputationType);
17338 /**
17339 * Evaluate frustum near/far clip planes and visibility ranges.
17340 */
17341 updateClipPlanes(maxElevation?: number, minElevation?: number): ViewRanges;
17342 /**
17343 * Calculates a new set of visible tiles.
17344 * @param storageLevel - The camera storage level, see {@link MapView.storageLevel}.
17345 * @param zoomLevel - The camera zoom level.
17346 * @param dataSources - The data sources for which the visible tiles will be calculated.
17347 * @param elevationRangeSource - Source of elevation range data if any.
17348 * @returns view ranges and their status since last update (changed or not).
17349 */
17350 updateRenderList(storageLevel: number, zoomLevel: number, dataSources: DataSource[], elevationRangeSource?: ElevationRangeSource): {
17351 viewRanges: ViewRanges;
17352 viewRangesChanged: boolean;
17353 };
17354 /**
17355 * Gets the tile corresponding to the given data source, key and offset, creating it if
17356 * necessary.
17357 *
17358 * @param dataSource - The data source the tile belongs to.
17359 * @param tileKey - The key identifying the tile.
17360 * @param offset - Tile offset.
17361 * @return The tile if it was found or created, undefined otherwise.
17362 */
17363 getTile(dataSource: DataSource, tileKey: TileKey, offset?: number): Tile | undefined;
17364 /**
17365 * Gets the tile corresponding to the given data source, key and offset from the cache.
17366 *
17367 * @param dataSource - The data source the tile belongs to.
17368 * @param tileKey - The key identifying the tile.
17369 * @param offset - Tile offset.
17370 * @return The tile if found in cache, undefined otherwise.
17371 */
17372 getCachedTile(dataSource: DataSource, tileKey: TileKey, offset?: number): Tile | undefined;
17373 /**
17374 * Gets the tile corresponding to the given data source, key and offset from the rendered tiles.
17375 *
17376 * @param dataSource - The data source the tile belongs to.
17377 * @param tileKey - The key identifying the tile.
17378 * @param offset - Tile offset.
17379 * @return The tile if found among the rendered tiles, undefined otherwise.
17380 */
17381 getRenderedTile(dataSource: DataSource, tileKey: TileKey, offset?: number): Tile | undefined;
17382 /**
17383 * Gets the tile corresponding to the given data source and location from the rendered tiles.
17384 *
17385 * @param dataSource - The data source the tile belongs to.
17386 * @param geoPoint - The geolocation included within the tile.
17387 * @return The tile if found among the rendered tiles, undefined otherwise.
17388 */
17389 getRenderedTileAtLocation(dataSource: DataSource, geoPoint: GeoCoordinates, offset?: number): Tile | undefined;
17390 /**
17391 * Removes all internal bookkeeping entries and cache related to specified datasource.
17392 *
17393 * Called by {@link MapView} when {@link DataSource} has been removed from {@link MapView}.
17394 */
17395 removeDataSource(dataSource: DataSource): void;
17396 /**
17397 * Clear the tile cache.
17398 *
17399 * Remove the {@link Tile} objects created by cacheable {@link DataSource}.
17400 * If a {@link DataSource} name is
17401 * provided, this method restricts the eviction
17402 * the {@link DataSource} with the given name.
17403 *
17404 * @param dataSourceName - The name of the {@link DataSource}.
17405 */
17406 clearTileCache(dataSource?: DataSource): void;
17407 /**
17408 * Visit each tile in visible, rendered, and cached sets.
17409 *
17410 * * Visible and temporarily rendered tiles will be marked for update and retained.
17411 * * Cached but not rendered/visible will be evicted.
17412 *
17413 * @param dataSource - If passed, only the tiles from this {@link DataSource} instance
17414 * are processed. If `undefined`, tiles from all {@link DataSource}s are processed.
17415 */
17416 markTilesDirty(dataSource?: DataSource): void;
17417 /**
17418 * Dispose tiles that are marked for removal by {@link @here/harp-lrucache#LRUCache} algorithm.
17419 */
17420 disposePendingTiles(): void;
17421 /**
17422 * Process callback function [[fun]] with each visible tile in set.
17423 *
17424 * @param fun - The callback function to be called.
17425 */
17426 forEachVisibleTile(fun: (tile: Tile) => void): void;
17427 /**
17428 * Process callback function [[fun]] with each tile in the cache.
17429 *
17430 * Optional [[dataSource]] parameter limits processing to the tiles that belongs to
17431 * DataSource passed in.
17432 *
17433 * @param fun - The callback function to be called.
17434 * @param dataSource - The optional DataSource reference for tiles selection.
17435 */
17436 forEachCachedTile(fun: (tile: Tile) => void, dataSource?: DataSource): void;
17437 /**
17438 * Dispose a `Tile` from cache, 'dispose()' is also called on the tile to free its resources.
17439 */
17440 disposeTile(tile: Tile): void;
17441 /**
17442 * Skips rendering of tiles that are overlapped. The overlapping {@link Tile} comes from a
17443 * {@link DataSource} which is fully covering, i.e. there it is fully opaque.
17444 **/
17445 private skipOverlappedTiles;
17446 private getSearchDirection;
17447 /**
17448 * Populates the list of tiles to render, see "renderedTiles". Tiles that are loaded and which
17449 * are an exact match are added straight to the list, tiles that are still loading are replaced
17450 * with tiles in the cache that are either a parent or child of the requested tile. This helps
17451 * to prevent flickering when zooming in / out. The distance to search is based on the options
17452 * [[quadTreeSearchDistanceDown]] and [[quadTreeSearchDistanceUp]].
17453 *
17454 * Each {@link DataSource} can also switch this behaviour on / off using the
17455 * [[allowOverlappingTiles]] flag.
17456 *
17457 */
17458 private populateRenderedTiles;
17459 private findDown;
17460 /**
17461 * Returns true if a tile was found in the cache which is a parent
17462 * @param tileKeyCode - Morton code of the current tile that should be searched for.
17463 * @param dataZoomLevel - The current data zoom level of tiles that are to be displayed.
17464 * @param renderedTiles - The list of tiles that are shown to the user.
17465 * @param checkedTiles - Used to map a given code to a boolean which tells us if an ancestor is
17466 * displayed or not.
17467 * @param dataSource - The provider of tiles.
17468 * @returns Whether a parent tile exists.
17469 */
17470 private findUp;
17471 private getTileImpl;
17472 private markDataSourceTilesDirty;
17473 private getVisibleTileKeysForDataSources;
17474}
17475
17476/**
17477 * Limited set of {@link MapViewOptions} used for {@link VisibleTileSet}.
17478 */
17479export declare interface VisibleTileSetOptions {
17480 /**
17481 * The projection of the view.
17482 */
17483 projection: Projection;
17484 /**
17485 * User-defined camera clipping planes evaluator.
17486 */
17487 clipPlanesEvaluator: ClipPlanesEvaluator;
17488 /**
17489 * Limit of tiles that can be visible per datasource.
17490 */
17491 maxVisibleDataSourceTiles: number;
17492 /**
17493 * In addition to the simple frustum culling also do additional checks with [[MapTileCuller]].
17494 */
17495 extendedFrustumCulling: boolean;
17496 /**
17497 * Missing Typedoc
17498 */
17499 tileCacheSize: number;
17500 /**
17501 * Missing Typedoc
17502 */
17503 resourceComputationType: ResourceComputationType;
17504 /**
17505 * Number of levels to go up when searching for fallback tiles.
17506 */
17507 quadTreeSearchDistanceUp: number;
17508 /**
17509 * Number of levels to go down when searching for fallback tiles.
17510 */
17511 quadTreeSearchDistanceDown: number;
17512}
17513
17514/**
17515 * Web Mercator {@link Projection} used to convert geo coordinates to world coordinates
17516 * and vice versa.
17517 */
17518export declare const webMercatorProjection: Projection;
17519
17520/**
17521 * A {@link TilingScheme} featuring quadtree subdivision scheme and web Mercator projection.
17522 */
17523export declare const webMercatorTilingScheme: TilingScheme;
17524
17525/**
17526 * Instances of `WebTileDataSource` can be used to add Web Tile to [[MapView]].
17527 *
17528 * Example:
17529 *
17530 * ```typescript
17531 * const webTileDataSource = new WebTileDataSource({
17532 * authenticationCode: <authenticationCode>
17533 * });
17534 * ```
17535 * @see [[DataSource]], [[OmvDataSource]].
17536 */
17537export declare class WebTileDataSource extends DataSource {
17538 private readonly m_options;
17539 /**
17540 * Base address for Base Map rendered using `normal.day` scheme.
17541 * @see https://developer.here.com/documentation/map-tile/topics/example-normal-day-view.html
17542 */
17543 static readonly TILE_BASE_NORMAL = "base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day";
17544 /**
17545 * Base address for Aerial Map rendered using `hybrid.day` scheme.
17546 * @see https://developer.here.com/documentation/map-tile/topics/example-hybrid-map.html
17547 */
17548 static readonly TILE_AERIAL_HYBRID = "aerial.maps.ls.hereapi.com/maptile/2.1/maptile/newest/hybrid.day";
17549 /**
17550 * Base address for Aerial Map rendered using `satellite.day` scheme.
17551 * @see https://developer.here.com/documentation/map-tile/topics/example-satellite-map.html
17552 */
17553 static readonly TILE_AERIAL_SATELLITE = "aerial.maps.ls.hereapi.com/maptile/2.1/maptile/newest/satellite.day";
17554 /**
17555 * Base address for Traffic Map rendered using `normal.day` scheme.
17556 * @see https://developer.here.com/documentation/map-tile/topics/example-traffic.html
17557 */
17558 static readonly TILE_TRAFFIC_NORMAL = "traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day";
17559 private m_resolution;
17560 private m_ppi;
17561 private m_tileBaseAddress;
17562 private m_languages?;
17563 /** Copyright provider instance. */
17564 private m_copyrightProvider;
17565 /** Predefined fixed HERE copyright info. */
17566 private readonly HERE_COPYRIGHT_INFO;
17567 /**
17568 * Constructs a new `WebTileDataSource`.
17569 *
17570 * @param m_options - Represents the [[WebTileDataSourceParameters]].
17571 */
17572 constructor(m_options: WebTileDataSourceParameters);
17573 /** @override */
17574 shouldPreloadTiles(): boolean;
17575 /** @override */
17576 getTilingScheme(): TilingScheme;
17577 /** @override */
17578 setLanguages(languages?: string[]): void;
17579 /** @override */
17580 getTile(tileKey: TileKey): Tile;
17581 /** @override */
17582 isFullyCovering(): boolean;
17583 private parseBaseUrl;
17584 private getAuthParams;
17585 private getCopyrightRequestParams;
17586 private getImageRequestParams;
17587 private getRequestHeaders;
17588 private getTileCopyright;
17589 private mapIsoLanguageToWebTile;
17590}
17591
17592/**
17593 * Definitions of variable values to be used with `WebTileDataSource`
17594 */
17595export declare namespace WebTileDataSource {
17596 export enum ppiValue {
17597 ppi72 = 72,
17598 ppi250 = 250,
17599 ppi320 = 320,
17600 ppi500 = 500
17601 }
17602 export enum resolutionValue {
17603 resolution256 = 256,
17604 resolution512 = 512
17605 }
17606}
17607
17608/**
17609 * Options for [[WebTileDataSource]].
17610 */
17611declare interface WebTileDataSourceOptions {
17612 /**
17613 * This parameter specifies static part of the final Web Tile URL:
17614 * * base url without protocol and load-balancing (`{1-4}.`) prefix
17615 * * path,
17616 * * resource (tile type)
17617 * * map version,
17618 * * scheme
17619 *
17620 * See [Map Tile API]
17621 * (https://developer.here.com/documentation/map-tile/topics/request-constructing.html) for
17622 * details.
17623 *
17624 * For example, given final url presented in documentation
17625 * (https://developer.here.com/documentation/map-tile/topics/examples-base.html):
17626 *
17627 * https://
17628 * 2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/11/525/761/256/png8
17629 * ?apikey={YOUR_API_KEY}
17630 *
17631 * `tileBaseAddress` should be:
17632 *
17633 * base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day
17634 *
17635 * Rest of parameters are added by [[WebTileDataSource]].
17636 *
17637 * @see [Map Tile API]
17638 * (https://developer.here.com/documentation/map-tile/topics/introduction.html)
17639 * @default [[WebTileDataSource.TILE_BASE_NORMAL]]
17640 * @see [[WebTileDataSource.TILE_BASE_NORMAL]]
17641 * @see [[WebTileDataSource.TILE_AERIAL_HYBRID]]
17642 * @see [[WebTileDataSource.TILE_AERIAL_SATELLITE]]
17643 * @see [[WebTileDataSource.TILE_TRAFFIC_NORMAL]]
17644 */
17645 tileBaseAddress?: string;
17646 /**
17647 * The resolution of Web Tile images, defaults to 512.
17648 */
17649 resolution?: WebTileDataSource.resolutionValue;
17650 /**
17651 * String which is appended to the tile request url, e.g. to add additional parameters
17652 * to the tile requests as described in
17653 * @see https://developer.here.com/documentation/map-tile/topics/resource-base-basetile.html
17654 */
17655 additionalRequestParameters?: string;
17656 /**
17657 * ppi parameter which impacts font/icon sizes, road width and other content
17658 * of the map tiles. For valid values and restrictions see
17659 * @see https://developer.here.com/documentation/map-tile/topics/resource-base-basetile.html#ppi
17660 * By default it is not used.
17661 */
17662 ppi?: WebTileDataSource.ppiValue;
17663 /**
17664 * Whether to provide copyright info.
17665 *
17666 * @default `true`
17667 */
17668 gatherCopyrightInfo?: boolean;
17669 /**
17670 * Options affecting the rendering of the web tiles.
17671 */
17672 renderingOptions?: WebTileRenderingOptions;
17673}
17674
17675/**
17676 * An interface for the type of options that can be passed to the [[WebTileDataSource]].
17677 */
17678export declare type WebTileDataSourceParameters = WebTileDataSourceOptions & (ApiKeyAuthentication | AppIdAuthentication | TokenAuthentication);
17679
17680/**
17681 * An interface for the rendering options that can be passed to the [[WebTileDataSource]].
17682 */
17683export declare interface WebTileRenderingOptions {
17684 /**
17685 * Opacity of the rendered images.
17686 * @default 1.0
17687 */
17688 opacity?: number;
17689}
17690
17691/**
17692 * Decoder based on [[ConcurrentWorkerSet]].
17693 *
17694 * Decodes tiles using workers running in separate contexts (also known as `WebWorkers`):
17695 * - connection establishment,
17696 * - sends decode requests,
17697 * - configuration.
17698 */
17699export declare class WorkerBasedDecoder implements ITileDecoder {
17700 private readonly workerSet;
17701 private readonly decoderServiceType;
17702 private serviceId;
17703 private m_serviceCreated;
17704 /**
17705 * Creates a new `WorkerBasedDecoder`.
17706 *
17707 * @param workerSet - [[ConcurrentWorkerSet]] this tiler will live in.
17708 * @param decoderServiceType - Service type identifier.
17709 */
17710 constructor(workerSet: ConcurrentWorkerSet, decoderServiceType: string);
17711 /**
17712 * Dispose of dedicated tile decoder services in workers and remove reference to underlying
17713 * [[ConcurrentWorkerSet]].
17714 */
17715 dispose(): void;
17716 /**
17717 * Connects to [[WorkerServiceManager]]s in underlying [[ConcurrentWorkerSet]] and creates
17718 * dedicated [[TileDecoderService]]s in all workers to serve decode requests.
17719 */
17720 connect(): Promise<void>;
17721 /**
17722 * Get {@link Tile} from tile decoder service in worker.
17723 *
17724 * @remarks
17725 * Invokes {@link @here/harp-datasource-protocol#DecodeTileRequest} on
17726 * [[TileDecoderService]] running in worker pool.
17727 */
17728 decodeTile(data: ArrayBufferLike, tileKey: TileKey, projection: Projection, requestController?: RequestController): Promise<DecodedTile>;
17729 /**
17730 * Get {@link @here/harp-datasource-protocol#TileInfo} from tile decoder service in worker.
17731 *
17732 * @remarks
17733 * Invokes {@link @here/harp-datasource-protocol#TileInfoRequest}
17734 * on [[TileDecoderService]] running in worker pool.
17735 */
17736 getTileInfo(data: ArrayBufferLike, tileKey: TileKey, projection: Projection, requestController?: RequestController): Promise<TileInfo | undefined>;
17737 /**
17738 * Configure tile decoder service in workers.
17739 *
17740 * @remarks
17741 * Broadcasts {@link @here/harp-datasource-protocol#ConfigurationMessage}
17742 * to all [[TileDecoderService]]s running in worker pool.
17743 *
17744 * @param styleSet - new [[StyleSet]], undefined means no change
17745 * @param languages - new list of languages
17746 * @param options - new options, undefined options are not changed
17747 */
17748 configure(styleSet?: StyleSet, definitions?: Definitions, languages?: string[], options?: OptionsMap): void;
17749 /**
17750 * The number of workers started for this decoder. The value is `undefined` until the workers
17751 * have been created.
17752 */
17753 get workerCount(): number | undefined;
17754}
17755
17756/**
17757 * Tiler based on [[ConcurrentWorkerSet]].
17758 *
17759 * Tiles payloads using workers running in separate contexts (also known as `WebWorkers`):
17760 * - connection establishment,
17761 * - sends tile requests,
17762 * - configuration.
17763 */
17764export declare class WorkerBasedTiler implements ITiler {
17765 private readonly workerSet;
17766 private readonly tilerServiceType;
17767 private serviceId;
17768 private m_serviceCreated;
17769 /**
17770 * Creates a new `WorkerBasedTiler`.
17771 *
17772 * @param workerSet - [[ConcurrentWorkerSet]] this tiler will live in.
17773 * @param tilerServiceType - Service type identifier.
17774 */
17775 constructor(workerSet: ConcurrentWorkerSet, tilerServiceType: string);
17776 /**
17777 * Dispose of dedicated tiler services in workers and remove reference to underlying
17778 * [[ConcurrentWorkerSet]].
17779 */
17780 dispose(): void;
17781 /**
17782 * Connects to [[WorkerServiceManager]]s in underlying [[ConcurrentWorkerSet]] and creates
17783 * dedicated [[TilerService]]s in all workers to serve tiling requests.
17784 */
17785 connect(): Promise<void>;
17786 /**
17787 * Register index in the tiler. Indexes registered in the tiler can be later used to retrieved
17788 * tiled payloads using `getTile`.
17789 *
17790 * @param indexId - Index identifier.
17791 * @param input - Url to the index payload, or direct GeoJSON.
17792 */
17793 registerIndex(indexId: string, input: URL | GeoJson): Promise<void>;
17794 /**
17795 * Update index in the tiler. Indexes registered in the tiler can be later used to retrieved
17796 * tiled payloads using `getTile`.
17797 *
17798 * @param indexId - Index identifier.
17799 * @param input - Url to the index payload, or direct GeoJSON.
17800 */
17801 updateIndex(indexId: string, input: URL | GeoJson): Promise<void>;
17802 /**
17803 * Retrieves a tile for a previously registered index.
17804 *
17805 * @param indexId - Index identifier.
17806 * @param tileKey - The {@link @here/harp-geoutils#TileKey} that identifies the tile.
17807 */
17808 getTile(indexId: string, tileKey: TileKey): Promise<{}>;
17809}
17810
17811/**
17812 * Communication protocol with [[ITileDecoder]].
17813 */
17814export declare namespace WorkerDecoderProtocol {
17815 /**
17816 * Define possible names of messages exchanged with decoder services within `WebWorker`.
17817 */
17818 export enum DecoderMessageName {
17819 Configuration = "configuration"
17820 }
17821 /**
17822 * Interface for `DecodedTileMessage` which describes metadata for a decoded tile.
17823 */
17824 export interface DecoderMessage {
17825 service: string;
17826 type: DecoderMessageName;
17827 }
17828 /**
17829 * Interface for a ConfigurationMessage that is sent from the datasource to the decoder. The
17830 * message used to configure the [[ITileDecoder]].
17831 */
17832 export interface ConfigurationMessage extends DecoderMessage {
17833 type: DecoderMessageName.Configuration;
17834 styleSet?: StyleSet;
17835 definitions?: Definitions;
17836 options?: OptionsMap;
17837 languages?: string[];
17838 }
17839 /**
17840 * Type guard to check if an object is an instance of `ConfigurationMessage`.
17841 */
17842 export function isConfigurationMessage(message: any): message is ConfigurationMessage;
17843 /**
17844 * Define possible names of requests called on decoder services within `WebWorker`.
17845 */
17846 export enum Requests {
17847 DecodeTileRequest = "decode-tile-request",
17848 TileInfoRequest = "tile-info-request"
17849 }
17850 /**
17851 * This object is sent to the decoder asking to decode a specific tile. The expected response
17852 * type is a [[DecodedTile]].
17853 */
17854 export interface DecodeTileRequest extends WorkerServiceProtocol.ServiceRequest {
17855 type: Requests.DecodeTileRequest;
17856 tileKey: number;
17857 data: ArrayBufferLike;
17858 projection: string;
17859 }
17860 /**
17861 * Type guard to check if an object is a decoded tile object sent to a worker.
17862 */
17863 export function isDecodeTileRequest(message: any): message is DecodeTileRequest;
17864 /**
17865 * This object is sent to the decoder asking for a tile info of a specific tile. The expected
17866 * response type is a [[DecodedTile]].
17867 */
17868 export interface TileInfoRequest extends WorkerServiceProtocol.ServiceRequest {
17869 type: Requests.TileInfoRequest;
17870 tileKey: number;
17871 data: ArrayBufferLike;
17872 projection: string;
17873 }
17874 /**
17875 * Type guard to check if an object is an info tile object sent to a worker.
17876 */
17877 export function isTileInfoRequest(message: any): message is TileInfoRequest;
17878}
17879
17880/**
17881 * Set of `Worker` loading and initialization helpers:
17882 * - starting Worker from URL with fallback to XHR+blob {@link WorkerLoader.startWorker}
17883 * - waiting for proper worker initialization, see {@link WorkerLoader.waitWorkerInitialized}
17884 */
17885export declare class WorkerLoader {
17886 static directlyFallbackToBlobBasedLoading: boolean;
17887 static sourceLoaderCache: Map<string, Promise<string>>;
17888 static dependencyUrlMapping: {
17889 [name: string]: string;
17890 };
17891 /**
17892 * Starts worker by first attempting load from `scriptUrl` using native `Worker` constructor.
17893 * Then waits (using [[waitWorkerInitialized]]) for first message that indicates successful
17894 * initialization.
17895 * If `scriptUrl`'s origin is different than `baseUrl`, then in case of error falls back to
17896 * [[startWorkerBlob]].
17897 *
17898 * We must resolve/reject promise at some time, so it is expected that any sane application will
17899 * be able to load worker code in some amount of time.
17900 * By default, this method timeouts after 10 seconds (configurable using `timeout` argument).
17901 *
17902 * This method is needed as browsers in general forbid to load worker if it's not on 'same
17903 * origin' regardless of Content-Security-Policy.
17904 *
17905 * For blob-based fallback work, one need to ensure that Content Security Policy (CSP) allows
17906 * loading web worker code from `Blob`s. By default browsers, allow 'blob:' for workers, but
17907 * this may change.
17908 *
17909 * Following snippet setups CSP, so workers can be started from blob urls:
17910 *
17911 * <head>
17912 * <meta http-equiv="Content-Security-Policy" content="child-src blob:">
17913 * </head>
17914 *
17915 * Tested on:
17916 * * Chrome 67 / Linux, Window, OSX, Android
17917 * * Firefox 60 / Linux, Windows, OSX
17918 * * Edge 41 / Windows
17919 * * Safari 11 / OSX
17920 * * Samsung Internet 7.2
17921 *
17922 * See
17923 * * https://benohead.com/cross-domain-cross-browser-web-workers/
17924 * * MapBox
17925 * * https://stackoverflow.com/questions/21913673/execute-web-worker-from-different-origin
17926 * * https://github.com/mapbox/mapbox-gl-js/issues/2658
17927 * * https://github.com/mapbox/mapbox-gl-js/issues/559
17928 * * https://github.com/mapbox/mapbox-gl-js/issues/6058
17929 *
17930 * Findings:
17931 *
17932 * * Chrome reports CSP by exception when constructing [[Worker]] instance.
17933 * * Firefox reports CSP errors when loading in first event:
17934 * https://bugzilla.mozilla.org/show_bug.cgi?id=1241888
17935 * * Firefox 62, Chrome 67 obeys `<meta http-equiv="Content-Security-Policy">` with
17936 * `worker-src blob:` but doesn't obey `worker-src URL` when used
17937 * * Chrome 67 doesn't obey CSP `worker-src URL` despite it's documented as supported
17938 * (https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src)
17939 *
17940 * @param scriptUrl - web worker script URL
17941 * @param timeout - timeout in milliseconds, in which worker should set initial message
17942 * (default 10 seconds)
17943 */
17944 static startWorker(scriptUrl: string, timeout?: number): Promise<Worker>;
17945 /**
17946 * Start worker, loading it immediately from `scriptUrl`. Waits (using
17947 * [[waitWorkerInitialized]]) for successful worker start.
17948 *
17949 * @param scriptUrl - web worker script URL
17950 */
17951 static startWorkerImmediately(scriptUrl: string, timeout: number): Promise<Worker>;
17952 /**
17953 * Start worker "via blob" by first loading worker script code with [[fetch]], creating `Blob`
17954 * and attempting to start worker from blob url. Waits (using [[waitWorkerInitialized]]) for
17955 * successful worker start.
17956 *
17957 * @param scriptUrl - web worker script URL
17958 */
17959 static startWorkerBlob(scriptUrl: string, timeout: number): Promise<Worker>;
17960 /**
17961 * Fetch script source as `Blob` url.
17962 *
17963 * Reuses results, if there are many simultaneous requests.
17964 *
17965 * @param scriptUrl - web worker script URL
17966 * @return promise that resolves to url of a `Blob` with script source code
17967 */
17968 static fetchScriptSourceToBlobUrl(scriptUrl: string): Promise<string>;
17969 /**
17970 * Waits for successful Web Worker start.
17971 *
17972 * Expects that worker script sends initial message.
17973 *
17974 * If first event is `message` then assumes that worker has been loaded sussesfully and promise
17975 * resolves to `worker` object passed as argument.
17976 *
17977 * If first event is 'error', then it is assumed that worker failed to load and promise is
17978 * rejected.
17979 *
17980 * (NOTE: The initial 'message' - if received - is immediately replayed using worker's
17981 * `dispatchEvent`, so application code can also consume it as confirmation of successful
17982 * worker initialization.
17983 *
17984 * We must resolve/reject promise at some time, so it is expected that any sane application will
17985 * be able to load worker code in some amount of time.
17986 *
17987 * @param worker - [[Worker]] instance to be checked
17988 * @param timeout - timeout in milliseconds, in which worker should set initial message
17989 * @returns `Promise` that resolves to `worker` on success
17990 */
17991 static waitWorkerInitialized(worker: Worker, timeout: number): Promise<Worker>;
17992}
17993
17994/**
17995 * Common communication protocol for [[WorkerService]].
17996 */
17997export declare namespace WorkerServiceProtocol {
17998 /**
17999 * Service id of worker manager ([[WorkerServiceManager]]) used to create/destroy service
18000 * instances in workers.
18001 */
18002 const WORKER_SERVICE_MANAGER_SERVICE_ID = "worker-service-manager";
18003 /**
18004 * Define possible names of messages exchanged with services within `WebWorker`.
18005 */
18006 export enum ServiceMessageName {
18007 Initialized = "initialized",
18008 Request = "request",
18009 Response = "response"
18010 }
18011 /**
18012 * Interface for `ServiceMessage` which describes metadata for a service messages.
18013 */
18014 export interface ServiceMessage {
18015 service: string;
18016 type: ServiceMessageName;
18017 }
18018 /**
18019 * This message is sent by the worker to the main thread. No data is sent. Receiving this
18020 * message confirms that the worker has started successfully.
18021 */
18022 export interface InitializedMessage extends ServiceMessage {
18023 type: ServiceMessageName.Initialized;
18024 }
18025 /**
18026 * Type guard to check if an object is a signal message from worker.
18027 */
18028 export function isInitializedMessage(message: any): message is InitializedMessage;
18029 /**
18030 * Define possible names of requests called on services within `WebWorker`.
18031 */
18032 export enum Requests {
18033 CreateService = "create-service",
18034 DestroyService = "destroy-service"
18035 }
18036 /**
18037 * This is an internal general interface used in communication with workers.
18038 * Check [[ConcurrentWorkerSet]]'s invokeRequest function for exemplary usage.
18039 */
18040 export interface ServiceRequest {
18041 type: string;
18042 }
18043 /**
18044 * This message is sent by the main thread to [[WorkerServiceManager]] to dynamically create a
18045 * new service.
18046 *
18047 * May throw `UnknownServiceError` if service of given type is not registered in
18048 * [[WorkerServiceManager]], see [[isUnknownServiceError]].
18049 */
18050 export interface CreateServiceRequest extends ServiceRequest {
18051 type: Requests.CreateService;
18052 /**
18053 * Type of service to be created.
18054 *
18055 * @see [[WorkerServiceManager.register]]
18056 */
18057 targetServiceType: string;
18058 /**
18059 * The newly created service instance will be available under this id.
18060 */
18061 targetServiceId: string;
18062 }
18063 /**
18064 * Test if `error` thrown by [[CreateServiceRequest]] was caused by unknown type of service.
18065 */
18066 export function isUnknownServiceError(error: Error): boolean;
18067 /**
18068 * This message is sent by the main thread to [[WorkerServiceManager]] to dynamically destroy a
18069 * service.
18070 */
18071 export interface DestroyServiceRequest extends ServiceRequest {
18072 type: Requests.DestroyService;
18073 /**
18074 * Id of service to be destroyed.
18075 */
18076 targetServiceId: string;
18077 }
18078 /**
18079 * Possible service management messages (`CreateService` or `DestroyService`) sent to WebWorker.
18080 */
18081 export type WorkerServiceManagerRequest = CreateServiceRequest | DestroyServiceRequest;
18082 /**
18083 * This message is a part of the Request-Response scheme implemented to be used in communication
18084 * between workers and the decoder.
18085 */
18086 export interface RequestMessage extends ServiceMessage {
18087 type: ServiceMessageName.Request;
18088 messageId: number;
18089 request: any;
18090 }
18091 /**
18092 * Type guard to check if an object is a request message sent to a worker.
18093 */
18094 export function isRequestMessage(message: any): message is RequestMessage;
18095 /**
18096 * This message is a part of the Request-Response scheme implemented to be used in communication
18097 * between workers and the decoder.
18098 */
18099 export interface ResponseMessage extends ServiceMessage {
18100 type: ServiceMessageName.Response;
18101 messageId: number;
18102 errorMessage?: string;
18103 errorStack?: string;
18104 response?: object;
18105 }
18106 /**
18107 * Type guard to check if an object is a request message sent to a worker.
18108 */
18109 export function isResponseMessage(message: any): message is ResponseMessage;
18110}
18111
18112/**
18113 * Communication protocol with [[ITiler]].
18114 */
18115export declare namespace WorkerTilerProtocol {
18116 /**
18117 * Define possible names of requests called on tiler services within `WebWorker`.
18118 */
18119 export enum Requests {
18120 RegisterIndex = "register-index",
18121 UpdateIndex = "update-index",
18122 TileRequest = "tile-request"
18123 }
18124 /**
18125 * This object is sent to the tiler to register a new tile index in the worker.
18126 */
18127 export interface RegisterIndexRequest extends WorkerServiceProtocol.ServiceRequest {
18128 type: Requests.RegisterIndex;
18129 id: string;
18130 input: string | GeoJson;
18131 }
18132 /**
18133 * Type guard to check if an object is an index registration request sent to a worker.
18134 */
18135 export function isRegisterIndexRequest(message: any): message is RegisterIndexRequest;
18136 /**
18137 * This object is sent to the tiler to register a new tile index in the worker.
18138 */
18139 export interface UpdateIndexRequest extends WorkerServiceProtocol.ServiceRequest {
18140 type: Requests.UpdateIndex;
18141 id: string;
18142 input: string | GeoJson;
18143 }
18144 /**
18145 * Type guard to check if an object is an update request for the index registration.
18146 */
18147 export function isUpdateIndexRequest(message: any): message is UpdateIndexRequest;
18148 /**
18149 * This object is sent to the tiler asking to retrieve a specific tile. The expected response
18150 * type is an object containing a tiled payload.
18151 */
18152 export interface TileRequest extends WorkerServiceProtocol.ServiceRequest {
18153 type: Requests.TileRequest;
18154 index: string;
18155 tileKey: number;
18156 }
18157 /**
18158 * Type guard to check if an object is a tile request sent to a worker.
18159 */
18160 export function isTileRequest(message: any): message is TileRequest;
18161}
18162
18163/**
18164 * Available texture wrapping modes.
18165 */
18166export declare type WrappingMode = "clamp" | "repeat" | "mirror";
18167
18168/**
18169 * Text wrapping rule used when `lineWidth` is reached.
18170 */
18171declare enum WrappingMode_2 {
18172 None = 0,
18173 Character = 1,
18174 Word = 2
18175}
18176
18177/**
18178 * Map zoom level to map of visible tile key entries
18179 */
18180declare type ZoomLevelTileKeyMap = Map<number, TileKeyEntries>;
18181
18182export { }
18183export as namespace harp;
18184
\No newline at end of file