@maptiler/sdk 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/biome.json +2 -1
- package/dist/maptiler-sdk.css +0 -1
- package/dist/maptiler-sdk.d.ts +1 -1851
- package/dist/maptiler-sdk.mjs +1748 -2683
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/MLAdapters/AttributionControl.d.ts +6 -0
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +8 -0
- package/dist/src/MLAdapters/CanvasSource.d.ts +6 -0
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +6 -0
- package/dist/src/MLAdapters/FullscreenControl.d.ts +6 -0
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +6 -0
- package/dist/src/MLAdapters/GeolocateControl.d.ts +6 -0
- package/dist/src/MLAdapters/ImageSource.d.ts +6 -0
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +6 -0
- package/dist/src/MLAdapters/LogoControl.d.ts +6 -0
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +6 -0
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +6 -0
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +6 -0
- package/dist/src/MLAdapters/Marker.d.ts +6 -0
- package/dist/src/MLAdapters/NavigationControl.d.ts +6 -0
- package/dist/src/MLAdapters/Popup.d.ts +6 -0
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +6 -0
- package/dist/src/MLAdapters/RasterTileSource.d.ts +6 -0
- package/dist/src/MLAdapters/ScaleControl.d.ts +6 -0
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +6 -0
- package/dist/src/MLAdapters/Style.d.ts +6 -0
- package/dist/src/MLAdapters/TerrainControl.d.ts +6 -0
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +6 -0
- package/dist/src/MLAdapters/VectorTileSource.d.ts +6 -0
- package/dist/src/MLAdapters/VideoSource.d.ts +6 -0
- package/dist/src/Map.d.ts +349 -0
- package/dist/src/MaptilerGeolocateControl.d.ts +21 -0
- package/dist/src/MaptilerLogoControl.d.ts +20 -0
- package/dist/src/MaptilerNavigationControl.d.ts +17 -0
- package/dist/src/MaptilerTerrainControl.d.ts +17 -0
- package/dist/src/Minimap.d.ts +58 -0
- package/dist/src/Point.d.ts +177 -0
- package/dist/src/caching.d.ts +5 -0
- package/dist/src/colorramp.d.ts +359 -0
- package/dist/src/config.d.ts +68 -0
- package/dist/src/converters/index.d.ts +1 -0
- package/dist/src/converters/xml.d.ts +54 -0
- package/dist/src/defaults.d.ts +14 -0
- package/dist/src/helpers/index.d.ts +12 -0
- package/dist/src/helpers/stylehelper.d.ts +29 -0
- package/dist/src/helpers/vectorlayerhelpers.d.ts +509 -0
- package/dist/src/index.d.ts +89 -0
- package/dist/src/language.d.ts +142 -0
- package/dist/src/mapstyle.d.ts +3 -0
- package/dist/src/tools.d.ts +46 -0
- package/dist/src/unit.d.ts +1 -0
- package/package.json +11 -19
- package/tsconfig.json +21 -8
- package/vite.config-es.ts +48 -0
- package/vite.config-umd.ts +25 -0
- package/.github/pull_request_template.md +0 -11
- package/.github/workflows/format-lint.yml +0 -21
- package/.github/workflows/npm-publish.yml +0 -22
- package/dist/maptiler-sdk.min.mjs +0 -3
- package/rollup.config.js +0 -147
package/dist/maptiler-sdk.d.ts
CHANGED
|
@@ -1,1851 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from 'maplibre-gl';
|
|
3
|
-
import { FetchFunction, ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
|
|
4
|
-
export { AutomaticStaticMapOptions, BoundedStaticMapOptions, BufferToPixelDataFunction, ByIdGeocodingOptions, CenteredStaticMapOptions, CommonForwardAndReverseGeocodingOptions, CoordinateExport, CoordinateGrid, CoordinateId, CoordinateSearch, CoordinateSearchResult, CoordinateTransformResult, CoordinateTransformation, Coordinates, CoordinatesSearchOptions, CoordinatesTransformOptions, DefaultTransformation, ElevationAtOptions, ElevationBatchOptions, FeatureHierarchy, FetchFunction, GeocodingFeature, GeocodingOptions, GeocodingSearchResult, GeolocationInfoOptions, GeolocationResult, GetDataOptions, LanguageGeocoding, LanguageGeocodingOptions, LanguageGeocodingString, MapStyle, MapStylePreset, MapStyleType, MapStyleVariant, PixelData, ReferenceMapStyle, ReverseGeocodingOptions, ServiceError, StaticMapBaseOptions, StaticMapMarker, TileJSON, XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguageGeocoding, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle } from '@maptiler/client';
|
|
5
|
-
import EventEmitter from 'events';
|
|
6
|
-
import { FeatureCollection } from 'geojson';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.
|
|
10
|
-
*/
|
|
11
|
-
declare const Language: {
|
|
12
|
-
/**
|
|
13
|
-
* The visitor language mode concatenates the prefered language from the user settings and the "default name".
|
|
14
|
-
* Note: The "default name" is equivalent to OSM's `{name}`, which can be the most recognized names a global
|
|
15
|
-
* scale or the local name.
|
|
16
|
-
* This mode is helpful in the context where a user needs to access both the local names and the names in their
|
|
17
|
-
* own language, for instance when traveling abroad, where signs likely to be only available in the local language.
|
|
18
|
-
*/
|
|
19
|
-
readonly VISITOR: "visitor";
|
|
20
|
-
/**
|
|
21
|
-
* The visitor language mode concatenates English and the "default name".
|
|
22
|
-
* Note: The "default name" is equivalent to OSM's `{name}`, which can be the most recognized names a global
|
|
23
|
-
* scale or the local name.
|
|
24
|
-
* This mode is helpful in the context where a user needs to access both the local names and the names in their
|
|
25
|
-
* own language, for instance when traveling abroad, where signs likely to be only available in the local language.
|
|
26
|
-
*/
|
|
27
|
-
readonly VISITOR_ENGLISH: "visitor_en";
|
|
28
|
-
/**
|
|
29
|
-
* Language as the style is designed. Not that this is the default state and one
|
|
30
|
-
* the language has been changed to another than `STYLE`, then it cannot be set back to `STYLE`.
|
|
31
|
-
*/
|
|
32
|
-
readonly STYLE: "style";
|
|
33
|
-
/**
|
|
34
|
-
* AUTO mode uses the language of the browser
|
|
35
|
-
*/
|
|
36
|
-
readonly AUTO: "auto";
|
|
37
|
-
/**
|
|
38
|
-
* STYLE is a custom flag to keep the language of the map as defined into the style.
|
|
39
|
-
* If STYLE is set in the constructor, then further modification of the language
|
|
40
|
-
* with `.setLanguage()` is not possible.
|
|
41
|
-
*/
|
|
42
|
-
readonly STYLE_LOCK: "style_lock";
|
|
43
|
-
/**
|
|
44
|
-
* Default fallback languages that uses latin charaters
|
|
45
|
-
*/
|
|
46
|
-
readonly LATIN: "name:latin";
|
|
47
|
-
/**
|
|
48
|
-
* Default fallback languages that uses non-latin charaters
|
|
49
|
-
*/
|
|
50
|
-
readonly NON_LATIN: "name:nonlatin";
|
|
51
|
-
/**
|
|
52
|
-
* Labels are in their local language, when available
|
|
53
|
-
*/
|
|
54
|
-
readonly LOCAL: "name";
|
|
55
|
-
/**
|
|
56
|
-
* International name
|
|
57
|
-
*/
|
|
58
|
-
readonly INTERNATIONAL: "name_int";
|
|
59
|
-
readonly ALBANIAN: "name:sq";
|
|
60
|
-
readonly AMHARIC: "name:am";
|
|
61
|
-
readonly ARABIC: "name:ar";
|
|
62
|
-
readonly ARMENIAN: "name:hy";
|
|
63
|
-
readonly AZERBAIJANI: "name:az";
|
|
64
|
-
readonly BASQUE: "name:eu";
|
|
65
|
-
readonly BELORUSSIAN: "name:be";
|
|
66
|
-
readonly BENGALI: "name:bn";
|
|
67
|
-
readonly BOSNIAN: "name:bs";
|
|
68
|
-
readonly BRETON: "name:br";
|
|
69
|
-
readonly BULGARIAN: "name:bg";
|
|
70
|
-
readonly CATALAN: "name:ca";
|
|
71
|
-
readonly CHINESE: "name:zh";
|
|
72
|
-
readonly TRADITIONAL_CHINESE: "name:zh-Hant";
|
|
73
|
-
readonly SIMPLIFIED_CHINESE: "name:zh-Hans";
|
|
74
|
-
readonly CORSICAN: "name:co";
|
|
75
|
-
readonly CROATIAN: "name:hr";
|
|
76
|
-
readonly CZECH: "name:cs";
|
|
77
|
-
readonly DANISH: "name:da";
|
|
78
|
-
readonly DUTCH: "name:nl";
|
|
79
|
-
readonly ENGLISH: "name:en";
|
|
80
|
-
readonly ESPERANTO: "name:eo";
|
|
81
|
-
readonly ESTONIAN: "name:et";
|
|
82
|
-
readonly FINNISH: "name:fi";
|
|
83
|
-
readonly FRENCH: "name:fr";
|
|
84
|
-
readonly FRISIAN: "name:fy";
|
|
85
|
-
readonly GEORGIAN: "name:ka";
|
|
86
|
-
readonly GERMAN: "name:de";
|
|
87
|
-
readonly GREEK: "name:el";
|
|
88
|
-
readonly HEBREW: "name:he";
|
|
89
|
-
readonly HINDI: "name:hi";
|
|
90
|
-
readonly HUNGARIAN: "name:hu";
|
|
91
|
-
readonly ICELANDIC: "name:is";
|
|
92
|
-
readonly INDONESIAN: "name:id";
|
|
93
|
-
readonly IRISH: "name:ga";
|
|
94
|
-
readonly ITALIAN: "name:it";
|
|
95
|
-
readonly JAPANESE: "name:ja";
|
|
96
|
-
readonly JAPANESE_HIRAGANA: "name:ja-Hira";
|
|
97
|
-
readonly JAPANESE_KANA: "name:ja_kana";
|
|
98
|
-
readonly JAPANESE_LATIN: "name:ja_rm";
|
|
99
|
-
readonly JAPANESE_2018: "name:ja-Latn";
|
|
100
|
-
readonly KANNADA: "name:kn";
|
|
101
|
-
readonly KAZAKH: "name:kk";
|
|
102
|
-
readonly KOREAN: "name:ko";
|
|
103
|
-
readonly KOREAN_LATIN: "name:ko-Latn";
|
|
104
|
-
readonly KURDISH: "name:ku";
|
|
105
|
-
readonly ROMAN_LATIN: "name:la";
|
|
106
|
-
readonly LATVIAN: "name:lv";
|
|
107
|
-
readonly LITHUANIAN: "name:lt";
|
|
108
|
-
readonly LUXEMBOURGISH: "name:lb";
|
|
109
|
-
readonly MACEDONIAN: "name:mk";
|
|
110
|
-
readonly MALAYALAM: "name:ml";
|
|
111
|
-
readonly MALTESE: "name:mt";
|
|
112
|
-
readonly NORWEGIAN: "name:no";
|
|
113
|
-
readonly OCCITAN: "name:oc";
|
|
114
|
-
readonly PERSIAN: "name:fa";
|
|
115
|
-
readonly POLISH: "name:pl";
|
|
116
|
-
readonly PORTUGUESE: "name:pt";
|
|
117
|
-
readonly PUNJABI: "name:pa";
|
|
118
|
-
readonly WESTERN_PUNJABI: "name:pnb";
|
|
119
|
-
readonly ROMANIAN: "name:ro";
|
|
120
|
-
readonly ROMANSH: "name:rm";
|
|
121
|
-
readonly RUSSIAN: "name:ru";
|
|
122
|
-
readonly SCOTTISH_GAELIC: "name:gd";
|
|
123
|
-
readonly SERBIAN_CYRILLIC: "name:sr";
|
|
124
|
-
readonly SERBIAN_LATIN: "name:sr-Latn";
|
|
125
|
-
readonly SLOVAK: "name:sk";
|
|
126
|
-
readonly SLOVENE: "name:sl";
|
|
127
|
-
readonly SPANISH: "name:es";
|
|
128
|
-
readonly SWEDISH: "name:sv";
|
|
129
|
-
readonly TAMIL: "name:ta";
|
|
130
|
-
readonly TELUGU: "name:te";
|
|
131
|
-
readonly THAI: "name:th";
|
|
132
|
-
readonly TURKISH: "name:tr";
|
|
133
|
-
readonly UKRAINIAN: "name:uk";
|
|
134
|
-
readonly URDU: "name:ur";
|
|
135
|
-
readonly VIETNAMIAN_LATIN: "name:vi";
|
|
136
|
-
readonly WELSH: "name:cy";
|
|
137
|
-
};
|
|
138
|
-
declare function isLanguageSupported(lang: string): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Type representing the key of the Language object
|
|
141
|
-
*/
|
|
142
|
-
type LanguageKey = keyof typeof Language;
|
|
143
|
-
type Values<T> = T[keyof T];
|
|
144
|
-
/**
|
|
145
|
-
* Built-in languages values as strings
|
|
146
|
-
*/
|
|
147
|
-
type LanguageString = Values<typeof Language>;
|
|
148
|
-
declare function getBrowserLanguage(): LanguageString;
|
|
149
|
-
|
|
150
|
-
type Unit = "imperial" | "metric" | "nautical";
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Configuration class for the SDK
|
|
154
|
-
*/
|
|
155
|
-
declare class SdkConfig extends EventEmitter {
|
|
156
|
-
/**
|
|
157
|
-
* The primary language. By default, the language of the web browser is used.
|
|
158
|
-
*/
|
|
159
|
-
primaryLanguage: LanguageString;
|
|
160
|
-
/**
|
|
161
|
-
* The secondary language, to overwrite the default language defined in the map style.
|
|
162
|
-
* This settings is highly dependant on the style compatibility and may not work in most cases.
|
|
163
|
-
*/
|
|
164
|
-
secondaryLanguage?: LanguageString;
|
|
165
|
-
/**
|
|
166
|
-
* Setting on whether of not the SDK runs with a session logic.
|
|
167
|
-
* A "session" is started at the initialization of the SDK and finished when the browser
|
|
168
|
-
* page is being refreshed.
|
|
169
|
-
* When `session` is enabled (default: true), the extra URL param `mtsid` is added to queries
|
|
170
|
-
* on the MapTiler Cloud API. This allows MapTiler to enable "session based billing".
|
|
171
|
-
*/
|
|
172
|
-
session: boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Enables client-side caching of requests for tiles and fonts.
|
|
175
|
-
* The cached requests persist multiple browser sessions and will be reused when possible.
|
|
176
|
-
* Works only for requests to the MapTiler Cloud API when sessions are enabled.
|
|
177
|
-
*/
|
|
178
|
-
caching: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Unit to be used
|
|
181
|
-
*/
|
|
182
|
-
private _unit;
|
|
183
|
-
/**
|
|
184
|
-
* MapTiler Cloud API key
|
|
185
|
-
*/
|
|
186
|
-
private _apiKey;
|
|
187
|
-
/**
|
|
188
|
-
* Set the unit system
|
|
189
|
-
*/
|
|
190
|
-
set unit(u: Unit);
|
|
191
|
-
/**
|
|
192
|
-
* Get the unit system
|
|
193
|
-
*/
|
|
194
|
-
get unit(): Unit;
|
|
195
|
-
/**
|
|
196
|
-
* Set the MapTiler Cloud API key
|
|
197
|
-
*/
|
|
198
|
-
set apiKey(k: string);
|
|
199
|
-
/**
|
|
200
|
-
* Get the MapTiler Cloud API key
|
|
201
|
-
*/
|
|
202
|
-
get apiKey(): string;
|
|
203
|
-
/**
|
|
204
|
-
* Set a the custom fetch function to replace the default one
|
|
205
|
-
*/
|
|
206
|
-
set fetch(f: FetchFunction);
|
|
207
|
-
/**
|
|
208
|
-
* Get the fetch fucntion
|
|
209
|
-
*/
|
|
210
|
-
get fetch(): FetchFunction | null;
|
|
211
|
-
}
|
|
212
|
-
declare const config$1: SdkConfig;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* This is an extension adds support for adding a minimap to one of the map's control containers.
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
interface ParentRect {
|
|
219
|
-
lineLayout: LineLayerSpecification["layout"];
|
|
220
|
-
linePaint: LineLayerSpecification["paint"];
|
|
221
|
-
fillPaint: FillLayerSpecification["paint"];
|
|
222
|
-
}
|
|
223
|
-
interface MinimapOptionsInput {
|
|
224
|
-
/**
|
|
225
|
-
* Style of the map. Can be:
|
|
226
|
-
* - a full style URL (possibly with API key)
|
|
227
|
-
* - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
|
|
228
|
-
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
229
|
-
*/
|
|
230
|
-
style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
|
|
231
|
-
/**
|
|
232
|
-
* Set the zoom difference between the parent and the minimap
|
|
233
|
-
* If the parent is zoomed to 10 and the minimap is zoomed to 8, the zoomAdjust should be 2
|
|
234
|
-
* Default: -4
|
|
235
|
-
*/
|
|
236
|
-
zoomAdjust?: number;
|
|
237
|
-
/** Set a zoom of the minimap and don't allow any future changes */
|
|
238
|
-
lockZoom?: number;
|
|
239
|
-
/** Adjust the pitch only if the user requests */
|
|
240
|
-
pitchAdjust?: boolean;
|
|
241
|
-
/** Set CSS properties of the container using object key-values */
|
|
242
|
-
containerStyle?: Record<string, string>;
|
|
243
|
-
/** Set the position of the minimap at either "top-left", "top-right", "bottom-left", or "bottom-right" */
|
|
244
|
-
position?: ControlPosition;
|
|
245
|
-
/** Set the parentRect fill and/or line options */
|
|
246
|
-
parentRect?: ParentRect;
|
|
247
|
-
}
|
|
248
|
-
interface MinimapOptions extends MapOptions {
|
|
249
|
-
zoomAdjust: number;
|
|
250
|
-
pitchAdjust: boolean;
|
|
251
|
-
containerStyle: Record<string, string>;
|
|
252
|
-
parentRect?: ParentRect;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
type LoadWithTerrainEvent = {
|
|
256
|
-
type: "loadWithTerrain";
|
|
257
|
-
target: Map;
|
|
258
|
-
terrain: {
|
|
259
|
-
source: string;
|
|
260
|
-
exaggeration: number;
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
declare const GeolocationType: {
|
|
264
|
-
POINT: "POINT";
|
|
265
|
-
COUNTRY: "COUNTRY";
|
|
266
|
-
};
|
|
267
|
-
/**
|
|
268
|
-
* Options to provide to the `Map` constructor
|
|
269
|
-
*/
|
|
270
|
-
type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
|
|
271
|
-
/**
|
|
272
|
-
* Style of the map. Can be:
|
|
273
|
-
* - a full style URL (possibly with API key)
|
|
274
|
-
* - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
|
|
275
|
-
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
276
|
-
*/
|
|
277
|
-
style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
|
|
278
|
-
/**
|
|
279
|
-
* Define the language of the map. This can be done directly with a language ISO code (eg. "en")
|
|
280
|
-
* or with a built-in shorthand (eg. Language.ENGLISH).
|
|
281
|
-
* Note that this is equivalent to setting the `config.primaryLanguage` and will overwrite it.
|
|
282
|
-
*/
|
|
283
|
-
language?: LanguageString;
|
|
284
|
-
/**
|
|
285
|
-
* Define the MapTiler Cloud API key to be used. This is strictly equivalent to setting
|
|
286
|
-
* `config.apiKey` and will overwrite it.
|
|
287
|
-
*/
|
|
288
|
-
apiKey?: string;
|
|
289
|
-
/**
|
|
290
|
-
* Shows or hides the MapTiler logo in the bottom left corner.
|
|
291
|
-
*
|
|
292
|
-
* For paid plans:
|
|
293
|
-
* - `true` shows MapTiler logo
|
|
294
|
-
* - `false` hodes MapTiler logo
|
|
295
|
-
* - default: `false` (hide)
|
|
296
|
-
*
|
|
297
|
-
* For free plans: MapTiler logo always shows, regardless of the value.
|
|
298
|
-
*/
|
|
299
|
-
maptilerLogo?: boolean;
|
|
300
|
-
/**
|
|
301
|
-
* Attribution text to show in an {@link AttributionControl}.
|
|
302
|
-
*/
|
|
303
|
-
customAttribution?: string | Array<string>;
|
|
304
|
-
/**
|
|
305
|
-
* Enables 3D terrain if `true`. (default: `false`)
|
|
306
|
-
*/
|
|
307
|
-
terrain?: boolean;
|
|
308
|
-
/**
|
|
309
|
-
* Exaggeration factor of the terrain. (default: `1`, no exaggeration)
|
|
310
|
-
*/
|
|
311
|
-
terrainExaggeration?: number;
|
|
312
|
-
/**
|
|
313
|
-
* Show the navigation control. (default: `true`, will hide if `false`)
|
|
314
|
-
*/
|
|
315
|
-
navigationControl?: boolean | ControlPosition;
|
|
316
|
-
/**
|
|
317
|
-
* Show the terrain control. (default: `false`, will show if `true`)
|
|
318
|
-
*/
|
|
319
|
-
terrainControl?: boolean | ControlPosition;
|
|
320
|
-
/**
|
|
321
|
-
* Show the geolocate control. (default: `true`, will hide if `false`)
|
|
322
|
-
*/
|
|
323
|
-
geolocateControl?: boolean | ControlPosition;
|
|
324
|
-
/**
|
|
325
|
-
* Show the scale control. (default: `false`, will show if `true`)
|
|
326
|
-
*/
|
|
327
|
-
scaleControl?: boolean | ControlPosition;
|
|
328
|
-
/**
|
|
329
|
-
* Show the full screen control. (default: `false`, will show if `true`)
|
|
330
|
-
*/
|
|
331
|
-
fullscreenControl?: boolean | ControlPosition;
|
|
332
|
-
/**
|
|
333
|
-
* Display a minimap in a user defined corner of the map. (default: `bottom-left` corner)
|
|
334
|
-
* If set to true, the map will assume it is a minimap and forego the attribution control.
|
|
335
|
-
*/
|
|
336
|
-
minimap?: boolean | ControlPosition | MinimapOptionsInput;
|
|
337
|
-
/**
|
|
338
|
-
* attributionControl
|
|
339
|
-
*/
|
|
340
|
-
forceNoAttributionControl?: boolean;
|
|
341
|
-
/**
|
|
342
|
-
* Method to position the map at a given geolocation. Only if:
|
|
343
|
-
* - `hash` is `false`
|
|
344
|
-
* - `center` is not provided
|
|
345
|
-
*
|
|
346
|
-
* If the value is `true` of `"POINT"` (given by `GeolocationType.POINT`) then the positionning uses the MapTiler Cloud
|
|
347
|
-
* Geolocation to find the non-GPS location point.
|
|
348
|
-
* The zoom level can be provided in the `Map` constructor with the `zoom` option or will be `13` if not provided.
|
|
349
|
-
*
|
|
350
|
-
* If the value is `"COUNTRY"` (given by `GeolocationType.COUNTRY`) then the map is centered around the bounding box of the country.
|
|
351
|
-
* In this case, the `zoom` option will be ignored.
|
|
352
|
-
*
|
|
353
|
-
* If the value is `false`, no geolocation is performed and the map centering and zooming depends on other options or on
|
|
354
|
-
* the built-in defaults.
|
|
355
|
-
*
|
|
356
|
-
* If this option is non-false and the options `center` is also provided, then `center` prevails.
|
|
357
|
-
*
|
|
358
|
-
* Default: `false`
|
|
359
|
-
*/
|
|
360
|
-
geolocate?: (typeof GeolocationType)[keyof typeof GeolocationType] | boolean;
|
|
361
|
-
};
|
|
362
|
-
/**
|
|
363
|
-
* The Map class can be instanciated to display a map in a `<div>`
|
|
364
|
-
*/
|
|
365
|
-
declare class Map extends maplibregl__default.Map {
|
|
366
|
-
private isTerrainEnabled;
|
|
367
|
-
private terrainExaggeration;
|
|
368
|
-
private primaryLanguage;
|
|
369
|
-
private terrainGrowing;
|
|
370
|
-
private terrainFlattening;
|
|
371
|
-
private minimap?;
|
|
372
|
-
private forceLanguageUpdate;
|
|
373
|
-
private languageAlwaysBeenStyle;
|
|
374
|
-
private isReady;
|
|
375
|
-
constructor(options: MapOptions);
|
|
376
|
-
/**
|
|
377
|
-
* Awaits for _this_ Map instance to be "loaded" and returns a Promise to the Map.
|
|
378
|
-
* If _this_ Map instance is already loaded, the Promise is resolved directly,
|
|
379
|
-
* otherwise, it is resolved as a result of the "load" event.
|
|
380
|
-
* @returns
|
|
381
|
-
*/
|
|
382
|
-
onLoadAsync(): Promise<Map>;
|
|
383
|
-
/**
|
|
384
|
-
* Awaits for _this_ Map instance to be "ready" and returns a Promise to the Map.
|
|
385
|
-
* If _this_ Map instance is already ready, the Promise is resolved directly,
|
|
386
|
-
* otherwise, it is resolved as a result of the "ready" event.
|
|
387
|
-
* A map instance is "ready" when all the controls that can be managed by the contructor are
|
|
388
|
-
* dealt with. This happens after the "load" event, due to the asynchronous nature
|
|
389
|
-
* of some built-in controls.
|
|
390
|
-
*/
|
|
391
|
-
onReadyAsync(): Promise<Map>;
|
|
392
|
-
/**
|
|
393
|
-
* Awaits for _this_ Map instance to be "loaded" as well as with terrain being non-null for the first time
|
|
394
|
-
* and returns a Promise to the Map.
|
|
395
|
-
* If _this_ Map instance is already loaded with terrain, the Promise is resolved directly,
|
|
396
|
-
* otherwise, it is resolved as a result of the "loadWithTerrain" event.
|
|
397
|
-
* @returns
|
|
398
|
-
*/
|
|
399
|
-
onLoadWithTerrainAsync(): Promise<Map>;
|
|
400
|
-
/**
|
|
401
|
-
* Update the style of the map.
|
|
402
|
-
* Can be:
|
|
403
|
-
* - a full style URL (possibly with API key)
|
|
404
|
-
* - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
|
|
405
|
-
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
406
|
-
*/
|
|
407
|
-
setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | string, options?: StyleSwapOptions & StyleOptions): this;
|
|
408
|
-
/**
|
|
409
|
-
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
|
|
410
|
-
* to the map's style.
|
|
411
|
-
*
|
|
412
|
-
* A layer defines how data from a specified source will be styled. Read more about layer types
|
|
413
|
-
* and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
|
|
414
|
-
*
|
|
415
|
-
* @param layer - The layer to add,
|
|
416
|
-
* conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,
|
|
417
|
-
* less commonly, the {@link CustomLayerInterface} specification.
|
|
418
|
-
* The MapLibre Style Specification's layer definition is appropriate for most layers.
|
|
419
|
-
*
|
|
420
|
-
* @param beforeId - The ID of an existing layer to insert the new layer before,
|
|
421
|
-
* resulting in the new layer appearing visually beneath the existing layer.
|
|
422
|
-
* If this argument is not specified, the layer will be appended to the end of the layers array
|
|
423
|
-
* and appear visually above all other layers.
|
|
424
|
-
*
|
|
425
|
-
* @returns `this`
|
|
426
|
-
*/
|
|
427
|
-
addLayer(layer: (LayerSpecification & {
|
|
428
|
-
source?: string | SourceSpecification;
|
|
429
|
-
}) | CustomLayerInterface, beforeId?: string): this;
|
|
430
|
-
/**
|
|
431
|
-
* Moves a layer to a different z-position.
|
|
432
|
-
*
|
|
433
|
-
* @param id - The ID of the layer to move.
|
|
434
|
-
* @param beforeId - The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.
|
|
435
|
-
* @returns `this`
|
|
436
|
-
*
|
|
437
|
-
* @example
|
|
438
|
-
* Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.
|
|
439
|
-
* ```ts
|
|
440
|
-
* map.moveLayer('polygon', 'country-label');
|
|
441
|
-
* ```
|
|
442
|
-
*/
|
|
443
|
-
moveLayer(id: string, beforeId?: string): this;
|
|
444
|
-
/**
|
|
445
|
-
* Removes the layer with the given ID from the map's style.
|
|
446
|
-
*
|
|
447
|
-
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
448
|
-
*
|
|
449
|
-
* @param id - The ID of the layer to remove
|
|
450
|
-
* @returns `this`
|
|
451
|
-
*
|
|
452
|
-
* @example
|
|
453
|
-
* If a layer with ID 'state-data' exists, remove it.
|
|
454
|
-
* ```ts
|
|
455
|
-
* if (map.getLayer('state-data')) map.removeLayer('state-data');
|
|
456
|
-
* ```
|
|
457
|
-
*/
|
|
458
|
-
removeLayer(id: string): this;
|
|
459
|
-
/**
|
|
460
|
-
* Sets the zoom extent for the specified style layer. The zoom extent includes the
|
|
461
|
-
* [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)
|
|
462
|
-
* and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))
|
|
463
|
-
* at which the layer will be rendered.
|
|
464
|
-
*
|
|
465
|
-
* Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
|
|
466
|
-
* minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum
|
|
467
|
-
* zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style
|
|
468
|
-
* layer will not be rendered at all zoom levels in the zoom range.
|
|
469
|
-
*/
|
|
470
|
-
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
|
|
471
|
-
/**
|
|
472
|
-
* Sets the filter for the specified style layer.
|
|
473
|
-
*
|
|
474
|
-
* Filters control which features a style layer renders from its source.
|
|
475
|
-
* Any feature for which the filter expression evaluates to `true` will be
|
|
476
|
-
* rendered on the map. Those that are false will be hidden.
|
|
477
|
-
*
|
|
478
|
-
* Use `setFilter` to show a subset of your source data.
|
|
479
|
-
*
|
|
480
|
-
* To clear the filter, pass `null` or `undefined` as the second parameter.
|
|
481
|
-
*/
|
|
482
|
-
setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
|
|
483
|
-
/**
|
|
484
|
-
* Sets the value of a paint property in the specified style layer.
|
|
485
|
-
*
|
|
486
|
-
* @param layerId - The ID of the layer to set the paint property in.
|
|
487
|
-
* @param name - The name of the paint property to set.
|
|
488
|
-
* @param value - The value of the paint property to set.
|
|
489
|
-
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
490
|
-
* @param options - Options object.
|
|
491
|
-
* @returns `this`
|
|
492
|
-
* @example
|
|
493
|
-
* ```ts
|
|
494
|
-
* map.setPaintProperty('my-layer', 'fill-color', '#faafee');
|
|
495
|
-
* ```
|
|
496
|
-
*/
|
|
497
|
-
setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
|
|
498
|
-
/**
|
|
499
|
-
* Sets the value of a layout property in the specified style layer.
|
|
500
|
-
* Layout properties define how the layer is styled.
|
|
501
|
-
* Layout properties for layers of the same type are documented together.
|
|
502
|
-
* Layers of different types have different layout properties.
|
|
503
|
-
* See the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/) for the complete list of layout properties.
|
|
504
|
-
* @param layerId - The ID of the layer to set the layout property in.
|
|
505
|
-
* @param name - The name of the layout property to set.
|
|
506
|
-
* @param value - The value of the layout property to set.
|
|
507
|
-
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
508
|
-
* @param options - Options object.
|
|
509
|
-
* @returns `this`
|
|
510
|
-
*/
|
|
511
|
-
setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
|
|
512
|
-
/**
|
|
513
|
-
* Sets the value of the style's glyphs property.
|
|
514
|
-
*
|
|
515
|
-
* @param glyphsUrl - Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
|
|
516
|
-
* @param options - Options object.
|
|
517
|
-
* @returns `this`
|
|
518
|
-
* @example
|
|
519
|
-
* ```ts
|
|
520
|
-
* map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
|
|
521
|
-
* ```
|
|
522
|
-
*/
|
|
523
|
-
setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this;
|
|
524
|
-
private getStyleLanguage;
|
|
525
|
-
/**
|
|
526
|
-
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
527
|
-
*/
|
|
528
|
-
setLanguage(language: LanguageString | string): void;
|
|
529
|
-
/**
|
|
530
|
-
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
531
|
-
*/
|
|
532
|
-
private setPrimaryLanguage;
|
|
533
|
-
/**
|
|
534
|
-
* Get the primary language
|
|
535
|
-
* @returns
|
|
536
|
-
*/
|
|
537
|
-
getPrimaryLanguage(): LanguageString;
|
|
538
|
-
/**
|
|
539
|
-
* Get the exaggeration factor applied to the terrain
|
|
540
|
-
* @returns
|
|
541
|
-
*/
|
|
542
|
-
getTerrainExaggeration(): number;
|
|
543
|
-
/**
|
|
544
|
-
* Know if terrian is enabled or not
|
|
545
|
-
* @returns
|
|
546
|
-
*/
|
|
547
|
-
hasTerrain(): boolean;
|
|
548
|
-
private growTerrain;
|
|
549
|
-
/**
|
|
550
|
-
* Enables the 3D terrain visualization
|
|
551
|
-
*/
|
|
552
|
-
enableTerrain(exaggeration?: number): void;
|
|
553
|
-
/**
|
|
554
|
-
* Disable the 3D terrain visualization
|
|
555
|
-
*/
|
|
556
|
-
disableTerrain(): void;
|
|
557
|
-
/**
|
|
558
|
-
* Sets the 3D terrain exageration factor.
|
|
559
|
-
* If the terrain was not enabled prior to the call of this method,
|
|
560
|
-
* the method `.enableTerrain()` will be called.
|
|
561
|
-
* If `animate` is `true`, the terrain transformation will be animated in the span of 1 second.
|
|
562
|
-
* If `animate` is `false`, no animated transition to the newly defined exaggeration.
|
|
563
|
-
*/
|
|
564
|
-
setTerrainExaggeration(exaggeration: number, animate?: boolean): void;
|
|
565
|
-
/**
|
|
566
|
-
* Perform an action when the style is ready. It could be at the moment of calling this method
|
|
567
|
-
* or later.
|
|
568
|
-
*/
|
|
569
|
-
private onStyleReady;
|
|
570
|
-
fitToIpBounds(): Promise<void>;
|
|
571
|
-
centerOnIpPoint(zoom: number | undefined): Promise<void>;
|
|
572
|
-
getCameraHash(): string;
|
|
573
|
-
/**
|
|
574
|
-
* Get the SDK config object.
|
|
575
|
-
* This is convenient to dispatch the SDK configuration to externally built layers
|
|
576
|
-
* that do not directly have access to the SDK configuration but do have access to a Map instance.
|
|
577
|
-
*/
|
|
578
|
-
getSdkConfig(): SdkConfig;
|
|
579
|
-
/**
|
|
580
|
-
* Get the MapTiler session ID. Convenient to dispatch to externaly built component
|
|
581
|
-
* that do not directly have access to the SDK configuration but do have access to a Map instance.
|
|
582
|
-
* @returns
|
|
583
|
-
*/
|
|
584
|
-
getMaptilerSessionId(): string;
|
|
585
|
-
/**
|
|
586
|
-
* Updates the requestManager's transform request with a new function.
|
|
587
|
-
*
|
|
588
|
-
* @param transformRequest A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.
|
|
589
|
-
* Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
|
|
590
|
-
*
|
|
591
|
-
* @returns {Map} `this`
|
|
592
|
-
*
|
|
593
|
-
* @example
|
|
594
|
-
* map.setTransformRequest((url: string, resourceType: string) => {});
|
|
595
|
-
*/
|
|
596
|
-
setTransformRequest(transformRequest: RequestTransformFunction): this;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* This is an extension of MapLibre Marker to make it fully type compatible with the SDK
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
|
-
declare class Marker extends maplibregl__default.Marker {
|
|
604
|
-
addTo(map: Map | Map$1): this;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* This is an extension of MapLibre Popup to make it fully type compatible with the SDK
|
|
609
|
-
*/
|
|
610
|
-
|
|
611
|
-
declare class Popup extends maplibregl__default.Popup {
|
|
612
|
-
addTo(map: Map | Map$1): this;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* This is an extension of MapLibre Style to make it fully type compatible with the SDK
|
|
617
|
-
*/
|
|
618
|
-
|
|
619
|
-
declare class Style extends maplibregl__default.Style {
|
|
620
|
-
constructor(map: Map, options?: StyleOptions);
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* This is an extension of MapLibre CanvasSource to make it fully type compatible with the SDK
|
|
625
|
-
*/
|
|
626
|
-
|
|
627
|
-
declare class CanvasSource extends maplibregl__default.CanvasSource {
|
|
628
|
-
onAdd(map: Map | Map$1): void;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* This is an extension of MapLibre GeoJSONSource to make it fully type compatible with the SDK
|
|
633
|
-
*/
|
|
634
|
-
|
|
635
|
-
declare class GeoJSONSource extends maplibregl__default.GeoJSONSource {
|
|
636
|
-
onAdd(map: Map | Map$1): void;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* This is an extension of MapLibre ImageSource to make it fully type compatible with the SDK
|
|
641
|
-
*/
|
|
642
|
-
|
|
643
|
-
declare class ImageSource extends maplibregl__default.ImageSource {
|
|
644
|
-
onAdd(map: Map | Map$1): void;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* This is an extension of MapLibre RasterTileSource to make it fully type compatible with the SDK
|
|
649
|
-
*/
|
|
650
|
-
|
|
651
|
-
declare class RasterTileSource extends maplibregl__default.RasterTileSource {
|
|
652
|
-
onAdd(map: Map | Map$1): void;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* This is an extension of MapLibre RasterDEMTileSource to make it fully type compatible with the SDK
|
|
657
|
-
*/
|
|
658
|
-
|
|
659
|
-
declare class RasterDEMTileSource extends maplibregl__default.RasterDEMTileSource {
|
|
660
|
-
onAdd(map: Map | Map$1): void;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* This is an extension of MapLibre VectorTileSource to make it fully type compatible with the SDK
|
|
665
|
-
*/
|
|
666
|
-
|
|
667
|
-
declare class VectorTileSource extends maplibregl__default.VectorTileSource {
|
|
668
|
-
onAdd(map: Map | Map$1): void;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* This is an extension of MapLibre VideoSource to make it fully type compatible with the SDK
|
|
673
|
-
*/
|
|
674
|
-
|
|
675
|
-
declare class VideoSource extends maplibregl__default.VideoSource {
|
|
676
|
-
onAdd(map: Map | Map$1): void;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* This is an extension of MapLibre NavigationControl to make it fully type compatible with the SDK
|
|
681
|
-
*/
|
|
682
|
-
|
|
683
|
-
declare class NavigationControl extends maplibregl__default.NavigationControl {
|
|
684
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* This is an extension of MapLibre GeolocateControl to make it fully type compatible with the SDK
|
|
689
|
-
*/
|
|
690
|
-
|
|
691
|
-
declare class GeolocateControl extends maplibregl__default.GeolocateControl {
|
|
692
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* This is an extension of MapLibre AttributionControl to make it fully type compatible with the SDK
|
|
697
|
-
*/
|
|
698
|
-
|
|
699
|
-
declare class AttributionControl extends maplibregl__default.AttributionControl {
|
|
700
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* This is an extension of MapLibre LogoControl to make it fully type compatible with the SDK
|
|
705
|
-
*/
|
|
706
|
-
|
|
707
|
-
declare class LogoControl extends maplibregl__default.LogoControl {
|
|
708
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* This is an extension of MapLibre ScaleControl to make it fully type compatible with the SDK
|
|
713
|
-
*/
|
|
714
|
-
|
|
715
|
-
declare class ScaleControl extends maplibregl__default.ScaleControl {
|
|
716
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
/**
|
|
720
|
-
* This is an extension of MapLibre FullscreenControl to make it fully type compatible with the SDK
|
|
721
|
-
*/
|
|
722
|
-
|
|
723
|
-
declare class FullscreenControl extends maplibregl__default.FullscreenControl {
|
|
724
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
/**
|
|
728
|
-
* This is an extension of MapLibre TerrainControl to make it fully type compatible with the SDK
|
|
729
|
-
*/
|
|
730
|
-
|
|
731
|
-
declare class TerrainControl extends maplibregl__default.TerrainControl {
|
|
732
|
-
onAdd(map: Map | Map$1): HTMLElement;
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
737
|
-
*/
|
|
738
|
-
|
|
739
|
-
declare class BoxZoomHandler extends maplibregl__default.BoxZoomHandler {
|
|
740
|
-
constructor(map: Map | Map$1, options: {
|
|
741
|
-
clickTolerance: number;
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
747
|
-
*/
|
|
748
|
-
|
|
749
|
-
declare class ScrollZoomHandler extends maplibregl__default.ScrollZoomHandler {
|
|
750
|
-
constructor(map: Map | Map$1, triggerRenderFrame: () => void);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
755
|
-
*/
|
|
756
|
-
|
|
757
|
-
declare class CooperativeGesturesHandler extends maplibregl__default.CooperativeGesturesHandler {
|
|
758
|
-
constructor(map: Map | Map$1, options: GestureOptions);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
763
|
-
*/
|
|
764
|
-
|
|
765
|
-
declare class KeyboardHandler extends maplibregl__default.KeyboardHandler {
|
|
766
|
-
constructor(map: Map | Map$1);
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
771
|
-
*/
|
|
772
|
-
|
|
773
|
-
declare class TwoFingersTouchPitchHandler extends maplibregl__default.TwoFingersTouchPitchHandler {
|
|
774
|
-
constructor(map: Map | Map$1);
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
779
|
-
*/
|
|
780
|
-
|
|
781
|
-
declare class MapWheelEvent extends maplibregl__default.MapWheelEvent {
|
|
782
|
-
constructor(type: string, map: Map | Map$1, originalEvent: WheelEvent);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
787
|
-
*/
|
|
788
|
-
|
|
789
|
-
declare class MapTouchEvent extends maplibregl__default.MapTouchEvent {
|
|
790
|
-
constructor(type: string, map: Map | Map$1, originalEvent: TouchEvent);
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* This is an extension of MapLibre BoxZoomHandler to make it fully type compatible with the SDK
|
|
795
|
-
*/
|
|
796
|
-
|
|
797
|
-
declare class MapMouseEvent extends maplibregl__default.MapMouseEvent {
|
|
798
|
-
constructor(type: string, map: Map | Map$1, originalEvent: MouseEvent, data?: any);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
/**
|
|
802
|
-
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
|
|
803
|
-
* with a few changes. In this version, the active mode persists as long as the
|
|
804
|
-
* location is still centered. This means it's robust to rotation, pitch and zoom.
|
|
805
|
-
*
|
|
806
|
-
*/
|
|
807
|
-
declare class MaptilerGeolocateControl extends GeolocateControl {
|
|
808
|
-
private lastUpdatedCenter;
|
|
809
|
-
/**
|
|
810
|
-
* Update the camera location to center on the current position
|
|
811
|
-
*
|
|
812
|
-
* @param {Position} position the Geolocation API Position
|
|
813
|
-
* @private
|
|
814
|
-
*/
|
|
815
|
-
_updateCamera: (position: GeolocationPosition) => void;
|
|
816
|
-
_setupUI: (supported: boolean) => void;
|
|
817
|
-
_updateCircleRadius(): void;
|
|
818
|
-
_onZoom: () => void;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
type LogoControlOptions = LogoControlOptions$1 & {
|
|
822
|
-
logoURL?: string;
|
|
823
|
-
linkURL?: string;
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* This LogoControl extends the MapLibre LogoControl but instead can use any image URL and
|
|
827
|
-
* any link URL. By default this is using MapTiler logo and URL.
|
|
828
|
-
*/
|
|
829
|
-
declare class MaptilerLogoControl extends LogoControl {
|
|
830
|
-
_compact: boolean;
|
|
831
|
-
private logoURL;
|
|
832
|
-
private linkURL;
|
|
833
|
-
constructor(options?: LogoControlOptions);
|
|
834
|
-
onAdd(map: Map): HTMLElement;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
/**
|
|
838
|
-
* A `MaptilerTerrainControl` control adds a button to turn terrain on and off
|
|
839
|
-
* by triggering the terrain logic that is already deployed in the Map object.
|
|
840
|
-
*/
|
|
841
|
-
declare class MaptilerTerrainControl implements IControl {
|
|
842
|
-
_map: Map;
|
|
843
|
-
_container: HTMLElement;
|
|
844
|
-
_terrainButton: HTMLButtonElement;
|
|
845
|
-
constructor();
|
|
846
|
-
onAdd(map: Map): HTMLElement;
|
|
847
|
-
onRemove(): void;
|
|
848
|
-
_toggleTerrain(): void;
|
|
849
|
-
_updateTerrainIcon(): void;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
type HTMLButtonElementPlus = HTMLButtonElement & {
|
|
853
|
-
clickFunction: (e?: Event) => unknown;
|
|
854
|
-
};
|
|
855
|
-
declare class MaptilerNavigationControl extends NavigationControl {
|
|
856
|
-
constructor();
|
|
857
|
-
/**
|
|
858
|
-
* Overloading: the button now stores its click callback so that we can later on delete it and replace it
|
|
859
|
-
*/
|
|
860
|
-
_createButton(className: string, fn: (e?: Event) => unknown): HTMLButtonElementPlus;
|
|
861
|
-
/**
|
|
862
|
-
* Overloading: Limit how flat the compass icon can get
|
|
863
|
-
*/
|
|
864
|
-
_rotateCompassArrow: () => void;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
interface Link {
|
|
868
|
-
href: string | null;
|
|
869
|
-
}
|
|
870
|
-
interface XMLProperties {
|
|
871
|
-
links?: Link[];
|
|
872
|
-
}
|
|
873
|
-
interface PlacemarkProperties {
|
|
874
|
-
name?: string;
|
|
875
|
-
address?: string;
|
|
876
|
-
styleUrl?: string;
|
|
877
|
-
description?: string;
|
|
878
|
-
styleHash?: string;
|
|
879
|
-
styleMapHash?: Record<string, string | null>;
|
|
880
|
-
timespan?: {
|
|
881
|
-
begin: string;
|
|
882
|
-
end: string;
|
|
883
|
-
};
|
|
884
|
-
timestamp?: string;
|
|
885
|
-
stroke?: string;
|
|
886
|
-
"stroke-opacity"?: number;
|
|
887
|
-
"stroke-width"?: number;
|
|
888
|
-
fill?: string;
|
|
889
|
-
"fill-opacity"?: number;
|
|
890
|
-
visibility?: string;
|
|
891
|
-
icon?: string;
|
|
892
|
-
coordTimes?: (string | null)[] | (string | null)[][];
|
|
893
|
-
}
|
|
894
|
-
/**
|
|
895
|
-
* create a function that converts a string to XML
|
|
896
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
|
|
897
|
-
*/
|
|
898
|
-
declare function str2xml(str: string): Document;
|
|
899
|
-
/**
|
|
900
|
-
* Check one of the top level child node is of a given type ("gpx", "kml").
|
|
901
|
-
* The check is not case sensitive.
|
|
902
|
-
* @param doc
|
|
903
|
-
* @param nodeName
|
|
904
|
-
* @returns
|
|
905
|
-
*/
|
|
906
|
-
declare function hasChildNodeWithName(doc: Document, nodeName: string): boolean;
|
|
907
|
-
/**
|
|
908
|
-
* create a function that converts a XML to a string
|
|
909
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer
|
|
910
|
-
*/
|
|
911
|
-
declare function xml2str(node: Node): string;
|
|
912
|
-
/**
|
|
913
|
-
* Given a XML document using the GPX spec, return GeoJSON
|
|
914
|
-
*/
|
|
915
|
-
declare function gpx(doc: string | Document): GeoJSON.FeatureCollection;
|
|
916
|
-
/**
|
|
917
|
-
* Given a XML document using the KML spec, return GeoJSON
|
|
918
|
-
*/
|
|
919
|
-
declare function kml(doc: string | Document, xml2string?: (node: Node) => string): GeoJSON.FeatureCollection;
|
|
920
|
-
declare function gpxOrKml(doc: string | Document): GeoJSON.FeatureCollection | null;
|
|
921
|
-
|
|
922
|
-
type RgbaColor = [number, number, number] | [number, number, number, number];
|
|
923
|
-
type ColorStop = {
|
|
924
|
-
/**
|
|
925
|
-
* The "value" at which this ColorStop should be applied.
|
|
926
|
-
*/
|
|
927
|
-
value: number;
|
|
928
|
-
/**
|
|
929
|
-
* RGB[A] - Array of 3-4 numbers. 0-255 per channel.
|
|
930
|
-
*/
|
|
931
|
-
color: RgbaColor;
|
|
932
|
-
};
|
|
933
|
-
/**
|
|
934
|
-
* A RGBA color as per the array definition
|
|
935
|
-
*/
|
|
936
|
-
type ArrayColor = [number, number, number, number];
|
|
937
|
-
/**
|
|
938
|
-
* A color ramp stop as per array definition
|
|
939
|
-
*/
|
|
940
|
-
type ArrayColorRampStop = [
|
|
941
|
-
/**
|
|
942
|
-
* Real world value in a real world unit
|
|
943
|
-
*/
|
|
944
|
-
number,
|
|
945
|
-
/**
|
|
946
|
-
* Color RGBA
|
|
947
|
-
*/
|
|
948
|
-
ArrayColor
|
|
949
|
-
];
|
|
950
|
-
/**
|
|
951
|
-
* A color ramp as per array definition
|
|
952
|
-
*/
|
|
953
|
-
type ArrayColorRamp = Array<ArrayColorRampStop>;
|
|
954
|
-
type ColorRampOptions = {
|
|
955
|
-
/**
|
|
956
|
-
* The value the colorramp starts
|
|
957
|
-
*/
|
|
958
|
-
min?: number;
|
|
959
|
-
/**
|
|
960
|
-
* The value the colorramp ends
|
|
961
|
-
*/
|
|
962
|
-
max?: number;
|
|
963
|
-
/**
|
|
964
|
-
* Some color stops to copy from
|
|
965
|
-
*/
|
|
966
|
-
stops?: Array<ColorStop>;
|
|
967
|
-
};
|
|
968
|
-
declare class ColorRamp extends Array<ColorStop> {
|
|
969
|
-
/**
|
|
970
|
-
* Converts a array-definition color ramp definition into a usable ColorRamp instance.
|
|
971
|
-
* Note: units are not converted and may need to to be converted beforehand (eg. kelvin to centigrade)
|
|
972
|
-
* @param cr
|
|
973
|
-
* @returns
|
|
974
|
-
*/
|
|
975
|
-
static fromArrayDefinition(cr: ArrayColorRamp): ColorRamp;
|
|
976
|
-
private min;
|
|
977
|
-
private max;
|
|
978
|
-
constructor(options?: ColorRampOptions);
|
|
979
|
-
setStops(stops: Array<ColorStop>, options?: {
|
|
980
|
-
clone?: boolean;
|
|
981
|
-
}): ColorRamp;
|
|
982
|
-
scale(min: number, max: number, options?: {
|
|
983
|
-
clone?: boolean;
|
|
984
|
-
}): ColorRamp;
|
|
985
|
-
at(pos: number): ColorStop;
|
|
986
|
-
clone(): ColorRamp;
|
|
987
|
-
getRawColorStops(): Array<ColorStop>;
|
|
988
|
-
reverse(options?: {
|
|
989
|
-
clone?: boolean;
|
|
990
|
-
}): ColorRamp;
|
|
991
|
-
getBounds(): {
|
|
992
|
-
min: number;
|
|
993
|
-
max: number;
|
|
994
|
-
};
|
|
995
|
-
getColor(value: number, options?: {
|
|
996
|
-
smooth?: boolean;
|
|
997
|
-
}): RgbaColor;
|
|
998
|
-
/**
|
|
999
|
-
* Get the color as an hexadecimal string
|
|
1000
|
-
*/
|
|
1001
|
-
getColorHex(value: number, options?: {
|
|
1002
|
-
smooth?: boolean;
|
|
1003
|
-
withAlpha?: boolean;
|
|
1004
|
-
}): string;
|
|
1005
|
-
/**
|
|
1006
|
-
* Get the color of the color ramp at a relative position in [0, 1]
|
|
1007
|
-
*/
|
|
1008
|
-
getColorRelative(value: number, options?: {
|
|
1009
|
-
smooth?: boolean;
|
|
1010
|
-
}): RgbaColor;
|
|
1011
|
-
getCanvasStrip(options?: {
|
|
1012
|
-
horizontal?: boolean;
|
|
1013
|
-
size?: number;
|
|
1014
|
-
smooth?: boolean;
|
|
1015
|
-
}): HTMLCanvasElement;
|
|
1016
|
-
/**
|
|
1017
|
-
* Apply a non-linear ressampling. This will create a new instance of ColorRamp with the same bounds.
|
|
1018
|
-
*/
|
|
1019
|
-
resample(method: "ease-in-square" | "ease-out-square" | "ease-in-sqrt" | "ease-out-sqrt" | "ease-in-exp" | "ease-out-exp", samples?: number): ColorRamp;
|
|
1020
|
-
/**
|
|
1021
|
-
* Makes a clone of this color ramp that is fully transparant at the begining of their range
|
|
1022
|
-
*/
|
|
1023
|
-
transparentStart(): ColorRamp;
|
|
1024
|
-
/**
|
|
1025
|
-
* Check if this color ramp has a transparent start
|
|
1026
|
-
*/
|
|
1027
|
-
hasTransparentStart(): boolean;
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* This is a collection of built-in color ramps. They are all defined in the range [0, 1]
|
|
1031
|
-
* but can be scaled or reversed to fit specific usages.
|
|
1032
|
-
*/
|
|
1033
|
-
declare const ColorRampCollection: {
|
|
1034
|
-
/**
|
|
1035
|
-
* A fully transparent [0, 0, 0, 0] colorramp to hide data.
|
|
1036
|
-
* Defined in interval [0, 1], without unit.
|
|
1037
|
-
*/
|
|
1038
|
-
NULL: ColorRamp;
|
|
1039
|
-
GRAY: ColorRamp;
|
|
1040
|
-
/**
|
|
1041
|
-
* Classic jet color ramp.
|
|
1042
|
-
* Defined in interval [0, 1], without unit.
|
|
1043
|
-
*/
|
|
1044
|
-
JET: ColorRamp;
|
|
1045
|
-
/**
|
|
1046
|
-
* Classic HSV color ramp (hue, saturation, value).
|
|
1047
|
-
* Defined in interval [0, 1], without unit.
|
|
1048
|
-
*/
|
|
1049
|
-
HSV: ColorRamp;
|
|
1050
|
-
/**
|
|
1051
|
-
* Classic hot color ramp.
|
|
1052
|
-
* Defined in interval [0, 1], without unit.
|
|
1053
|
-
*/
|
|
1054
|
-
HOT: ColorRamp;
|
|
1055
|
-
/**
|
|
1056
|
-
* Classic spring color ramp.
|
|
1057
|
-
* Defined in interval [0, 1], without unit.
|
|
1058
|
-
*/
|
|
1059
|
-
SPRING: ColorRamp;
|
|
1060
|
-
/**
|
|
1061
|
-
* Classic summer color ramp.
|
|
1062
|
-
* Defined in interval [0, 1], without unit.
|
|
1063
|
-
*/
|
|
1064
|
-
SUMMER: ColorRamp;
|
|
1065
|
-
/**
|
|
1066
|
-
* Classic autommn color ramp.
|
|
1067
|
-
* Defined in interval [0, 1], without unit.
|
|
1068
|
-
*/
|
|
1069
|
-
AUTOMN: ColorRamp;
|
|
1070
|
-
/**
|
|
1071
|
-
* Classic winter color ramp.
|
|
1072
|
-
* Defined in interval [0, 1], without unit.
|
|
1073
|
-
*/
|
|
1074
|
-
WINTER: ColorRamp;
|
|
1075
|
-
/**
|
|
1076
|
-
* Classic bone color ramp.
|
|
1077
|
-
* Defined in interval [0, 1], without unit.
|
|
1078
|
-
*/
|
|
1079
|
-
BONE: ColorRamp;
|
|
1080
|
-
/**
|
|
1081
|
-
* Classic copper color ramp.
|
|
1082
|
-
* Defined in interval [0, 1], without unit.
|
|
1083
|
-
*/
|
|
1084
|
-
COPPER: ColorRamp;
|
|
1085
|
-
/**
|
|
1086
|
-
* Classic greys color ramp.
|
|
1087
|
-
* Defined in interval [0, 1], without unit.
|
|
1088
|
-
*/
|
|
1089
|
-
GREYS: ColorRamp;
|
|
1090
|
-
/**
|
|
1091
|
-
* Classic yignbu color ramp (blue to light yellow).
|
|
1092
|
-
* Defined in interval [0, 1], without unit.
|
|
1093
|
-
*/
|
|
1094
|
-
YIGNBU: ColorRamp;
|
|
1095
|
-
/**
|
|
1096
|
-
* Classic greens color ramp.
|
|
1097
|
-
* Defined in interval [0, 1], without unit.
|
|
1098
|
-
*/
|
|
1099
|
-
GREENS: ColorRamp;
|
|
1100
|
-
/**
|
|
1101
|
-
* Classic yiorrd color ramp (red to light yellow).
|
|
1102
|
-
* Defined in interval [0, 1], without unit.
|
|
1103
|
-
*/
|
|
1104
|
-
YIORRD: ColorRamp;
|
|
1105
|
-
/**
|
|
1106
|
-
* Classic blue-red color ramp.
|
|
1107
|
-
* Defined in interval [0, 1], without unit.
|
|
1108
|
-
*/
|
|
1109
|
-
BLUERED: ColorRamp;
|
|
1110
|
-
/**
|
|
1111
|
-
* Classic rdbu color ramp.
|
|
1112
|
-
* Defined in interval [0, 1], without unit.
|
|
1113
|
-
*/
|
|
1114
|
-
RDBU: ColorRamp;
|
|
1115
|
-
/**
|
|
1116
|
-
* Classic picnic color ramp.
|
|
1117
|
-
* Defined in interval [0, 1], without unit.
|
|
1118
|
-
*/
|
|
1119
|
-
PICNIC: ColorRamp;
|
|
1120
|
-
/**
|
|
1121
|
-
* Classic rainbow color ramp.
|
|
1122
|
-
* Defined in interval [0, 1], without unit.
|
|
1123
|
-
*/
|
|
1124
|
-
RAINBOW: ColorRamp;
|
|
1125
|
-
/**
|
|
1126
|
-
* Classic Portland color ramp.
|
|
1127
|
-
* Defined in interval [0, 1], without unit.
|
|
1128
|
-
*/
|
|
1129
|
-
PORTLAND: ColorRamp;
|
|
1130
|
-
/**
|
|
1131
|
-
* Classic blackbody color ramp.
|
|
1132
|
-
* Defined in interval [0, 1], without unit.
|
|
1133
|
-
*/
|
|
1134
|
-
BLACKBODY: ColorRamp;
|
|
1135
|
-
/**
|
|
1136
|
-
* Classic earth color ramp.
|
|
1137
|
-
* Defined in interval [0, 1], without unit.
|
|
1138
|
-
*/
|
|
1139
|
-
EARTH: ColorRamp;
|
|
1140
|
-
/**
|
|
1141
|
-
* Classic electric color ramp.
|
|
1142
|
-
* Defined in interval [0, 1], without unit.
|
|
1143
|
-
*/
|
|
1144
|
-
ELECTRIC: ColorRamp;
|
|
1145
|
-
/**
|
|
1146
|
-
* Classic viridis color ramp.
|
|
1147
|
-
* Defined in interval [0, 1], without unit.
|
|
1148
|
-
*/
|
|
1149
|
-
VIRIDIS: ColorRamp;
|
|
1150
|
-
/**
|
|
1151
|
-
* Classic inferno color ramp.
|
|
1152
|
-
* Defined in interval [0, 1], without unit.
|
|
1153
|
-
*/
|
|
1154
|
-
INFERNO: ColorRamp;
|
|
1155
|
-
/**
|
|
1156
|
-
* Classic magma color ramp.
|
|
1157
|
-
* Defined in interval [0, 1], without unit.
|
|
1158
|
-
*/
|
|
1159
|
-
MAGMA: ColorRamp;
|
|
1160
|
-
/**
|
|
1161
|
-
* Classic plasma color ramp.
|
|
1162
|
-
* Defined in interval [0, 1], without unit.
|
|
1163
|
-
*/
|
|
1164
|
-
PLASMA: ColorRamp;
|
|
1165
|
-
/**
|
|
1166
|
-
* Classic warm color ramp.
|
|
1167
|
-
* Defined in interval [0, 1], without unit.
|
|
1168
|
-
*/
|
|
1169
|
-
WARM: ColorRamp;
|
|
1170
|
-
/**
|
|
1171
|
-
* Classic cool color ramp.
|
|
1172
|
-
* Defined in interval [0, 1], without unit.
|
|
1173
|
-
*/
|
|
1174
|
-
COOL: ColorRamp;
|
|
1175
|
-
/**
|
|
1176
|
-
* Classic rainboz soft color ramp.
|
|
1177
|
-
* Defined in interval [0, 1], without unit.
|
|
1178
|
-
*/
|
|
1179
|
-
RAINBOW_SOFT: ColorRamp;
|
|
1180
|
-
/**
|
|
1181
|
-
* Classic bathymetry color ramp.
|
|
1182
|
-
* Defined in interval [0, 1], without unit.
|
|
1183
|
-
*/
|
|
1184
|
-
BATHYMETRY: ColorRamp;
|
|
1185
|
-
/**
|
|
1186
|
-
* Classic cdom color ramp.
|
|
1187
|
-
* Defined in interval [0, 1], without unit.
|
|
1188
|
-
*/
|
|
1189
|
-
CDOM: ColorRamp;
|
|
1190
|
-
/**
|
|
1191
|
-
* Classic chlorophyll color ramp.
|
|
1192
|
-
* Defined in interval [0, 1], without unit.
|
|
1193
|
-
*/
|
|
1194
|
-
CHLOROPHYLL: ColorRamp;
|
|
1195
|
-
/**
|
|
1196
|
-
* Classic density color ramp.
|
|
1197
|
-
* Defined in interval [0, 1], without unit.
|
|
1198
|
-
*/
|
|
1199
|
-
DENSITY: ColorRamp;
|
|
1200
|
-
/**
|
|
1201
|
-
* Classic freesurface blue color ramp.
|
|
1202
|
-
* Defined in interval [0, 1], without unit.
|
|
1203
|
-
*/
|
|
1204
|
-
FREESURFACE_BLUE: ColorRamp;
|
|
1205
|
-
/**
|
|
1206
|
-
* Classic freesurface red color ramp.
|
|
1207
|
-
* Defined in interval [0, 1], without unit.
|
|
1208
|
-
*/
|
|
1209
|
-
FREESURFACE_RED: ColorRamp;
|
|
1210
|
-
/**
|
|
1211
|
-
* Classic oxygen color ramp.
|
|
1212
|
-
* Defined in interval [0, 1], without unit.
|
|
1213
|
-
*/
|
|
1214
|
-
OXYGEN: ColorRamp;
|
|
1215
|
-
/**
|
|
1216
|
-
* Classic par color ramp.
|
|
1217
|
-
* Defined in interval [0, 1], without unit.
|
|
1218
|
-
*/
|
|
1219
|
-
PAR: ColorRamp;
|
|
1220
|
-
/**
|
|
1221
|
-
* Classic phase color ramp.
|
|
1222
|
-
* Defined in interval [0, 1], without unit.
|
|
1223
|
-
*/
|
|
1224
|
-
PHASE: ColorRamp;
|
|
1225
|
-
/**
|
|
1226
|
-
* Classic salinity color ramp.
|
|
1227
|
-
* Defined in interval [0, 1], without unit.
|
|
1228
|
-
*/
|
|
1229
|
-
SALINITY: ColorRamp;
|
|
1230
|
-
/**
|
|
1231
|
-
* Classic temperature color ramp.
|
|
1232
|
-
* Defined in interval [0, 1], without unit.
|
|
1233
|
-
*/
|
|
1234
|
-
TEMPERATURE: ColorRamp;
|
|
1235
|
-
/**
|
|
1236
|
-
* Classic turbidity color ramp.
|
|
1237
|
-
* Defined in interval [0, 1], without unit.
|
|
1238
|
-
*/
|
|
1239
|
-
TURBIDITY: ColorRamp;
|
|
1240
|
-
/**
|
|
1241
|
-
* Classic velocity blue color ramp.
|
|
1242
|
-
* Defined in interval [0, 1], without unit.
|
|
1243
|
-
*/
|
|
1244
|
-
VELOCITY_BLUE: ColorRamp;
|
|
1245
|
-
/**
|
|
1246
|
-
* Classic velocity green color ramp.
|
|
1247
|
-
* Defined in interval [0, 1], without unit.
|
|
1248
|
-
*/
|
|
1249
|
-
VELOCITY_GREEN: ColorRamp;
|
|
1250
|
-
/**
|
|
1251
|
-
* Classic cube helix color ramp.
|
|
1252
|
-
* Defined in interval [0, 1], without unit.
|
|
1253
|
-
*/
|
|
1254
|
-
CUBEHELIX: ColorRamp;
|
|
1255
|
-
/**
|
|
1256
|
-
* The cividis color ramp is color blind friendly.
|
|
1257
|
-
* Read more here https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0199239
|
|
1258
|
-
* Defined in interval [0, 1], without unit.
|
|
1259
|
-
*/
|
|
1260
|
-
CIVIDIS: ColorRamp;
|
|
1261
|
-
/**
|
|
1262
|
-
* Classic turbo color ramp.
|
|
1263
|
-
* This is a luminance-constant alternative to the jet, making it more
|
|
1264
|
-
* clor-blind friendly.
|
|
1265
|
-
* Defined in interval [0, 1], without unit.
|
|
1266
|
-
*/
|
|
1267
|
-
TURBO: ColorRamp;
|
|
1268
|
-
/**
|
|
1269
|
-
* The rocket color ramp is perceptually uniform, which makes it more
|
|
1270
|
-
* color bliend friendly than the classic magma color ramp.
|
|
1271
|
-
* Defined in interval [0, 1], without unit.
|
|
1272
|
-
*/
|
|
1273
|
-
ROCKET: ColorRamp;
|
|
1274
|
-
/**
|
|
1275
|
-
* The mako color ramp is perceptually uniform and can be seen as
|
|
1276
|
-
* a color blind friendly alternative to bathymetry or yignbu.
|
|
1277
|
-
* Defined in interval [0, 1], without unit.
|
|
1278
|
-
*/
|
|
1279
|
-
MAKO: ColorRamp;
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
/**
|
|
1283
|
-
* Array of string values that depend on zoom level
|
|
1284
|
-
*/
|
|
1285
|
-
type ZoomStringValues = Array<{
|
|
1286
|
-
/**
|
|
1287
|
-
* Zoom level
|
|
1288
|
-
*/
|
|
1289
|
-
zoom: number;
|
|
1290
|
-
/**
|
|
1291
|
-
* Value for the given zoom level
|
|
1292
|
-
*/
|
|
1293
|
-
value: string;
|
|
1294
|
-
}>;
|
|
1295
|
-
/**
|
|
1296
|
-
*
|
|
1297
|
-
* Array of number values that depend on zoom level
|
|
1298
|
-
*/
|
|
1299
|
-
type ZoomNumberValues = Array<{
|
|
1300
|
-
/**
|
|
1301
|
-
* Zoom level
|
|
1302
|
-
*/
|
|
1303
|
-
zoom: number;
|
|
1304
|
-
/**
|
|
1305
|
-
* Value for the given zoom level
|
|
1306
|
-
*/
|
|
1307
|
-
value: number;
|
|
1308
|
-
}>;
|
|
1309
|
-
type PropertyValues = Array<{
|
|
1310
|
-
/**
|
|
1311
|
-
* Value of the property (input)
|
|
1312
|
-
*/
|
|
1313
|
-
propertyValue: number;
|
|
1314
|
-
/**
|
|
1315
|
-
* Value to associate it with (output)
|
|
1316
|
-
*/
|
|
1317
|
-
value: number;
|
|
1318
|
-
}>;
|
|
1319
|
-
type CommonShapeLayerOptions = {
|
|
1320
|
-
/**
|
|
1321
|
-
* ID to give to the layer.
|
|
1322
|
-
* If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated,
|
|
1323
|
-
* with "xxxxxx" being a random string.
|
|
1324
|
-
*/
|
|
1325
|
-
layerId?: string;
|
|
1326
|
-
/**
|
|
1327
|
-
* ID to give to the geojson source.
|
|
1328
|
-
* If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated,
|
|
1329
|
-
* with "xxxxxx" being a random string.
|
|
1330
|
-
*/
|
|
1331
|
-
sourceId?: string;
|
|
1332
|
-
/**
|
|
1333
|
-
* A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.
|
|
1334
|
-
*/
|
|
1335
|
-
data: FeatureCollection | string;
|
|
1336
|
-
/**
|
|
1337
|
-
* The ID of an existing layer to insert the new layer before, resulting in the new layer appearing
|
|
1338
|
-
* visually beneath the existing layer. If this argument is not specified, the layer will be appended
|
|
1339
|
-
* to the end of the layers array and appear visually above all other layers.
|
|
1340
|
-
*/
|
|
1341
|
-
beforeId?: string;
|
|
1342
|
-
/**
|
|
1343
|
-
* Zoom level at which it starts to show.
|
|
1344
|
-
* Default: `0`
|
|
1345
|
-
*/
|
|
1346
|
-
minzoom?: number;
|
|
1347
|
-
/**
|
|
1348
|
-
* Zoom level after which it no longer show.
|
|
1349
|
-
* Default: `22`
|
|
1350
|
-
*/
|
|
1351
|
-
maxzoom?: number;
|
|
1352
|
-
/**
|
|
1353
|
-
* Whether or not to add an outline.
|
|
1354
|
-
* Default: `false`
|
|
1355
|
-
*/
|
|
1356
|
-
outline?: boolean;
|
|
1357
|
-
/**
|
|
1358
|
-
* Color of the outline. This is can be a constant color string or a definition based on zoom levels.
|
|
1359
|
-
* Applies only if `.outline` is `true`.
|
|
1360
|
-
* Default: `white`
|
|
1361
|
-
*/
|
|
1362
|
-
outlineColor?: string | ZoomStringValues;
|
|
1363
|
-
/**
|
|
1364
|
-
* Width of the outline (relative to screen-space). This is can be a constant width or a definition based on zoom levels.
|
|
1365
|
-
* Applies only if `.outline` is `true`.
|
|
1366
|
-
* Default: `1`
|
|
1367
|
-
*/
|
|
1368
|
-
outlineWidth?: number | ZoomNumberValues;
|
|
1369
|
-
/**
|
|
1370
|
-
* Opacity of the outline. This is can be a constant opacity in [0, 1] or a definition based on zoom levels
|
|
1371
|
-
* Applies only if `.outline` is `true`.
|
|
1372
|
-
* Default: `1`
|
|
1373
|
-
*/
|
|
1374
|
-
outlineOpacity?: number | ZoomNumberValues;
|
|
1375
|
-
};
|
|
1376
|
-
type PolylineLayerOptions = CommonShapeLayerOptions & {
|
|
1377
|
-
/**
|
|
1378
|
-
* Color of the line (or polyline). This is can be a constant color string or a definition based on zoom levels.
|
|
1379
|
-
* Default: a color randomly pick from a list
|
|
1380
|
-
*/
|
|
1381
|
-
lineColor?: string | ZoomStringValues;
|
|
1382
|
-
/**
|
|
1383
|
-
* Width of the line (relative to screen-space). This is can be a constant width or a definition based on zoom levels
|
|
1384
|
-
* Default: `3`
|
|
1385
|
-
*/
|
|
1386
|
-
lineWidth?: number | ZoomNumberValues;
|
|
1387
|
-
/**
|
|
1388
|
-
* Opacity of the line. This is can be a constant opacity in [0, 1] or a definition based on zoom levels.
|
|
1389
|
-
* Default: `1`
|
|
1390
|
-
*/
|
|
1391
|
-
lineOpacity?: number | ZoomNumberValues;
|
|
1392
|
-
/**
|
|
1393
|
-
* How blury the line is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
1394
|
-
* Default: `0`
|
|
1395
|
-
*/
|
|
1396
|
-
lineBlur?: number | ZoomNumberValues;
|
|
1397
|
-
/**
|
|
1398
|
-
* Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
|
|
1399
|
-
* Default: `0`
|
|
1400
|
-
*/
|
|
1401
|
-
lineGapWidth?: number | ZoomNumberValues;
|
|
1402
|
-
/**
|
|
1403
|
-
* Sequence of line and void to create a dash pattern. The unit is the line width so that
|
|
1404
|
-
* a dash array value of `[3, 1]` will create a segment worth 3 times the width of the line,
|
|
1405
|
-
* followed by a spacing worth 1 time the line width, and then repeat.
|
|
1406
|
-
*
|
|
1407
|
-
* Alternatively, this property can be a string made of underscore and whitespace characters
|
|
1408
|
-
* such as `"___ _ "` and internaly this will be translated into [3, 1, 1, 1]. Note that
|
|
1409
|
-
* this way of describing dash arrays with a string only works for integer values.
|
|
1410
|
-
*
|
|
1411
|
-
* Dash arrays can contain more than 2 element to create more complex patters. For instance
|
|
1412
|
-
* a dash array value of [3, 2, 1, 2] will create the following sequence:
|
|
1413
|
-
* - a segment worth 3 times the width
|
|
1414
|
-
* - a spacing worth 2 times the width
|
|
1415
|
-
* - a segment worth 1 times the width
|
|
1416
|
-
* - a spacing worth 2 times the width
|
|
1417
|
-
* - repeat
|
|
1418
|
-
*
|
|
1419
|
-
* Default: no dash pattern
|
|
1420
|
-
*/
|
|
1421
|
-
lineDashArray?: Array<number> | string;
|
|
1422
|
-
/**
|
|
1423
|
-
* The display of line endings for both the line and the outline (if `.outline` is `true`)
|
|
1424
|
-
* - "butt": A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
1425
|
-
* - "round": A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
1426
|
-
* - "square": A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
1427
|
-
* Default: "round"
|
|
1428
|
-
*/
|
|
1429
|
-
lineCap?: "butt" | "round" | "square";
|
|
1430
|
-
/**
|
|
1431
|
-
* The display of lines when joining for both the line and the outline (if `.outline` is `true`)
|
|
1432
|
-
* - "bevel": A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
1433
|
-
* - "round": A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
1434
|
-
* - "miter": A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
1435
|
-
* Default: "round"
|
|
1436
|
-
*/
|
|
1437
|
-
lineJoin?: "bevel" | "round" | "miter";
|
|
1438
|
-
/**
|
|
1439
|
-
* How blury the outline is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
1440
|
-
* Applies only if `.outline` is `true`.
|
|
1441
|
-
* Default: `0`
|
|
1442
|
-
*/
|
|
1443
|
-
outlineBlur?: number | ZoomNumberValues;
|
|
1444
|
-
};
|
|
1445
|
-
type PolygonLayerOptions = CommonShapeLayerOptions & {
|
|
1446
|
-
/**
|
|
1447
|
-
* Color of the polygon. This is can be a constant color string or a definition based on zoom levels.
|
|
1448
|
-
* Default: a color randomly pick from a list
|
|
1449
|
-
*/
|
|
1450
|
-
fillColor?: string | ZoomStringValues;
|
|
1451
|
-
/**
|
|
1452
|
-
* Opacity of the polygon. This is can be a constant opacity in [0, 1] or a definition based on zoom levels
|
|
1453
|
-
* Default: `1`
|
|
1454
|
-
*/
|
|
1455
|
-
fillOpacity?: ZoomNumberValues;
|
|
1456
|
-
/**
|
|
1457
|
-
* Position of the outline with regard to the polygon edge (when `.outline` is `true`)
|
|
1458
|
-
* Default: `"center"`
|
|
1459
|
-
*/
|
|
1460
|
-
outlinePosition: "center" | "inside" | "outside";
|
|
1461
|
-
/**
|
|
1462
|
-
* Sequence of line and void to create a dash pattern. The unit is the line width so that
|
|
1463
|
-
* a dash array value of `[3, 1]` will create a segment worth 3 times the width of the line,
|
|
1464
|
-
* followed by a spacing worth 1 time the line width, and then repeat.
|
|
1465
|
-
*
|
|
1466
|
-
* Alternatively, this property can be a string made of underscore and whitespace characters
|
|
1467
|
-
* such as `"___ _ "` and internaly this will be translated into [3, 1, 1, 1]. Note that
|
|
1468
|
-
* this way of describing dash arrays with a string only works for integer values.
|
|
1469
|
-
*
|
|
1470
|
-
* Dash arrays can contain more than 2 element to create more complex patters. For instance
|
|
1471
|
-
* a dash array value of [3, 2, 1, 2] will create the following sequence:
|
|
1472
|
-
* - a segment worth 3 times the width
|
|
1473
|
-
* - a spacing worth 2 times the width
|
|
1474
|
-
* - a segment worth 1 times the width
|
|
1475
|
-
* - a spacing worth 2 times the width
|
|
1476
|
-
* - repeat
|
|
1477
|
-
*
|
|
1478
|
-
* Default: no dash pattern
|
|
1479
|
-
*/
|
|
1480
|
-
outlineDashArray?: Array<number> | string;
|
|
1481
|
-
/**
|
|
1482
|
-
* The display of line endings for both the line and the outline (if `.outline` is `true`)
|
|
1483
|
-
* - "butt": A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
1484
|
-
* - "round": A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
1485
|
-
* - "square": A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
1486
|
-
* Default: "round"
|
|
1487
|
-
*/
|
|
1488
|
-
outlineCap?: "butt" | "round" | "square";
|
|
1489
|
-
/**
|
|
1490
|
-
* The display of lines when joining for both the line and the outline (if `.outline` is `true`)
|
|
1491
|
-
* - "bevel": A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
1492
|
-
* - "round": A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
1493
|
-
* - "miter": A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
1494
|
-
* Default: "round"
|
|
1495
|
-
*/
|
|
1496
|
-
outlineJoin?: "bevel" | "round" | "miter";
|
|
1497
|
-
/**
|
|
1498
|
-
* The pattern is an image URL to be put as a repeated background pattern of the polygon.
|
|
1499
|
-
* Default: `null` (no pattern, `fillColor` will be used)
|
|
1500
|
-
*/
|
|
1501
|
-
pattern?: string | null;
|
|
1502
|
-
/**
|
|
1503
|
-
* How blury the outline is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
1504
|
-
* Applies only if `.outline` is `true`.
|
|
1505
|
-
* Default: `0`
|
|
1506
|
-
*/
|
|
1507
|
-
outlineBlur?: number | ZoomNumberValues;
|
|
1508
|
-
};
|
|
1509
|
-
type PointLayerOptions = CommonShapeLayerOptions & {
|
|
1510
|
-
/**
|
|
1511
|
-
* Can be a unique point color as a string (CSS color such as "#FF0000" or "red").
|
|
1512
|
-
* Alternatively, the color can be a ColorRamp with a range.
|
|
1513
|
-
* In case of `.cluster` being `true`, the range of the ColorRamp will be addressed with the number of elements in
|
|
1514
|
-
* the cluster. If `.cluster` is `false`, the color will be addressed using the value of the `.property`.
|
|
1515
|
-
* If no `.property` is given but `.pointColor` is a ColorRamp, the chosen color is the one at the lower bound of the ColorRamp.
|
|
1516
|
-
* Default: a color randomly pick from a list
|
|
1517
|
-
*/
|
|
1518
|
-
pointColor?: string | ColorRamp;
|
|
1519
|
-
/**
|
|
1520
|
-
* Radius of the points. Can be a fixed size or a value dependant on the zoom.
|
|
1521
|
-
* If `.pointRadius` is not provided, the radius will depend on the size of each cluster (if `.cluster` is `true`)
|
|
1522
|
-
* or on the value of each point (if `.property` is provided and `.pointColor` is a ColorRamp).
|
|
1523
|
-
* The radius will be between `.minPointRadius` and `.maxPointRadius`
|
|
1524
|
-
*/
|
|
1525
|
-
pointRadius?: number | ZoomNumberValues;
|
|
1526
|
-
/**
|
|
1527
|
-
* The minimum point radius posible.
|
|
1528
|
-
* Default: `10`
|
|
1529
|
-
*/
|
|
1530
|
-
minPointRadius?: number;
|
|
1531
|
-
/**
|
|
1532
|
-
* The maximum point radius posible.
|
|
1533
|
-
* Default: `40`
|
|
1534
|
-
*/
|
|
1535
|
-
maxPointRadius?: number;
|
|
1536
|
-
/**
|
|
1537
|
-
* The point property to observe and apply the radius and color upon.
|
|
1538
|
-
* This is ignored if `.cluster` is `true` as the observed value will be fiorced to being the number
|
|
1539
|
-
* of elements in each cluster.
|
|
1540
|
-
*
|
|
1541
|
-
* Default: none
|
|
1542
|
-
*/
|
|
1543
|
-
property?: string;
|
|
1544
|
-
/**
|
|
1545
|
-
* Opacity of the point or icon. This is can be a constant opacity in [0, 1] or a definition based on zoom levels.
|
|
1546
|
-
* Alternatively, if not provided but the `.pointColor` is a ColorRamp, the opacity will be extracted from tha alpha
|
|
1547
|
-
* component if present.
|
|
1548
|
-
* Default: `1`
|
|
1549
|
-
*/
|
|
1550
|
-
pointOpacity?: number | ZoomNumberValues;
|
|
1551
|
-
/**
|
|
1552
|
-
* If `true`, the points will keep their circular shape align with the wiewport.
|
|
1553
|
-
* If `false`, the points will be like flatten on the map. This difference shows
|
|
1554
|
-
* when the map is tilted.
|
|
1555
|
-
* Default: `true`
|
|
1556
|
-
*/
|
|
1557
|
-
alignOnViewport?: boolean;
|
|
1558
|
-
/**
|
|
1559
|
-
* Whether the points should cluster
|
|
1560
|
-
*/
|
|
1561
|
-
cluster?: boolean;
|
|
1562
|
-
/**
|
|
1563
|
-
* Shows a label with the numerical value id `true`.
|
|
1564
|
-
* If `.cluster` is `true`, the value will be the numebr of elements in the cluster.
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1567
|
-
* Default: `true` if `cluster` or `dataDrivenStyleProperty` are used, `false` otherwise.
|
|
1568
|
-
*/
|
|
1569
|
-
showLabel?: boolean;
|
|
1570
|
-
/**
|
|
1571
|
-
* text color used for the number elements in each cluster.
|
|
1572
|
-
* Applicable only when `cluster` is `true`.
|
|
1573
|
-
* Default: `#000000` (black)
|
|
1574
|
-
*/
|
|
1575
|
-
labelColor?: string;
|
|
1576
|
-
/**
|
|
1577
|
-
* text size used for the number elements in each cluster.
|
|
1578
|
-
* Applicable only when `cluster` is `true`.
|
|
1579
|
-
* Default: `12`
|
|
1580
|
-
*/
|
|
1581
|
-
labelSize?: number;
|
|
1582
|
-
/**
|
|
1583
|
-
* Only if `.cluster` is `false`.
|
|
1584
|
-
* If the radius is driven by a property, then it will also scale by zoomming if `.zoomCompensation` is `true`.
|
|
1585
|
-
* If `false`, the radius will not adapt according to the zoom level.
|
|
1586
|
-
* Default: `true`
|
|
1587
|
-
*/
|
|
1588
|
-
zoomCompensation?: boolean;
|
|
1589
|
-
};
|
|
1590
|
-
type HeatmapLayerOptions = {
|
|
1591
|
-
/**
|
|
1592
|
-
* ID to give to the layer.
|
|
1593
|
-
* If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated,
|
|
1594
|
-
* with "xxxxxx" being a random string.
|
|
1595
|
-
*/
|
|
1596
|
-
layerId?: string;
|
|
1597
|
-
/**
|
|
1598
|
-
* ID to give to the geojson source.
|
|
1599
|
-
* If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated,
|
|
1600
|
-
* with "xxxxxx" being a random string.
|
|
1601
|
-
*/
|
|
1602
|
-
sourceId?: string;
|
|
1603
|
-
/**
|
|
1604
|
-
* A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.
|
|
1605
|
-
*/
|
|
1606
|
-
data: FeatureCollection | string;
|
|
1607
|
-
/**
|
|
1608
|
-
* The ID of an existing layer to insert the new layer before, resulting in the new layer appearing
|
|
1609
|
-
* visually beneath the existing layer. If this argument is not specified, the layer will be appended
|
|
1610
|
-
* to the end of the layers array and appear visually above all other layers.
|
|
1611
|
-
*/
|
|
1612
|
-
beforeId?: string;
|
|
1613
|
-
/**
|
|
1614
|
-
* Zoom level at which it starts to show.
|
|
1615
|
-
* Default: `0`
|
|
1616
|
-
*/
|
|
1617
|
-
minzoom?: number;
|
|
1618
|
-
/**
|
|
1619
|
-
* Zoom level after which it no longer show.
|
|
1620
|
-
* Default: `22`
|
|
1621
|
-
*/
|
|
1622
|
-
maxzoom?: number;
|
|
1623
|
-
/**
|
|
1624
|
-
* The ColorRamp instance to use for visualization. The color ramp is expected to be defined in the
|
|
1625
|
-
* range `[0, 1]` or else will be forced to this range.
|
|
1626
|
-
* Default: `ColorRampCollection.TURBO`
|
|
1627
|
-
*/
|
|
1628
|
-
colorRamp?: ColorRamp;
|
|
1629
|
-
/**
|
|
1630
|
-
* Use a property to apply a weight to each data point. Using a property requires also using
|
|
1631
|
-
* the options `.propertyValueWeight` or otherwise will be ignored.
|
|
1632
|
-
* Default: none, the points will all have a weight of `1`.
|
|
1633
|
-
*/
|
|
1634
|
-
property?: string;
|
|
1635
|
-
/**
|
|
1636
|
-
* The weight to give to each data point. If of type `PropertyValueWeights`, then the options `.property`
|
|
1637
|
-
* must also be provided. If used a number, all data points will be weighted by the same number (which is of little interest)
|
|
1638
|
-
*/
|
|
1639
|
-
weight?: PropertyValues | number;
|
|
1640
|
-
/**
|
|
1641
|
-
* The radius (in screenspace) can be:
|
|
1642
|
-
* - a fixed number that will be constant across zoom level
|
|
1643
|
-
* - of type `ZoomNumberValues` to be ramped accoding to zoom level (`.zoomCompensation` will then be ignored)
|
|
1644
|
-
* - of type `PropertyValues` to be driven by the value of a property.
|
|
1645
|
-
* If so, the option `.property` must be provided and will still be resized according to zoom level,
|
|
1646
|
-
* unless the option `.zoomCompensation` is set to `false`.
|
|
1647
|
-
*
|
|
1648
|
-
* Default:
|
|
1649
|
-
*/
|
|
1650
|
-
radius?: number | ZoomNumberValues | PropertyValues;
|
|
1651
|
-
/**
|
|
1652
|
-
* The opacity can be a fixed value or zoom-driven.
|
|
1653
|
-
* Default: fades-in 0.25z after minzoom and fade-out 0.25z before maxzoom
|
|
1654
|
-
*/
|
|
1655
|
-
opacity?: number | ZoomNumberValues;
|
|
1656
|
-
/**
|
|
1657
|
-
* The intensity is zoom-dependent. By default, the intensity is going to be scaled by zoom to preserve
|
|
1658
|
-
* a natural aspect or the data distribution.
|
|
1659
|
-
*/
|
|
1660
|
-
intensity?: number | ZoomNumberValues;
|
|
1661
|
-
/**
|
|
1662
|
-
* If the radius is driven by a property, then it will also scale by zoomming if `.zoomCompensation` is `true`.
|
|
1663
|
-
* If `false`, the radius will not adapt according to the zoom level.
|
|
1664
|
-
* Default: `true`
|
|
1665
|
-
*/
|
|
1666
|
-
zoomCompensation?: boolean;
|
|
1667
|
-
};
|
|
1668
|
-
/**
|
|
1669
|
-
* Add a polyline to the map from various sources and with builtin styling.
|
|
1670
|
-
* Compatible sources:
|
|
1671
|
-
* - gpx content as string
|
|
1672
|
-
* - gpx file from URL
|
|
1673
|
-
* - kml content from string
|
|
1674
|
-
* - kml from url
|
|
1675
|
-
* - geojson from url
|
|
1676
|
-
* - geojson content as string
|
|
1677
|
-
* - geojson content as JS object
|
|
1678
|
-
* - uuid of a MapTiler Cloud dataset
|
|
1679
|
-
*
|
|
1680
|
-
* The method also gives the possibility to add an outline layer (if `options.outline` is `true`)
|
|
1681
|
-
* and if so , the returned property `polylineOutlineLayerId` will be a string. As a result, two layers
|
|
1682
|
-
* would be added.
|
|
1683
|
-
*
|
|
1684
|
-
* The default styling creates a line layer of constant width of 3px, the color will be randomly picked
|
|
1685
|
-
* from a curated list of colors and the opacity will be 1.
|
|
1686
|
-
* If the outline is enabled, the outline width is of 1px at all zoom levels, the color is white and
|
|
1687
|
-
* the opacity is 1.
|
|
1688
|
-
*
|
|
1689
|
-
* Those style properties can be changed and ramped according to zoom level using an easier syntax.
|
|
1690
|
-
*
|
|
1691
|
-
*/
|
|
1692
|
-
declare function addPolyline(
|
|
1693
|
-
/**
|
|
1694
|
-
* Map instance to add a polyline layer to
|
|
1695
|
-
*/
|
|
1696
|
-
map: Map,
|
|
1697
|
-
/**
|
|
1698
|
-
* Options related to adding a polyline layer
|
|
1699
|
-
*/
|
|
1700
|
-
options: PolylineLayerOptions,
|
|
1701
|
-
/**
|
|
1702
|
-
* When the polyline data is loaded from a distant source, these options are propagated to the call of `fetch`
|
|
1703
|
-
*/
|
|
1704
|
-
fetchOptions?: RequestInit): Promise<{
|
|
1705
|
-
polylineLayerId: string;
|
|
1706
|
-
polylineOutlineLayerId: string;
|
|
1707
|
-
polylineSourceId: string;
|
|
1708
|
-
}>;
|
|
1709
|
-
/**
|
|
1710
|
-
* Add a polygon with styling options.
|
|
1711
|
-
*/
|
|
1712
|
-
declare function addPolygon(map: Map, options: PolygonLayerOptions): {
|
|
1713
|
-
/**
|
|
1714
|
-
* ID of the fill layer
|
|
1715
|
-
*/
|
|
1716
|
-
polygonLayerId: string;
|
|
1717
|
-
/**
|
|
1718
|
-
* ID of the outline layer (will be `""` if no outline)
|
|
1719
|
-
*/
|
|
1720
|
-
polygonOutlineLayerId: string;
|
|
1721
|
-
/**
|
|
1722
|
-
* ID of the source that contains the data
|
|
1723
|
-
*/
|
|
1724
|
-
polygonSourceId: string;
|
|
1725
|
-
};
|
|
1726
|
-
/**
|
|
1727
|
-
* Add a point layer from a GeoJSON source (or an existing sourceId) with many styling options
|
|
1728
|
-
*/
|
|
1729
|
-
declare function addPoint(
|
|
1730
|
-
/**
|
|
1731
|
-
* The Map instance to add a point layer to
|
|
1732
|
-
*/
|
|
1733
|
-
map: Map, options: PointLayerOptions): {
|
|
1734
|
-
/**
|
|
1735
|
-
* ID of the unclustered point layer
|
|
1736
|
-
*/
|
|
1737
|
-
pointLayerId: string;
|
|
1738
|
-
/**
|
|
1739
|
-
* ID of the clustered point layer (empty if `cluster` options id `false`)
|
|
1740
|
-
*/
|
|
1741
|
-
clusterLayerId: string;
|
|
1742
|
-
/**
|
|
1743
|
-
* ID of the layer that shows the count of elements in each cluster (empty if `cluster` options id `false`)
|
|
1744
|
-
*/
|
|
1745
|
-
labelLayerId: string;
|
|
1746
|
-
/**
|
|
1747
|
-
* ID of the data source
|
|
1748
|
-
*/
|
|
1749
|
-
pointSourceId: string;
|
|
1750
|
-
};
|
|
1751
|
-
/**
|
|
1752
|
-
* Add a polyline witgh optional outline from a GeoJSON object
|
|
1753
|
-
*/
|
|
1754
|
-
declare function addHeatmap(
|
|
1755
|
-
/**
|
|
1756
|
-
* Map instance to add a heatmap layer to
|
|
1757
|
-
*/
|
|
1758
|
-
map: Map, options: HeatmapLayerOptions): {
|
|
1759
|
-
/**
|
|
1760
|
-
* ID of the heatmap layer
|
|
1761
|
-
*/
|
|
1762
|
-
heatmapLayerId: string;
|
|
1763
|
-
/**
|
|
1764
|
-
* ID of the data source
|
|
1765
|
-
*/
|
|
1766
|
-
heatmapSourceId: string;
|
|
1767
|
-
};
|
|
1768
|
-
|
|
1769
|
-
/**
|
|
1770
|
-
* Helpers are a set of functions to facilitate the creation of sources and layers
|
|
1771
|
-
*/
|
|
1772
|
-
declare const helpers: {
|
|
1773
|
-
addPolyline: typeof addPolyline;
|
|
1774
|
-
addPolygon: typeof addPolygon;
|
|
1775
|
-
addPoint: typeof addPoint;
|
|
1776
|
-
addHeatmap: typeof addHeatmap;
|
|
1777
|
-
};
|
|
1778
|
-
|
|
1779
|
-
declare const setRTLTextPlugin: typeof maplibregl__default.setRTLTextPlugin;
|
|
1780
|
-
declare const getRTLTextPluginStatus: typeof maplibregl__default.getRTLTextPluginStatus;
|
|
1781
|
-
declare const LngLat: typeof maplibregl__default.LngLat;
|
|
1782
|
-
declare const LngLatBounds: typeof maplibregl__default.LngLatBounds;
|
|
1783
|
-
declare const MercatorCoordinate: typeof maplibregl__default.MercatorCoordinate;
|
|
1784
|
-
declare const Evented: typeof maplibregl__default.Evented;
|
|
1785
|
-
declare const AJAXError: typeof maplibregl__default.AJAXError;
|
|
1786
|
-
declare const prewarm: typeof maplibregl__default.prewarm;
|
|
1787
|
-
declare const clearPrewarmedResources: typeof maplibregl__default.clearPrewarmedResources;
|
|
1788
|
-
declare const addProtocol: typeof maplibregl__default.addProtocol;
|
|
1789
|
-
declare const removeProtocol: typeof maplibregl__default.removeProtocol;
|
|
1790
|
-
declare const Hash: typeof maplibregl__default.Hash;
|
|
1791
|
-
declare const Point: typeof maplibregl__default.Point;
|
|
1792
|
-
declare const config: maplibregl__default.Config;
|
|
1793
|
-
declare const EdgeInsets: typeof maplibregl__default.EdgeInsets;
|
|
1794
|
-
declare const DragRotateHandler: typeof maplibregl__default.DragRotateHandler;
|
|
1795
|
-
declare const DragPanHandler: typeof maplibregl__default.DragPanHandler;
|
|
1796
|
-
declare const TwoFingersTouchZoomRotateHandler: typeof maplibregl__default.TwoFingersTouchZoomRotateHandler;
|
|
1797
|
-
declare const DoubleClickZoomHandler: typeof maplibregl__default.DoubleClickZoomHandler;
|
|
1798
|
-
declare const TwoFingersTouchZoomHandler: typeof maplibregl__default.TwoFingersTouchZoomHandler;
|
|
1799
|
-
declare const TwoFingersTouchRotateHandler: typeof maplibregl__default.TwoFingersTouchRotateHandler;
|
|
1800
|
-
declare const getWorkerCount: typeof maplibregl__default.getWorkerCount;
|
|
1801
|
-
declare const setWorkerCount: typeof maplibregl__default.setWorkerCount;
|
|
1802
|
-
declare const getMaxParallelImageRequests: typeof maplibregl__default.getMaxParallelImageRequests;
|
|
1803
|
-
declare const setMaxParallelImageRequests: typeof maplibregl__default.setMaxParallelImageRequests;
|
|
1804
|
-
declare const getWorkerUrl: typeof maplibregl__default.getWorkerUrl;
|
|
1805
|
-
declare const setWorkerUrl: typeof maplibregl__default.setWorkerUrl;
|
|
1806
|
-
declare const addSourceType: (name: string, SourceType: maplibregl__default.SourceClass) => Promise<void>;
|
|
1807
|
-
declare const importScriptInWorkers: typeof maplibregl__default.importScriptInWorkers;
|
|
1808
|
-
/**
|
|
1809
|
-
* Get the version of MapTiler SDK
|
|
1810
|
-
*/
|
|
1811
|
-
declare function getVersion(): string;
|
|
1812
|
-
/**
|
|
1813
|
-
* Get the version of MapLibre GL JS
|
|
1814
|
-
*/
|
|
1815
|
-
declare function getMapLibreVersion(): string;
|
|
1816
|
-
declare const MapMLGL: typeof maplibregl__default.Map;
|
|
1817
|
-
declare const MarkerMLGL: typeof maplibregl__default.Marker;
|
|
1818
|
-
declare const PopupMLGL: typeof maplibregl__default.Popup;
|
|
1819
|
-
declare const StyleMLGL: typeof maplibregl__default.Style;
|
|
1820
|
-
declare const CanvasSourceMLGL: typeof maplibregl__default.CanvasSource;
|
|
1821
|
-
declare const GeoJSONSourceMLGL: typeof maplibregl__default.GeoJSONSource;
|
|
1822
|
-
declare const ImageSourceMLGL: typeof maplibregl__default.ImageSource;
|
|
1823
|
-
declare const RasterTileSourceMLGL: typeof maplibregl__default.RasterTileSource;
|
|
1824
|
-
declare const RasterDEMTileSourceMLGL: typeof maplibregl__default.RasterDEMTileSource;
|
|
1825
|
-
declare const VectorTileSourceMLGL: typeof maplibregl__default.VectorTileSource;
|
|
1826
|
-
declare const VideoSourceMLGL: typeof maplibregl__default.VideoSource;
|
|
1827
|
-
declare const BoxZoomHandlerMLGL: typeof maplibregl__default.BoxZoomHandler;
|
|
1828
|
-
declare const ScrollZoomHandlerMLGL: typeof maplibregl__default.ScrollZoomHandler;
|
|
1829
|
-
declare const CooperativeGesturesHandlerMLGL: typeof maplibregl__default.CooperativeGesturesHandler;
|
|
1830
|
-
declare const KeyboardHandlerMLGL: typeof maplibregl__default.KeyboardHandler;
|
|
1831
|
-
declare const TwoFingersTouchPitchHandlerMLGL: typeof maplibregl__default.TwoFingersTouchPitchHandler;
|
|
1832
|
-
declare const MapWheelEventMLGL: typeof maplibregl__default.MapWheelEvent;
|
|
1833
|
-
declare const MapTouchEventMLGL: typeof maplibregl__default.MapTouchEvent;
|
|
1834
|
-
declare const MapMouseEventMLGL: typeof maplibregl__default.MapMouseEvent;
|
|
1835
|
-
|
|
1836
|
-
declare const NavigationControlMLGL: typeof maplibregl__default.NavigationControl;
|
|
1837
|
-
type NavigationControlMLGL = InstanceType<typeof NavigationControlMLGL>;
|
|
1838
|
-
declare const GeolocateControlMLGL: typeof maplibregl__default.GeolocateControl;
|
|
1839
|
-
type GeolocateControlMLGL = InstanceType<typeof GeolocateControlMLGL>;
|
|
1840
|
-
declare const AttributionControlMLGL: typeof maplibregl__default.AttributionControl;
|
|
1841
|
-
type AttributionControlMLGL = InstanceType<typeof AttributionControlMLGL>;
|
|
1842
|
-
declare const LogoControlMLGL: typeof maplibregl__default.LogoControl;
|
|
1843
|
-
type LogoControlMLGL = InstanceType<typeof LogoControlMLGL>;
|
|
1844
|
-
declare const ScaleControlMLGL: typeof maplibregl__default.ScaleControl;
|
|
1845
|
-
type ScaleControlMLGL = InstanceType<typeof ScaleControlMLGL>;
|
|
1846
|
-
declare const FullscreenControlMLGL: typeof maplibregl__default.FullscreenControl;
|
|
1847
|
-
type FullscreenControlMLGL = InstanceType<typeof FullscreenControlMLGL>;
|
|
1848
|
-
declare const TerrainControlMLGL: typeof maplibregl__default.TerrainControl;
|
|
1849
|
-
type TerrainControlMLGL = InstanceType<typeof TerrainControlMLGL>;
|
|
1850
|
-
|
|
1851
|
-
export { AJAXError, type ArrayColor, type ArrayColorRamp, type ArrayColorRampStop, AttributionControl, AttributionControlMLGL, BoxZoomHandler, BoxZoomHandlerMLGL, CanvasSource, CanvasSourceMLGL, ColorRamp, ColorRampCollection, type ColorRampOptions, type ColorStop, type CommonShapeLayerOptions, CooperativeGesturesHandler, CooperativeGesturesHandlerMLGL, DoubleClickZoomHandler, DragPanHandler, DragRotateHandler, EdgeInsets, Evented, FullscreenControl, FullscreenControlMLGL, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocateControlMLGL, GeolocationType, Hash, type HeatmapLayerOptions, ImageSource, ImageSourceMLGL, KeyboardHandler, KeyboardHandlerMLGL, Language, type LanguageKey, type LanguageString, type Link, LngLat, LngLatBounds, type LoadWithTerrainEvent, LogoControl, LogoControlMLGL, Map, MapMLGL, MapMouseEvent, MapMouseEventMLGL, type MapOptions, MapTouchEvent, MapTouchEventMLGL, MapWheelEvent, MapWheelEventMLGL, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerNavigationControl, MaptilerTerrainControl, Marker, MarkerMLGL, MercatorCoordinate, type MinimapOptions, type MinimapOptionsInput, NavigationControl, NavigationControlMLGL, type ParentRect, type PlacemarkProperties, Point, type PointLayerOptions, type PolygonLayerOptions, type PolylineLayerOptions, Popup, PopupMLGL, type PropertyValues, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, type RgbaColor, ScaleControl, ScaleControlMLGL, ScrollZoomHandler, ScrollZoomHandlerMLGL, SdkConfig, Style, StyleMLGL, TerrainControl, TerrainControlMLGL, TwoFingersTouchPitchHandler, TwoFingersTouchPitchHandlerMLGL, TwoFingersTouchRotateHandler, TwoFingersTouchZoomHandler, TwoFingersTouchZoomRotateHandler, type Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, type XMLProperties, type ZoomNumberValues, type ZoomStringValues, addProtocol, addSourceType, clearPrewarmedResources, config$1 as config, config as configMLGL, getBrowserLanguage, getMapLibreVersion, getMaxParallelImageRequests, getRTLTextPluginStatus, getVersion, getWorkerCount, getWorkerUrl, gpx, gpxOrKml, hasChildNodeWithName, helpers, importScriptInWorkers, isLanguageSupported, kml, prewarm, removeProtocol, setMaxParallelImageRequests, setRTLTextPlugin, setWorkerCount, setWorkerUrl, str2xml, xml2str };
|
|
1
|
+
export * from './src/index'
|