@maptoolkit/maps 11.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,883 @@
1
+
2
+ /**
3
+ * Maptoolkit Maps JS v11.0.0-beta.1
4
+ * Copyright (c) 2026 Maptoolkit - Toursprung GmbH
5
+ * @license BSD-3-Clause
6
+ * https://github.com/maptoolkit/maps-js/blob/main/LICENSE
7
+ */
8
+
9
+ import maplibregl__default, { ControlPosition as ControlPosition$1, AttributionControlOptions as AttributionControlOptions$1, ScaleControlOptions, AttributionControl as AttributionControl$1, ScaleControl, Map as Map$1, StyleSpecification, MapOptions as MapOptions$1, StyleSwapOptions, StyleOptions, Evented, SourceSpecification, Listener, ProjectionSpecification, NavigationControlOptions as NavigationControlOptions$1, NavigationControl as NavigationControl$1, FitBoundsOptions, Marker, LngLatLike } from 'maplibre-gl';
10
+ export * from 'maplibre-gl';
11
+ export { BoxZoomHandler, CanvasSource, CooperativeGesturesHandler, DoubleClickZoomHandler, DragPanHandler, DragRotateHandler, EdgeInsets, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GlobeControl, ImageSource, KeyboardHandler, LngLat, LngLatBounds, MapMouseEvent, MapTouchEvent, MapWheelEvent, Marker, MercatorCoordinate, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, ScrollZoomHandler, TwoFingersTouchPitchHandler, TwoFingersTouchRotateHandler, TwoFingersTouchZoomHandler, TwoFingersTouchZoomRotateHandler, VectorTileSource, VideoSource } from 'maplibre-gl';
12
+
13
+ type LocaleSpecification = {
14
+ [_: string]: {
15
+ [_: string]: string;
16
+ };
17
+ };
18
+ /**
19
+ * Locale translations for the application.
20
+ * @maptoolkit
21
+ */
22
+ declare const locale: LocaleSpecification;
23
+
24
+ /**
25
+ * A position defintion for the control to be placed.
26
+ * When two or more controls are placed in the same location they are stacked.
27
+ * @maptoolkit
28
+ */
29
+ type ControlPosition = ControlPosition$1 | "top-center" | "bottom-center";
30
+ /**
31
+ * Interface for interactive controls added to the map. This is a
32
+ * specification for implementers to model: it is not
33
+ * an exported method or class.
34
+ *
35
+ * Controls must implement `onAdd` and `onRemove`, and must own an
36
+ * element, which is often a `div` element. To use MapLibre GL JS's
37
+ * default control styling, add the `maplibregl-ctrl` class to your control's
38
+ * node.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * class HelloWorldControl: IControl {
43
+ * onAdd(map) {
44
+ * this._map = map;
45
+ * this._container = document.createElement('div');
46
+ * this._container.className = 'maplibregl-ctrl';
47
+ * this._container.textContent = 'Hello, world';
48
+ * return this._container;
49
+ * }
50
+ *
51
+ * onRemove() {
52
+ * this._container.parentNode.removeChild(this._container);
53
+ * this._map = undefined;
54
+ * }
55
+ * }
56
+ * ```
57
+ */
58
+ interface IControl {
59
+ /**
60
+ * Register a control on the map and give it a chance to register event listeners
61
+ * and resources. This method is called by {@link Map#addControl}
62
+ * internally.
63
+ *
64
+ * @param map - the Map this control will be added to
65
+ * @returns The control's container element. This should
66
+ * be created by the control and returned by onAdd without being attached
67
+ * to the DOM: the map will insert the control's element into the DOM
68
+ * as necessary.
69
+ */
70
+ onAdd(map: Map): HTMLElement;
71
+ /**
72
+ * Unregister a control on the map and give it a chance to detach event listeners
73
+ * and resources. This method is called by {@link Map#removeControl}
74
+ * internally.
75
+ *
76
+ * @param map - the Map this control will be removed from
77
+ */
78
+ onRemove(map: Map): void;
79
+ /**
80
+ * Optionally provide a default position for this control. If this method
81
+ * is implemented and {@link Map#addControl} is called without the `position`
82
+ * parameter, the value returned by getDefaultPosition will be used as the
83
+ * control's position.
84
+ *
85
+ * @returns a control position, one of the values valid in addControl.
86
+ */
87
+ readonly getDefaultPosition?: () => ControlPosition;
88
+ }
89
+
90
+ /**
91
+ * Options for configuring the {@link AttributionControl}.
92
+ * @maptoolkit
93
+ */
94
+ type AttributionControlOptions = AttributionControlOptions$1 & {
95
+ /**
96
+ * Options for configuring the {@link ScaleControl}.
97
+ * Set to `false` to disable.
98
+ * @defaultValue `{ maxWidth: 80, unit: "metric" }` for the {@link maplibre.ScaleControlOptions}
99
+ */
100
+ scale?: false | ScaleControlOptions;
101
+ };
102
+ /**
103
+ * Presents the map's attribution information and optionally its current scale.
104
+ * @maptoolkit
105
+ */
106
+ declare class AttributionControl implements IControl {
107
+ options: AttributionControlOptions;
108
+ _map?: Map;
109
+ _container?: HTMLElement;
110
+ _attribCtrl: AttributionControl$1;
111
+ _scaleCtrl?: ScaleControl;
112
+ /**
113
+ * @param options - Options for configuring the attribution control.
114
+ */
115
+ constructor(options?: AttributionControlOptions);
116
+ getDefaultPosition(): ControlPosition;
117
+ onAdd(map: Map): HTMLElement;
118
+ onRemove(): void;
119
+ }
120
+
121
+ /**
122
+ * Options for configuring the {@link LogoControl}.
123
+ * @maptoolkit
124
+ */
125
+ type LogoControlOptions = {};
126
+ /**
127
+ * Displays the Maptoolkit watermark.
128
+ * @maptoolkit
129
+ */
130
+ declare class LogoControl implements IControl {
131
+ options: LogoControlOptions;
132
+ _map?: Map;
133
+ _container?: HTMLElement;
134
+ /**
135
+ * Creates an instance of LogoControl.
136
+ * @param options - Options for configuring the compass control.
137
+ */
138
+ constructor(options?: LogoControlOptions);
139
+ getDefaultPosition(): ControlPosition$1;
140
+ onAdd(map: Map): HTMLElement;
141
+ onRemove(): void;
142
+ }
143
+
144
+ /**
145
+ * The {@link Map} options object.
146
+ */
147
+ type MapOptions = Omit<MapOptions$1, "container" | "attributionControl"> & {
148
+ /**
149
+ * The HTML element in which the map will be rendered, or the element's string `id`. The specified element must have no children.
150
+ * Alternatively the container can be set using the {@link Map.setContainer} method after initialization.
151
+ * @maptoolkit
152
+ */
153
+ container?: HTMLElement | string;
154
+ /**
155
+ * Maptoolkit API key.
156
+ * @maptoolkit
157
+ */
158
+ apiKey?: string;
159
+ /**
160
+ * {@link AttributionControlOptions} for the map's default {@link AttributionControl}. Pass `false` to disable.
161
+ * @defaultValue See {@link AttributionControlOptions}.
162
+ * @maptoolkit
163
+ */
164
+ attributionControl?: false | AttributionControlOptions;
165
+ /**
166
+ * {@link LogoControlOptions} for the map's default {@link LogoControl}. Pass `false` to disable.
167
+ * @defaultValue See {@link LogoControlOptions}.
168
+ * @maptoolkit
169
+ */
170
+ logoControl?: false | LogoControlOptions;
171
+ /**
172
+ * A locale string that specifies the language for string translations. Currently supported locales are `en` and `de`.
173
+ * Alternatively, it can be an object mapping string IDs to translations, allowing you to override or add to the default localization table.
174
+ * @defaultValue See {@link Config}
175
+ * @maptoolkit
176
+ */
177
+ locale?: LocaleSpecification | string;
178
+ };
179
+ /**
180
+ * Extends the maplibre-gl map class with additional functionality.
181
+ */
182
+ declare class Map extends Map$1 {
183
+ _parent?: HTMLElement;
184
+ _style?: StyleSpecification;
185
+ _styleId?: string;
186
+ _apiKey?: string;
187
+ /**
188
+ * @param options - The {@link MapOptions} object.
189
+ */
190
+ constructor(options?: MapOptions);
191
+ /**
192
+ * Get active feature for given point and state.
193
+ * @private
194
+ */
195
+ private _getFeatureAtPoint;
196
+ /**
197
+ * Sets the container for the map.
198
+ * @param container - The container element or the ID of the container element.
199
+ * @returns The map instance.
200
+ * @maptoolkit
201
+ */
202
+ setContainer(container: HTMLElement | string): this;
203
+ /**
204
+ * Removes the map from its parent container.
205
+ * @returns The map instance.
206
+ * @maptoolkit
207
+ */
208
+ remove(): this;
209
+ /**
210
+ * Sets the style of the map.
211
+ * @param style - The style to set.
212
+ * @param options - Additional options for the style.
213
+ * @returns The map instance.
214
+ * @maptoolkit
215
+ */
216
+ setStyle(style: StyleSpecification | string, options?: StyleSwapOptions & StyleOptions): this;
217
+ /**
218
+ * Gets the UI string for a given key.
219
+ * @param key - The key for the UI string.
220
+ * @returns The UI string.
221
+ * @private
222
+ */
223
+ _getUIString(key: string, variables?: {
224
+ [key: string]: string;
225
+ }): string;
226
+ /**
227
+ * Adds a control to the map.
228
+ * @param control - The control to add.
229
+ * @param position - The position to add the control.
230
+ * @returns The map instance.
231
+ * @maptoolkit
232
+ */
233
+ addControl(control: IControl, position?: ControlPosition): this;
234
+ /**
235
+ * Sets up the container for the map.
236
+ * @private
237
+ */
238
+ _setupContainer(): void;
239
+ }
240
+
241
+ /**
242
+ * The `Config` class manages configuration settings for the whole library.
243
+ * It provides access to settings such as API key, locale, and host URLs for various services.
244
+ * @maptoolkit
245
+ */
246
+ declare class Config extends Evented {
247
+ /**
248
+ * @private
249
+ * The current locale.
250
+ * @type {string}
251
+ * @default "en"
252
+ */
253
+ private _locale;
254
+ /**
255
+ * Gets the current locale.
256
+ * @returns {string} The current locale.
257
+ */
258
+ get locale(): string;
259
+ /**
260
+ * Sets the locale.
261
+ * @param {string} value - The new locale to set.
262
+ * @fires config.locale.set
263
+ */
264
+ set locale(value: string);
265
+ /**
266
+ * @private
267
+ * The Maptoolkit API key.
268
+ * @type {string}
269
+ */
270
+ private _apiKey;
271
+ /**
272
+ * Gets the current Maptoolkit API key.
273
+ * @returns {string} The current API key.
274
+ * @throws {void} Logs a warning to the console if the API key is not set.
275
+ */
276
+ get apiKey(): string;
277
+ /**
278
+ * Sets the Maptoolkit API key.
279
+ * @param {string} value - The new API key to set.
280
+ * @fires config.apiKey.set
281
+ */
282
+ set apiKey(value: string);
283
+ /**
284
+ * @private
285
+ * The pixel ratio (for high DPI screens).
286
+ * @type {number}
287
+ * @default 1
288
+ */
289
+ private _pixelRatio;
290
+ /**
291
+ * Gets the current pixel ratio setting.
292
+ * @returns {number} The current pixel ratio.
293
+ */
294
+ get pixelRatio(): number;
295
+ /**
296
+ * Sets the pixel ratio setting.
297
+ * @param {number} value - The new pixel ratio to set.
298
+ * @fires config.pixelRatio.set
299
+ */
300
+ set pixelRatio(value: number);
301
+ /**
302
+ * @private
303
+ * The base URL for the Maptoolkit website.
304
+ * @type {string}
305
+ * @default "https://www.maptoolkit.net"
306
+ */
307
+ private _webHost;
308
+ /**
309
+ * Gets the base URL for the Maptoolkit website.
310
+ * @returns {string} The base web host URL.
311
+ */
312
+ get webHost(): string;
313
+ /**
314
+ * Sets the base URL for the Maptoolkit website.
315
+ * @param {string} value - The new web host URL to set.
316
+ * @fires config.webHost.set
317
+ */
318
+ set webHost(value: string);
319
+ /**
320
+ * @private
321
+ * The base URL for serving static resources.
322
+ * @type {string}
323
+ * @default "https://static.maptoolkit.net"
324
+ */
325
+ private _staticHost;
326
+ /**
327
+ * Gets the base URL for static resources.
328
+ * @returns {string} The base static host URL.
329
+ */
330
+ get staticHost(): string;
331
+ /**
332
+ * Sets the base URL for static resources.
333
+ * @param {string} value - The new static host URL to set.
334
+ * @fires config.staticHost.set
335
+ */
336
+ set staticHost(value: string);
337
+ /**
338
+ * @private
339
+ * The base URL for Maptoolkit style resources.
340
+ * @type {string}
341
+ * @default "https://styles.maptoolkit.net"
342
+ */
343
+ private _stylesHost;
344
+ /**
345
+ * Gets the base URL for Maptoolkit style resources.
346
+ * @returns {string} The base styles host URL.
347
+ */
348
+ get stylesHost(): string;
349
+ /**
350
+ * Sets the base URL for Maptoolkit style resources.
351
+ * @param {string} value - The new styles host URL to set.
352
+ * @fires config.stylesHost.set
353
+ */
354
+ set stylesHost(value: string);
355
+ /**
356
+ * @private
357
+ * The base URL for Maptoolkit icons.
358
+ * @type {string}
359
+ * @default "https://icons.maptoolkit.net"
360
+ */
361
+ private _iconsHost;
362
+ /**
363
+ * Gets the base URL for Maptoolkit icons.
364
+ * @returns {string} The base icons host URL.
365
+ */
366
+ get iconsHost(): string;
367
+ /**
368
+ * Sets the base URL for Maptoolkit icons.
369
+ * @param {string} value - The new icons host URL to set.
370
+ * @fires config.iconsHost.set
371
+ */
372
+ set iconsHost(value: string);
373
+ /**
374
+ * @private
375
+ * The base URL for the Maptoolkit data connector service.
376
+ * @type {string}
377
+ * @default "https://data.maptoolkit.net"
378
+ */
379
+ private _dataHost;
380
+ /**
381
+ * Gets the base URL for the Maptoolkit data connector service.
382
+ * @returns {string} The base data connector host URL.
383
+ */
384
+ get dataHost(): string;
385
+ /**
386
+ * Sets the base URL for the Maptoolkit data connector service.
387
+ * @param {string} value - The new data connector host URL to set.
388
+ * @fires config.dataHost.set
389
+ */
390
+ set dataHost(value: string);
391
+ /**
392
+ * @private
393
+ * The base URL for the Maptoolkit routing service.
394
+ * @type {string}
395
+ * @default "https://routing.maptoolkit.net"
396
+ */
397
+ private _routingHost;
398
+ /**
399
+ * Gets the base URL for the Maptoolkit routing service.
400
+ * @returns {string} The base routing host URL.
401
+ */
402
+ get routingHost(): string;
403
+ /**
404
+ * Sets the base URL for the Maptoolkit routing service.
405
+ * @param {string} value - The new routing host URL to set.
406
+ * @fires config.routingHost.set
407
+ */
408
+ set routingHost(value: string);
409
+ /**
410
+ * @private
411
+ * The base URL for the Maptoolkit geocoding service.
412
+ * @type {string}
413
+ * @default "https://geocoder.maptoolkit.net"
414
+ */
415
+ private _geocoderHost;
416
+ /**
417
+ * Gets the base URL for the Maptoolkit geocoding service.
418
+ * @returns {string} The base geocoding host URL.
419
+ */
420
+ get geocoderHost(): string;
421
+ /**
422
+ * Sets the base URL for the Maptoolkit geocoding service.
423
+ * @param {string} value - The new geocoding host URL to set.
424
+ * @fires config.geocoderHost.set
425
+ */
426
+ set geocoderHost(value: string);
427
+ /**
428
+ * @private
429
+ * The base URL for the Maptoolkit data connector service.
430
+ * @type {string}
431
+ * @default "https://dataconnector.maptoolkit.net"
432
+ */
433
+ private _dataconnectorHost;
434
+ /**
435
+ * Gets the base URL for the Maptoolkit data connector service.
436
+ * @returns {string} The base data connector host URL.
437
+ */
438
+ get dataconnectorHost(): string;
439
+ /**
440
+ * Sets the base URL for the Maptoolkit data connector service.
441
+ * @param {string} value - The new data connector host URL to set.
442
+ * @fires config.dataconnectorHost.set
443
+ */
444
+ set dataconnectorHost(value: string);
445
+ /**
446
+ * @private
447
+ * The base URL for the Maptoolkit data connector service.
448
+ * @type {string}
449
+ * @default "https://dataconnector.maptoolkit.net"
450
+ */
451
+ private _dataconnectorCdnHost;
452
+ /**
453
+ * Gets the base URL for the Maptoolkit data connector service.
454
+ * @returns {string} The base data connector host URL.
455
+ */
456
+ get dataconnectorCdnHost(): string;
457
+ /**
458
+ * Sets the base URL for the Maptoolkit data connector service.
459
+ * @param {string} value - The new data connector host URL to set.
460
+ * @fires config.dataconnectorHost.set
461
+ */
462
+ set dataconnectorCdnHost(value: string);
463
+ /**
464
+ * @private
465
+ * The base URL for the Maptoolkit static map service.
466
+ * @type {string}
467
+ * @default "https://staticmap.maptoolkit.net"
468
+ */
469
+ private _staticmapHost;
470
+ /**
471
+ * Gets the base URL for the Maptoolkit static map service.
472
+ * @returns {string} The base static map host URL.
473
+ */
474
+ get staticmapHost(): string;
475
+ /**
476
+ * Sets the base URL for the Maptoolkit static map service.
477
+ * @param {string} value - The new static map host URL to set.
478
+ * @fires config.staticmapHost.set
479
+ */
480
+ set staticmapHost(value: string);
481
+ /**
482
+ * @private
483
+ * The base URL for the VTC CDN service.
484
+ * @type {string}
485
+ * @default "https://vtc-cdn.maptoolkit.net"
486
+ */
487
+ private _vtcCdnHost;
488
+ /**
489
+ * Gets the base URL for the VTC CDN service.
490
+ * @returns {string} The base VTC CDN host URL.
491
+ */
492
+ get vtcCdnHost(): string;
493
+ /**
494
+ * Sets the base URL for the VTC CDN service.
495
+ * @param {string} value - The new VTC CDN host URL to set.
496
+ * @fires config.vtcCdnHost.set
497
+ */
498
+ set vtcCdnHost(value: string);
499
+ /**
500
+ * @private
501
+ * The base URL for the VTC service.
502
+ * @type {string}
503
+ * @default "https://vtc.maptoolkit.net"
504
+ */
505
+ private _vtcHost;
506
+ /**
507
+ * Gets the base URL for the VTC service.
508
+ * @returns {string} The base VTC host URL.
509
+ */
510
+ get vtcHost(): string;
511
+ /**
512
+ * Sets the base URL for the VTC service.
513
+ * @param {string} value - The new VTC host URL to set.
514
+ * @fires config.vtcHost.set
515
+ */
516
+ set vtcHost(value: string);
517
+ /**
518
+ * @private
519
+ * The base URL for the RTC CDN service.
520
+ * @type {string}
521
+ * @default "https://rtc-cdn.maptoolkit.net"
522
+ */
523
+ private _rtcCdnHost;
524
+ /**
525
+ * Gets the base URL for the RTC CDN service.
526
+ * @returns {string} The base RTC CDN host URL.
527
+ */
528
+ get rtcCdnHost(): string;
529
+ /**
530
+ * Sets the base URL for the RTC CDN service.
531
+ * @param {string} value - The new RTC CDN host URL to set.
532
+ * @fires config.rtcCdnHost.set
533
+ */
534
+ set rtcCdnHost(value: string);
535
+ }
536
+ /**
537
+ * The global configuration instance for the Maptoolkit SDK.
538
+ *
539
+ * Use this singleton to set the API key, locale, and service host URLs.
540
+ *
541
+ * @example
542
+ * ```ts
543
+ * import { config } from "@maptoolkit/maps";
544
+ * config.apiKey = "YOUR_API_KEY";
545
+ * ```
546
+ * @maptoolkit
547
+ */
548
+ declare const config: Config;
549
+
550
+ /**
551
+ * Collection of pre-defined map styles.
552
+ * @maptoolkit
553
+ */
554
+ declare const STYLES: {
555
+ TERRAIN: string;
556
+ LIGHT: string;
557
+ DARK: string;
558
+ CITY: string;
559
+ GREEN: string;
560
+ WINTER: string;
561
+ };
562
+
563
+ /**
564
+ * @module Terrain
565
+ */
566
+
567
+ /**
568
+ * Terrain source specification.
569
+ * @maptoolkit
570
+ */
571
+ declare const TERRAIN: SourceSpecification;
572
+
573
+ /**
574
+ * Options for configuring the {@link PitchControl}.
575
+ * @maptoolkit
576
+ */
577
+ type PitchControlOptions = {
578
+ /**
579
+ * The slider control's knob size in pixels.
580
+ * @defaultValue `16` pixels
581
+ */
582
+ knobSize?: number;
583
+ /**
584
+ * The slider control's vertical size in pixels.
585
+ * @defaultValue `52` pixels
586
+ */
587
+ sliderSize?: number;
588
+ /**
589
+ * If set to `true`, the control will hide when the map's pitch is 0, with a delay of 400 ms.
590
+ * @defaultValue `false`
591
+ */
592
+ autoHide?: boolean;
593
+ };
594
+ /**
595
+ * Provides an interactable slider for the map's pitch.
596
+ *
597
+ * Used by the {@link NavigationControl} class.
598
+ * @maptoolkit
599
+ */
600
+ declare class PitchControl implements IControl {
601
+ options: PitchControlOptions;
602
+ _map?: Map;
603
+ _container?: HTMLElement;
604
+ _active: boolean;
605
+ _onMouseDown?: (ev: MouseEvent | TouchEvent) => void;
606
+ _onMouseUp?: (ev: MouseEvent | TouchEvent) => void;
607
+ _onMouseMove?: (ev: MouseEvent | TouchEvent) => void;
608
+ _onPitch?: Listener;
609
+ /**
610
+ * @param options - Options for configuring the pitch control.
611
+ */
612
+ constructor(options?: PitchControlOptions);
613
+ getDefaultPosition(): ControlPosition$1;
614
+ onAdd(map: Map): HTMLElement;
615
+ onRemove(): void;
616
+ isActive(): boolean;
617
+ isHidden(): boolean;
618
+ show(): this;
619
+ hide(): this;
620
+ }
621
+
622
+ /**
623
+ * Options for configuring the {@link CompassControl}.
624
+ * @maptoolkit
625
+ */
626
+ type CompassControlOptions = {};
627
+ /**
628
+ * Provides an interactable compass for the map's bearing.
629
+ *
630
+ * Used by the {@link NavigationControl} class.
631
+ * @maptoolkit
632
+ */
633
+ declare class CompassControl implements IControl {
634
+ options: CompassControlOptions;
635
+ _map?: Map;
636
+ _container?: HTMLElement;
637
+ _onRotate?: Listener;
638
+ /**
639
+ * @param options - Options for configuring the compass control.
640
+ */
641
+ constructor(options?: CompassControlOptions);
642
+ getDefaultPosition(): ControlPosition$1;
643
+ onAdd(map: Map): HTMLElement;
644
+ onRemove(): void;
645
+ }
646
+
647
+ /**
648
+ * Options for configuring the {@link TerrainControl}.
649
+ * @maptoolkit
650
+ */
651
+ type TerrainControlOptions = {
652
+ /**
653
+ * Pitch value used on toggle.
654
+ * @defaultValue `60` degrees
655
+ */
656
+ pitch?: number;
657
+ /**
658
+ * Globe projection used on toggle.
659
+ * @defaultValue `false`
660
+ */
661
+ globe?: boolean;
662
+ };
663
+ /**
664
+ * Provides a button to toggle the map's terrain.
665
+ *
666
+ * Used by the {@link NavigationControl} class.
667
+ * @maptoolkit
668
+ */
669
+ declare class TerrainControl implements IControl {
670
+ options: TerrainControlOptions;
671
+ _map?: Map;
672
+ _container?: HTMLElement;
673
+ _active: boolean;
674
+ _enabled: boolean;
675
+ _loaded: boolean;
676
+ _projection?: ProjectionSpecification;
677
+ _onPitch?: Listener;
678
+ _onPitchEnd?: Listener;
679
+ _onStyleSet?: Listener;
680
+ /**
681
+ * @param options - Options for configuring the terrain control.
682
+ */
683
+ constructor(options?: TerrainControlOptions);
684
+ getDefaultPosition(): ControlPosition$1;
685
+ onAdd(map: Map): HTMLElement;
686
+ onRemove(): void;
687
+ _update(): void;
688
+ _terrain(enable: boolean): void;
689
+ _globe(enable: boolean): void;
690
+ enable(): this;
691
+ disable(): this;
692
+ isEnabled(): boolean;
693
+ isActive(): boolean;
694
+ isLoaded(): boolean;
695
+ }
696
+
697
+ /**
698
+ * Options for configuring the {@link NavigationControl}.
699
+ * @maptoolkit
700
+ */
701
+ type NavigationControlOptions = {
702
+ navigationControl?: NavigationControlOptions$1;
703
+ terrainControl?: false | TerrainControlOptions;
704
+ pitchControl?: false | PitchControlOptions;
705
+ compassControl?: false | CompassControlOptions;
706
+ };
707
+ /**
708
+ * Composite control combining navigation, terrain, pitch, and compass controls.
709
+ * @maptoolkit
710
+ */
711
+ declare class NavigationControl implements IControl {
712
+ options: NavigationControlOptions;
713
+ _map?: Map;
714
+ _container?: HTMLElement;
715
+ _navigationControl: NavigationControl$1;
716
+ _terrainControl?: TerrainControl;
717
+ _pitchControl?: PitchControl;
718
+ _compassControl?: CompassControl;
719
+ _onPitch?: Listener;
720
+ constructor(options?: NavigationControlOptions);
721
+ getDefaultPosition(): ControlPosition$1;
722
+ onAdd(map: Map): HTMLElement;
723
+ onRemove(): void;
724
+ }
725
+
726
+ /**
727
+ * Options for configuring the {@link StyleControl}.
728
+ * @maptoolkit
729
+ */
730
+ type StyleControlOptions = {
731
+ styles?: Array<StyleDefSpecification>;
732
+ };
733
+ /**
734
+ * A style definition for use with the {@link StyleControl}.
735
+ * @maptoolkit
736
+ */
737
+ type StyleDefSpecification = {
738
+ id: string;
739
+ value: string | StyleSpecification;
740
+ image?: string;
741
+ };
742
+ /**
743
+ * Provides a style switcher control for the map.
744
+ * @maptoolkit
745
+ */
746
+ declare class StyleControl implements IControl {
747
+ options: StyleControlOptions;
748
+ _map?: Map;
749
+ _container?: HTMLElement;
750
+ _groups?: HTMLElement;
751
+ constructor(options?: StyleControlOptions);
752
+ getDefaultPosition(): ControlPosition$1;
753
+ onAdd(map: Map): HTMLElement;
754
+ onRemove(): void;
755
+ open(): void;
756
+ close(): void;
757
+ _resize(): void;
758
+ }
759
+
760
+ /**
761
+ * The isochrone routing type.
762
+ * @maptoolkit
763
+ */
764
+ type IsochroneType = "foot" | "bike" | "car";
765
+ /**
766
+ * Options for configuring the {@link IsochroneControl}.
767
+ * @maptoolkit
768
+ */
769
+ type IsochroneControlOptions = {
770
+ /**
771
+ * Time used for isochrone calculation. Value in minutes.
772
+ * @defaultValue `10` minutes
773
+ */
774
+ range?: number;
775
+ /**
776
+ * Routing type used for isochrone request. Default value is `foot`.
777
+ * @defaultValue `10` minutes
778
+ */
779
+ type?: IsochroneType;
780
+ /**
781
+ * Whether the map bounds should fit the isochrone area. Alternatively accepts {@link FitBoundsOptions} object.
782
+ * @defaultValue `true`
783
+ */
784
+ fitBounds?: boolean | FitBoundsOptions;
785
+ };
786
+ /**
787
+ * Provides an draggable isochrone control.
788
+ *
789
+ * Used by the {@link NavigationControl} class.
790
+ * @maptoolkit
791
+ */
792
+ declare class IsochroneControl implements IControl {
793
+ options: IsochroneControlOptions;
794
+ _id: string;
795
+ _container: HTMLElement;
796
+ _tooltip: HTMLElement;
797
+ _dragging: boolean;
798
+ _onDrag: EventListener;
799
+ _onDrop: EventListener;
800
+ _onStyleChange: EventListener;
801
+ _map?: Map;
802
+ _marker?: Marker;
803
+ _abortController?: AbortController;
804
+ /**
805
+ * @param options - Options for configuring the isochrone control.
806
+ */
807
+ constructor(options?: IsochroneControlOptions);
808
+ getDefaultPosition(): ControlPosition$1;
809
+ onAdd(map: Map): HTMLElement;
810
+ addToMap(lngLat: LngLatLike): void;
811
+ removeFromMap(): void;
812
+ _addMarker(lngLat: LngLatLike): void;
813
+ _removeMarker(): void;
814
+ _addPolygon(lngLat: LngLatLike): void;
815
+ _removePolygon(): void;
816
+ onRemove(): void;
817
+ }
818
+
819
+ declare const MapMLGL: typeof maplibregl__default.Map;
820
+ declare const NavigationControlMLGL: typeof maplibregl__default.NavigationControl;
821
+ declare const AttributionControlMLGL: typeof maplibregl__default.AttributionControl;
822
+ declare const LogoControlMLGL: typeof maplibregl__default.LogoControl;
823
+ declare const TerrainControlMLGL: typeof maplibregl__default.TerrainControl;
824
+ declare const configMLGL: {
825
+ MAX_PARALLEL_IMAGE_REQUESTS: number;
826
+ MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;
827
+ MAX_TILE_CACHE_ZOOM_LEVELS: number;
828
+ REGISTERED_PROTOCOLS: {
829
+ [x: string]: maplibregl__default.AddProtocolAction;
830
+ };
831
+ WORKER_URL: string;
832
+ };
833
+ declare const Hash: typeof maplibregl__default.Hash;
834
+ declare const Style: typeof maplibregl__default.Style;
835
+ declare const Event: typeof maplibregl__default.Event;
836
+ declare const AJAXError: typeof maplibregl__default.AJAXError;
837
+ declare const createTileMesh: typeof maplibregl__default.createTileMesh;
838
+
839
+ /** The current version of the Maptoolkit Maps SDK. @maptoolkit */
840
+ declare const version: string;
841
+ /** Adds a custom load resource function that will be called when using a URL that starts with a custom url schema. */
842
+ declare const addProtocol: typeof maplibregl__default.addProtocol;
843
+ /** Removes a previously added protocol in the main thread. */
844
+ declare const removeProtocol: typeof maplibregl__default.removeProtocol;
845
+ /**
846
+ * Adds a custom source type, making it available for use with
847
+ * {@link Map.addSource}.
848
+ */
849
+ declare const addSourceType: (name: string, SourceType: maplibregl__default.SourceClass) => Promise<void>;
850
+ /**
851
+ * Initializes resources like WebWorkers that can be shared across maps to lower
852
+ * load times in some situations. `setWorkerUrl()` and `setWorkerCount()`, if
853
+ * being used, must be set before `prewarm()` is called to have an effect.
854
+ */
855
+ declare const prewarm: typeof maplibregl__default.prewarm;
856
+ /** Clears up resources that have previously been created by `prewarm()`. */
857
+ declare const clearPrewarmedResources: typeof maplibregl__default.clearPrewarmedResources;
858
+ /** Returns the package version of the library. */
859
+ declare const getVersion: typeof maplibregl__default.getVersion;
860
+ /** Gets the number of web workers instantiated on a page with GL JS maps. */
861
+ declare const getWorkerCount: typeof maplibregl__default.getWorkerCount;
862
+ /** Sets the number of web workers instantiated on a page with GL JS maps. */
863
+ declare const setWorkerCount: typeof maplibregl__default.setWorkerCount;
864
+ /** Gets the maximum number of images (raster tiles, sprites, icons) to load in parallel. 16 by default. */
865
+ declare const getMaxParallelImageRequests: typeof maplibregl__default.getMaxParallelImageRequests;
866
+ /** Sets the maximum number of images (raster tiles, sprites, icons) to load in parallel. 16 by default. */
867
+ declare const setMaxParallelImageRequests: typeof maplibregl__default.setMaxParallelImageRequests;
868
+ /** Gets the worker URL. */
869
+ declare const getWorkerUrl: typeof maplibregl__default.getWorkerUrl;
870
+ /** Sets the worker URL. */
871
+ declare const setWorkerUrl: typeof maplibregl__default.setWorkerUrl;
872
+ /**
873
+ * Sets the map's RTL text plugin. Necessary for supporting the Arabic and
874
+ * Hebrew languages, which are written right-to-left.
875
+ */
876
+ declare const setRTLTextPlugin: typeof maplibregl__default.setRTLTextPlugin;
877
+ /** Gets the map's RTL text plugin status. The status can be `unavailable`, `loading`, `loaded`, or `error`. */
878
+ declare const getRTLTextPluginStatus: typeof maplibregl__default.getRTLTextPluginStatus;
879
+ /** Imports a script in web workers. Can be used for adding protocols or registering worker sources. */
880
+ declare const importScriptInWorkers: typeof maplibregl__default.importScriptInWorkers;
881
+
882
+ export { AJAXError, AttributionControl, AttributionControlMLGL, CompassControl, Config, Event, Hash, IsochroneControl, LogoControl, LogoControlMLGL, Map, MapMLGL, NavigationControl, NavigationControlMLGL, PitchControl, STYLES, Style, StyleControl, TERRAIN, TerrainControl, TerrainControlMLGL, addProtocol, addSourceType, clearPrewarmedResources, config, configMLGL, createTileMesh, getMaxParallelImageRequests, getRTLTextPluginStatus, getVersion, getWorkerCount, getWorkerUrl, importScriptInWorkers, locale, prewarm, removeProtocol, setMaxParallelImageRequests, setRTLTextPlugin, setWorkerCount, setWorkerUrl, version };
883
+ export type { AttributionControlOptions, CompassControlOptions, ControlPosition, IControl, IsochroneControlOptions, IsochroneType, LocaleSpecification, LogoControlOptions, MapOptions, NavigationControlOptions, PitchControlOptions, StyleControlOptions, StyleDefSpecification, TerrainControlOptions };