@maptiler/sdk 3.9.0-rc.3 → 3.9.0-rc.4
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/package.json +2 -2
- package/test-results/tests-map-load-Awaits-until-map-ready-and-takes-snapshot-chromium/trace.zip +0 -0
- package/dist/eslint.mjs +0 -133
- package/dist/maptiler-sdk.d.ts +0 -2
- package/dist/maptiler-sdk.mjs +0 -14182
- package/dist/maptiler-sdk.mjs.map +0 -1
- package/dist/src/ColorRamp.d.ts +0 -359
- package/dist/src/ImageViewer/ImageViewer.d.ts +0 -408
- package/dist/src/ImageViewer/ImageViewerMarker.d.ts +0 -236
- package/dist/src/ImageViewer/events.d.ts +0 -47
- package/dist/src/ImageViewer/index.d.ts +0 -5
- package/dist/src/ImageViewer/monkeyPatchML.d.ts +0 -11
- package/dist/src/ImageViewer/symbols.d.ts +0 -2
- package/dist/src/MLAdapters/AttributionControl.d.ts +0 -5
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +0 -7
- package/dist/src/MLAdapters/CanvasSource.d.ts +0 -5
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
- package/dist/src/MLAdapters/FullscreenControl.d.ts +0 -5
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +0 -5
- package/dist/src/MLAdapters/GeolocateControl.d.ts +0 -5
- package/dist/src/MLAdapters/ImageSource.d.ts +0 -5
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +0 -5
- package/dist/src/MLAdapters/LogoControl.d.ts +0 -5
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +0 -5
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +0 -5
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +0 -5
- package/dist/src/MLAdapters/Marker.d.ts +0 -5
- package/dist/src/MLAdapters/NavigationControl.d.ts +0 -5
- package/dist/src/MLAdapters/Popup.d.ts +0 -5
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +0 -5
- package/dist/src/MLAdapters/RasterTileSource.d.ts +0 -5
- package/dist/src/MLAdapters/ScaleControl.d.ts +0 -5
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +0 -5
- package/dist/src/MLAdapters/Style.d.ts +0 -5
- package/dist/src/MLAdapters/TerrainControl.d.ts +0 -5
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
- package/dist/src/MLAdapters/VectorTileSource.d.ts +0 -5
- package/dist/src/MLAdapters/VideoSource.d.ts +0 -5
- package/dist/src/Map.d.ts +0 -471
- package/dist/src/Point.d.ts +0 -177
- package/dist/src/Telemetry.d.ts +0 -23
- package/dist/src/caching.d.ts +0 -4
- package/dist/src/config.d.ts +0 -85
- package/dist/src/constants/defaults.d.ts +0 -15
- package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +0 -13
- package/dist/src/controls/MaptilerCustomControl.d.ts +0 -17
- package/dist/src/controls/MaptilerExternalControl.d.ts +0 -25
- package/dist/src/controls/MaptilerGeolocateControl.d.ts +0 -21
- package/dist/src/controls/MaptilerLogoControl.d.ts +0 -19
- package/dist/src/controls/MaptilerNavigationControl.d.ts +0 -17
- package/dist/src/controls/MaptilerProjectionControl.d.ts +0 -15
- package/dist/src/controls/MaptilerTerrainControl.d.ts +0 -17
- package/dist/src/controls/Minimap.d.ts +0 -57
- package/dist/src/controls/index.d.ts +0 -8
- package/dist/src/converters/index.d.ts +0 -1
- package/dist/src/converters/xml.d.ts +0 -54
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +0 -232
- package/dist/src/custom-layers/CubemapLayer/constants.d.ts +0 -3
- package/dist/src/custom-layers/CubemapLayer/index.d.ts +0 -2
- package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +0 -42
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +0 -67
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +0 -142
- package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +0 -2
- package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +0 -50
- package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +0 -17
- package/dist/src/custom-layers/index.d.ts +0 -6
- package/dist/src/helpers/index.d.ts +0 -5
- package/dist/src/helpers/screenshot.d.ts +0 -18
- package/dist/src/helpers/stylehelper.d.ts +0 -28
- package/dist/src/helpers/vectorlayerhelpers.d.ts +0 -508
- package/dist/src/index.d.ts +0 -99
- package/dist/src/language.d.ts +0 -107
- package/dist/src/mapstyle.d.ts +0 -17
- package/dist/src/tools.d.ts +0 -84
- package/dist/src/types.d.ts +0 -1
- package/dist/src/utils/dom.d.ts +0 -2
- package/dist/src/utils/errors.d.ts +0 -5
- package/dist/src/utils/geo-utils.d.ts +0 -6
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/math-utils.d.ts +0 -8
- package/dist/src/utils/webgl-utils.d.ts +0 -49
package/dist/src/language.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { LanguageInfo } from '@maptiler/client';
|
|
2
|
-
declare const Language: {
|
|
3
|
-
readonly ALBANIAN: LanguageInfo;
|
|
4
|
-
readonly AMHARIC: LanguageInfo;
|
|
5
|
-
readonly ARABIC: LanguageInfo;
|
|
6
|
-
readonly ARMENIAN: LanguageInfo;
|
|
7
|
-
readonly AZERBAIJANI: LanguageInfo;
|
|
8
|
-
readonly BASQUE: LanguageInfo;
|
|
9
|
-
readonly BELARUSIAN: LanguageInfo;
|
|
10
|
-
readonly BENGALI: LanguageInfo;
|
|
11
|
-
readonly BOSNIAN: LanguageInfo;
|
|
12
|
-
readonly BRETON: LanguageInfo;
|
|
13
|
-
readonly BULGARIAN: LanguageInfo;
|
|
14
|
-
readonly CATALAN: LanguageInfo;
|
|
15
|
-
readonly CHINESE: LanguageInfo;
|
|
16
|
-
readonly TRADITIONAL_CHINESE: LanguageInfo;
|
|
17
|
-
readonly SIMPLIFIED_CHINESE: LanguageInfo;
|
|
18
|
-
readonly CORSICAN: LanguageInfo;
|
|
19
|
-
readonly CROATIAN: LanguageInfo;
|
|
20
|
-
readonly CZECH: LanguageInfo;
|
|
21
|
-
readonly DANISH: LanguageInfo;
|
|
22
|
-
readonly DUTCH: LanguageInfo;
|
|
23
|
-
readonly GERMAN: LanguageInfo;
|
|
24
|
-
readonly GREEK: LanguageInfo;
|
|
25
|
-
readonly ENGLISH: LanguageInfo;
|
|
26
|
-
readonly ESPERANTO: LanguageInfo;
|
|
27
|
-
readonly ESTONIAN: LanguageInfo;
|
|
28
|
-
readonly FINNISH: LanguageInfo;
|
|
29
|
-
readonly FRENCH: LanguageInfo;
|
|
30
|
-
readonly FRISIAN: LanguageInfo;
|
|
31
|
-
readonly GEORGIAN: LanguageInfo;
|
|
32
|
-
readonly HEBREW: LanguageInfo;
|
|
33
|
-
readonly HINDI: LanguageInfo;
|
|
34
|
-
readonly HUNGARIAN: LanguageInfo;
|
|
35
|
-
readonly ICELANDIC: LanguageInfo;
|
|
36
|
-
readonly INDONESIAN: LanguageInfo;
|
|
37
|
-
readonly IRISH: LanguageInfo;
|
|
38
|
-
readonly ITALIAN: LanguageInfo;
|
|
39
|
-
readonly JAPANESE: LanguageInfo;
|
|
40
|
-
readonly JAPANESE_HIRAGANA: LanguageInfo;
|
|
41
|
-
readonly JAPANESE_2018: LanguageInfo;
|
|
42
|
-
readonly JAPANESE_KANA: LanguageInfo;
|
|
43
|
-
readonly JAPANESE_LATIN: LanguageInfo;
|
|
44
|
-
readonly KANNADA: LanguageInfo;
|
|
45
|
-
readonly KAZAKH: LanguageInfo;
|
|
46
|
-
readonly KOREAN: LanguageInfo;
|
|
47
|
-
readonly KOREAN_LATIN: LanguageInfo;
|
|
48
|
-
readonly KURDISH: LanguageInfo;
|
|
49
|
-
readonly CLASSICAL_LATIN: LanguageInfo;
|
|
50
|
-
readonly LATVIAN: LanguageInfo;
|
|
51
|
-
readonly LITHUANIAN: LanguageInfo;
|
|
52
|
-
readonly LUXEMBOURGISH: LanguageInfo;
|
|
53
|
-
readonly MACEDONIAN: LanguageInfo;
|
|
54
|
-
readonly MALAYALAM: LanguageInfo;
|
|
55
|
-
readonly MALTESE: LanguageInfo;
|
|
56
|
-
readonly NORWEGIAN: LanguageInfo;
|
|
57
|
-
readonly OCCITAN: LanguageInfo;
|
|
58
|
-
readonly PERSIAN: LanguageInfo;
|
|
59
|
-
readonly POLISH: LanguageInfo;
|
|
60
|
-
readonly PORTUGUESE: LanguageInfo;
|
|
61
|
-
readonly PUNJABI: LanguageInfo;
|
|
62
|
-
readonly WESTERN_PUNJABI: LanguageInfo;
|
|
63
|
-
readonly ROMANIAN: LanguageInfo;
|
|
64
|
-
readonly ROMANSH: LanguageInfo;
|
|
65
|
-
readonly RUSSIAN: LanguageInfo;
|
|
66
|
-
readonly SERBIAN_CYRILLIC: LanguageInfo;
|
|
67
|
-
readonly SERBIAN_LATIN: LanguageInfo;
|
|
68
|
-
readonly SCOTTISH_GAELIC: LanguageInfo;
|
|
69
|
-
readonly SLOVAK: LanguageInfo;
|
|
70
|
-
readonly SLOVENE: LanguageInfo;
|
|
71
|
-
readonly SPANISH: LanguageInfo;
|
|
72
|
-
readonly SWEDISH: LanguageInfo;
|
|
73
|
-
readonly TAMIL: LanguageInfo;
|
|
74
|
-
readonly TELUGU: LanguageInfo;
|
|
75
|
-
readonly THAI: LanguageInfo;
|
|
76
|
-
readonly TURKISH: LanguageInfo;
|
|
77
|
-
readonly UKRAINIAN: LanguageInfo;
|
|
78
|
-
readonly VIETNAMESE: LanguageInfo;
|
|
79
|
-
readonly WELSH: LanguageInfo;
|
|
80
|
-
readonly AUTO: LanguageInfo;
|
|
81
|
-
readonly LATIN: LanguageInfo;
|
|
82
|
-
readonly NON_LATIN: LanguageInfo;
|
|
83
|
-
readonly LOCAL: LanguageInfo;
|
|
84
|
-
/**
|
|
85
|
-
* Language mode to display labels in both the local language and the language of the visitor's device, concatenated.
|
|
86
|
-
* Note that if those two languages are the same, labels won't be duplicated.
|
|
87
|
-
*/
|
|
88
|
-
readonly VISITOR: LanguageInfo;
|
|
89
|
-
/**
|
|
90
|
-
* Language mode to display labels in both the local language and English, concatenated.
|
|
91
|
-
* Note that if those two languages are the same, labels won't be duplicated.
|
|
92
|
-
*/
|
|
93
|
-
readonly VISITOR_ENGLISH: LanguageInfo;
|
|
94
|
-
/**
|
|
95
|
-
* Language mode to display labels in a language enforced in the style.
|
|
96
|
-
*/
|
|
97
|
-
readonly STYLE: LanguageInfo;
|
|
98
|
-
/**
|
|
99
|
-
* Language mode to display labels in a language enforced in the style. The language cannot be further modified.
|
|
100
|
-
*/
|
|
101
|
-
readonly STYLE_LOCK: LanguageInfo;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Get the browser language
|
|
105
|
-
*/
|
|
106
|
-
export declare function getBrowserLanguage(): LanguageInfo;
|
|
107
|
-
export { Language, type LanguageInfo };
|
package/dist/src/mapstyle.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
|
|
2
|
-
export declare function styleToStyle(style: string | ReferenceMapStyle | MapStyleVariant | maplibregl.StyleSpecification | null | undefined): {
|
|
3
|
-
style: string | maplibregl.StyleSpecification;
|
|
4
|
-
requiresUrlMonitoring: boolean;
|
|
5
|
-
isFallback: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* makes sure a URL is absolute
|
|
9
|
-
*/
|
|
10
|
-
export declare function urlToAbsoluteUrl(url: string): string;
|
|
11
|
-
type StyleValidationReport = {
|
|
12
|
-
isValidJSON: boolean;
|
|
13
|
-
isValidStyle: boolean;
|
|
14
|
-
styleObject: maplibregl.StyleSpecification | null;
|
|
15
|
-
};
|
|
16
|
-
export declare function convertStringToStyleSpecification(str: string): StyleValidationReport;
|
|
17
|
-
export {};
|
package/dist/src/tools.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, RequestParameters, ResourceType, RequestTransformFunction } from 'maplibre-gl';
|
|
2
|
-
import { Map as MapSDK } from './Map';
|
|
3
|
-
export declare function enableRTL(customPluginURL?: string): Promise<void>;
|
|
4
|
-
export declare function bindAll(fns: Array<string>, context: any): void;
|
|
5
|
-
/**
|
|
6
|
-
* This function is meant to be used as transformRequest by any Map instance created.
|
|
7
|
-
* It adds the session ID as well as the MapTiler Cloud key from the config to all the requests
|
|
8
|
-
* performed on MapTiler Cloud servers.
|
|
9
|
-
*/
|
|
10
|
-
export declare function maptilerCloudTransformRequest(url: string, resourceType?: ResourceType): RequestParameters;
|
|
11
|
-
/**
|
|
12
|
-
* This combines a user-defined tranformRequest function (optionnal)
|
|
13
|
-
* with the MapTiler Cloud-specific one: maptilerCloudTransformRequest
|
|
14
|
-
*/
|
|
15
|
-
export declare function combineTransformRequest(userDefinedRTF?: RequestTransformFunction | null): RequestTransformFunction;
|
|
16
|
-
/**
|
|
17
|
-
* Generate a random string. Handy to create random IDs
|
|
18
|
-
*/
|
|
19
|
-
export declare function generateRandomString(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Check if a given string is in a uuid format
|
|
22
|
-
*/
|
|
23
|
-
export declare function isUUID(s: string): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Attempt a JSON parse of a string but does not throw if the string is not valid JSON, returns `null` instead.
|
|
26
|
-
*/
|
|
27
|
-
export declare function jsonParseNoThrow<T>(doc: string): T | null;
|
|
28
|
-
/**
|
|
29
|
-
* Simple function to check if an object is a GeoJSON
|
|
30
|
-
*/
|
|
31
|
-
export declare function isValidGeoJSON<T>(obj: T & {
|
|
32
|
-
type: string;
|
|
33
|
-
}): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* This function tests if WebGL2 is supported. Since it can be for a different reasons that WebGL2 is
|
|
36
|
-
* not supported but we do not have an action to take based on the reason, this function return null
|
|
37
|
-
* if there is no error (WebGL is supported), or returns a string with the error message if WebGL2 is
|
|
38
|
-
* not supported.
|
|
39
|
-
*/
|
|
40
|
-
export declare function getWebGLSupportError(): string | null;
|
|
41
|
-
/**
|
|
42
|
-
* Display an error message in the Map div if WebGL2 is not supported
|
|
43
|
-
*/
|
|
44
|
-
export declare function displayNoWebGlWarning(container: HTMLElement | string): void;
|
|
45
|
-
/**
|
|
46
|
-
* Display a warning message in the Map div if the WebGL context was lost
|
|
47
|
-
*/
|
|
48
|
-
export declare function displayWebGLContextLostWarning(map: MapSDK): void;
|
|
49
|
-
/**
|
|
50
|
-
* In a text-field style property (as an object, not a string) the languages that are specified as
|
|
51
|
-
* ["get", "name:XX"] are replaced by the proved replacer (also an object).
|
|
52
|
-
* This replacement happened regardless of how deep in the object the flag is.
|
|
53
|
-
* Note that it does not replace the occurences of ["get", "name"] (local names)
|
|
54
|
-
*/
|
|
55
|
-
export declare function changeFirstLanguage(origExpr: maplibregl.ExpressionSpecification, replacer: maplibregl.ExpressionSpecification, localized: boolean): maplibregl.ExpressionSpecification;
|
|
56
|
-
/**
|
|
57
|
-
* If `localized` is `true`, it checks for the pattern "{name:xx}" (with "xx" being a language iso string).
|
|
58
|
-
* If `localized` is `false`, it check for {name}.
|
|
59
|
-
* In a exact way or is a loose way (such as "foo {name:xx}" or "foo {name} bar")
|
|
60
|
-
*/
|
|
61
|
-
export declare function checkNamePattern(str: string, localized: boolean): {
|
|
62
|
-
contains: boolean;
|
|
63
|
-
exactMatch: boolean;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Replaces the occurences of {name:xx} in a string by a provided object-expression to return a concat object expression
|
|
67
|
-
*/
|
|
68
|
-
export declare function replaceLanguage(origLang: string, newLang: maplibregl.ExpressionSpecification, localized: boolean): maplibregl.ExpressionSpecification;
|
|
69
|
-
/**
|
|
70
|
-
* Find languages used in string label definition.
|
|
71
|
-
* The returned array contains languages such as "en", "fr" but
|
|
72
|
-
* can also contain null that stand for the use of {name}
|
|
73
|
-
*/
|
|
74
|
-
export declare function findLanguageStr(str: string): Array<string | null>;
|
|
75
|
-
/**
|
|
76
|
-
* Find languages used in object label definition.
|
|
77
|
-
* The returned array contains languages such as "en", "fr" but
|
|
78
|
-
* can also contain null that stand for the use of {name}
|
|
79
|
-
*/
|
|
80
|
-
export declare function findLanguageObj(origExpr: maplibregl.ExpressionSpecification): Array<string | null>;
|
|
81
|
-
export declare function computeLabelsLocalizationMetrics(layers: maplibregl.LayerSpecification[], map: MapSDK): {
|
|
82
|
-
unlocalized: number;
|
|
83
|
-
localized: Record<string, number>;
|
|
84
|
-
};
|
package/dist/src/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Unit = "imperial" | "metric" | "nautical";
|
package/dist/src/utils/dom.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dom';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Vec4 } from './webgl-utils';
|
|
2
|
-
declare function minMax(value: number, min: number, max: number): number;
|
|
3
|
-
declare function normalize(value: number, min: number, max: number): number;
|
|
4
|
-
declare function diagonalOfSquare(side: number): number;
|
|
5
|
-
type Lerpable = [number, number, number, number] | Vec4;
|
|
6
|
-
declare function lerpVec4(a: Lerpable, b: Lerpable, t: number): Vec4;
|
|
7
|
-
declare function lerp(a: number, b: number, t: number): number;
|
|
8
|
-
export { minMax, normalize, diagonalOfSquare, lerpVec4, lerp };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;
|
|
2
|
-
/**
|
|
3
|
-
* Load a shader from a source string
|
|
4
|
-
*/
|
|
5
|
-
export declare function loadShader({ gl, type, source }: {
|
|
6
|
-
gl: WebGLContext;
|
|
7
|
-
type: GLenum;
|
|
8
|
-
source: string;
|
|
9
|
-
}): WebGLShader;
|
|
10
|
-
/**
|
|
11
|
-
* Create a set of shaders (vertex and fragment) and link them into a program
|
|
12
|
-
*
|
|
13
|
-
* @param gl WebGL context
|
|
14
|
-
* @param vertexShaderSource Vertex shader source code
|
|
15
|
-
* @param fragmentShaderSource Fragment shader source code
|
|
16
|
-
*
|
|
17
|
-
* @returns WebGL program
|
|
18
|
-
*/
|
|
19
|
-
export declare function createShaderProgram({ gl, vertexShaderSource, fragmentShaderSource }: {
|
|
20
|
-
gl: WebGLContext;
|
|
21
|
-
vertexShaderSource: string;
|
|
22
|
-
fragmentShaderSource: string;
|
|
23
|
-
}): WebGLProgram;
|
|
24
|
-
/**
|
|
25
|
-
* null-free version of getUniformLocation
|
|
26
|
-
*/
|
|
27
|
-
export declare function getUniformLocation(gl: WebGLRenderingContext | WebGL2RenderingContext, program: WebGLProgram, name: string): WebGLUniformLocation;
|
|
28
|
-
export type Object3D<Attribute extends string, Uniform extends string> = {
|
|
29
|
-
shaderProgram: WebGLProgram;
|
|
30
|
-
programInfo: {
|
|
31
|
-
attributesLocations: Record<Attribute, number>;
|
|
32
|
-
uniformsLocations: Record<Uniform, WebGLUniformLocation>;
|
|
33
|
-
};
|
|
34
|
-
positionBuffer: WebGLBuffer;
|
|
35
|
-
indexBuffer?: WebGLBuffer;
|
|
36
|
-
indexBufferLength?: number;
|
|
37
|
-
};
|
|
38
|
-
export declare function createObject3D<Attribute extends string, Uniform extends string>({ gl, vertexShaderSource, fragmentShaderSource, attributesKeys, uniformsKeys, vertices, indices, }: {
|
|
39
|
-
gl: WebGLContext;
|
|
40
|
-
vertexShaderSource: string;
|
|
41
|
-
fragmentShaderSource: string;
|
|
42
|
-
attributesKeys: readonly Attribute[];
|
|
43
|
-
uniformsKeys: readonly Uniform[];
|
|
44
|
-
vertices: Array<number>;
|
|
45
|
-
indices?: Array<number>;
|
|
46
|
-
}): Object3D<Attribute, Uniform>;
|
|
47
|
-
export type Vec4 = [number, number, number, number];
|
|
48
|
-
export declare function parseColorStringToVec4(color?: string): Vec4;
|
|
49
|
-
export declare function degreesToRadians(degrees: number): number;
|