@maptiler/sdk 3.10.0-rc.1 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +606 -348
  2. package/package.json +1 -1
  3. package/dist/eslint.mjs +0 -133
  4. package/dist/maptiler-sdk.d.ts +0 -2
  5. package/dist/maptiler-sdk.mjs +0 -14217
  6. package/dist/maptiler-sdk.mjs.map +0 -1
  7. package/dist/src/ColorRamp.d.ts +0 -359
  8. package/dist/src/ImageViewer/ImageViewer.d.ts +0 -408
  9. package/dist/src/ImageViewer/ImageViewerMarker.d.ts +0 -236
  10. package/dist/src/ImageViewer/events.d.ts +0 -47
  11. package/dist/src/ImageViewer/index.d.ts +0 -5
  12. package/dist/src/ImageViewer/monkeyPatchML.d.ts +0 -10
  13. package/dist/src/ImageViewer/symbols.d.ts +0 -2
  14. package/dist/src/MLAdapters/AttributionControl.d.ts +0 -5
  15. package/dist/src/MLAdapters/BoxZoomHandler.d.ts +0 -7
  16. package/dist/src/MLAdapters/CanvasSource.d.ts +0 -5
  17. package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
  18. package/dist/src/MLAdapters/FullscreenControl.d.ts +0 -5
  19. package/dist/src/MLAdapters/GeoJSONSource.d.ts +0 -5
  20. package/dist/src/MLAdapters/GeolocateControl.d.ts +0 -5
  21. package/dist/src/MLAdapters/ImageSource.d.ts +0 -5
  22. package/dist/src/MLAdapters/KeyboardHandler.d.ts +0 -5
  23. package/dist/src/MLAdapters/LogoControl.d.ts +0 -5
  24. package/dist/src/MLAdapters/MapMouseEvent.d.ts +0 -5
  25. package/dist/src/MLAdapters/MapTouchEvent.d.ts +0 -5
  26. package/dist/src/MLAdapters/MapWheelEvent.d.ts +0 -5
  27. package/dist/src/MLAdapters/Marker.d.ts +0 -5
  28. package/dist/src/MLAdapters/NavigationControl.d.ts +0 -5
  29. package/dist/src/MLAdapters/Popup.d.ts +0 -5
  30. package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +0 -5
  31. package/dist/src/MLAdapters/RasterTileSource.d.ts +0 -5
  32. package/dist/src/MLAdapters/ScaleControl.d.ts +0 -5
  33. package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +0 -5
  34. package/dist/src/MLAdapters/Style.d.ts +0 -5
  35. package/dist/src/MLAdapters/TerrainControl.d.ts +0 -5
  36. package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
  37. package/dist/src/MLAdapters/VectorTileSource.d.ts +0 -5
  38. package/dist/src/MLAdapters/VideoSource.d.ts +0 -5
  39. package/dist/src/Map.d.ts +0 -475
  40. package/dist/src/Point.d.ts +0 -177
  41. package/dist/src/Telemetry.d.ts +0 -23
  42. package/dist/src/caching.d.ts +0 -4
  43. package/dist/src/config.d.ts +0 -85
  44. package/dist/src/constants/defaults.d.ts +0 -15
  45. package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +0 -13
  46. package/dist/src/controls/MaptilerCustomControl.d.ts +0 -17
  47. package/dist/src/controls/MaptilerExternalControl.d.ts +0 -25
  48. package/dist/src/controls/MaptilerGeolocateControl.d.ts +0 -21
  49. package/dist/src/controls/MaptilerLogoControl.d.ts +0 -19
  50. package/dist/src/controls/MaptilerNavigationControl.d.ts +0 -17
  51. package/dist/src/controls/MaptilerProjectionControl.d.ts +0 -15
  52. package/dist/src/controls/MaptilerTerrainControl.d.ts +0 -17
  53. package/dist/src/controls/Minimap.d.ts +0 -57
  54. package/dist/src/controls/index.d.ts +0 -8
  55. package/dist/src/converters/index.d.ts +0 -1
  56. package/dist/src/converters/xml.d.ts +0 -54
  57. package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +0 -239
  58. package/dist/src/custom-layers/CubemapLayer/constants.d.ts +0 -3
  59. package/dist/src/custom-layers/CubemapLayer/index.d.ts +0 -2
  60. package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +0 -42
  61. package/dist/src/custom-layers/CubemapLayer/types.d.ts +0 -67
  62. package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +0 -149
  63. package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +0 -2
  64. package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +0 -50
  65. package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +0 -17
  66. package/dist/src/custom-layers/index.d.ts +0 -6
  67. package/dist/src/helpers/index.d.ts +0 -5
  68. package/dist/src/helpers/screenshot.d.ts +0 -18
  69. package/dist/src/helpers/stylehelper.d.ts +0 -28
  70. package/dist/src/helpers/vectorlayerhelpers.d.ts +0 -508
  71. package/dist/src/index.d.ts +0 -100
  72. package/dist/src/language.d.ts +0 -107
  73. package/dist/src/mapstyle.d.ts +0 -18
  74. package/dist/src/ml-types.d.ts +0 -634
  75. package/dist/src/tools.d.ts +0 -84
  76. package/dist/src/types.d.ts +0 -1
  77. package/dist/src/utils/dom.d.ts +0 -2
  78. package/dist/src/utils/errors.d.ts +0 -5
  79. package/dist/src/utils/geo-utils.d.ts +0 -6
  80. package/dist/src/utils/index.d.ts +0 -1
  81. package/dist/src/utils/math-utils.d.ts +0 -8
  82. package/dist/src/utils/object.d.ts +0 -1
  83. package/dist/src/utils/webgl-utils.d.ts +0 -49
@@ -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
- };
@@ -1 +0,0 @@
1
- export type Unit = "imperial" | "metric" | "nautical";
@@ -1,2 +0,0 @@
1
- export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
2
- export declare function DOMremove(node: HTMLElement): void;
@@ -1,5 +0,0 @@
1
- export declare class FetchError extends Error {
2
- status: number;
3
- statusText: string;
4
- constructor(response: Response, resource: string, module: string);
5
- }
@@ -1,6 +0,0 @@
1
- import { LngLat } from 'maplibre-gl';
2
- declare function getAntipode(lngLat: LngLat): {
3
- lat: number;
4
- lng: number;
5
- };
6
- export { getAntipode };
@@ -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 +0,0 @@
1
- export declare function orderObjectKeys<T extends Record<string, unknown>>(obj?: T): T;
@@ -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;