@maptiler/sdk 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint.mjs +133 -0
- package/dist/maptiler-sdk.d.ts +2 -0
- package/dist/maptiler-sdk.mjs +14235 -0
- package/dist/maptiler-sdk.mjs.map +1 -0
- package/dist/src/ColorRamp.d.ts +359 -0
- package/dist/src/ImageViewer/ImageViewer.d.ts +408 -0
- package/dist/src/ImageViewer/ImageViewerMarker.d.ts +236 -0
- package/dist/src/ImageViewer/events.d.ts +47 -0
- package/dist/src/ImageViewer/index.d.ts +5 -0
- package/dist/src/ImageViewer/monkeyPatchML.d.ts +10 -0
- package/dist/src/ImageViewer/symbols.d.ts +2 -0
- package/dist/src/MLAdapters/AttributionControl.d.ts +5 -0
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +7 -0
- package/dist/src/MLAdapters/CanvasSource.d.ts +5 -0
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +5 -0
- package/dist/src/MLAdapters/FullscreenControl.d.ts +5 -0
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +5 -0
- package/dist/src/MLAdapters/GeolocateControl.d.ts +5 -0
- package/dist/src/MLAdapters/ImageSource.d.ts +5 -0
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +5 -0
- package/dist/src/MLAdapters/LogoControl.d.ts +5 -0
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +5 -0
- package/dist/src/MLAdapters/Marker.d.ts +5 -0
- package/dist/src/MLAdapters/NavigationControl.d.ts +5 -0
- package/dist/src/MLAdapters/Popup.d.ts +5 -0
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/RasterTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/ScaleControl.d.ts +5 -0
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +5 -0
- package/dist/src/MLAdapters/Style.d.ts +5 -0
- package/dist/src/MLAdapters/TerrainControl.d.ts +5 -0
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +5 -0
- package/dist/src/MLAdapters/VectorTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/VideoSource.d.ts +5 -0
- package/dist/src/Map.d.ts +480 -0
- package/dist/src/Point.d.ts +177 -0
- package/dist/src/Telemetry.d.ts +23 -0
- package/dist/src/caching.d.ts +4 -0
- package/dist/src/config.d.ts +85 -0
- package/dist/src/constants/defaults.d.ts +15 -0
- package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +13 -0
- package/dist/src/controls/MaptilerCustomControl.d.ts +17 -0
- package/dist/src/controls/MaptilerExternalControl.d.ts +25 -0
- package/dist/src/controls/MaptilerGeolocateControl.d.ts +21 -0
- package/dist/src/controls/MaptilerLogoControl.d.ts +19 -0
- package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
- package/dist/src/controls/MaptilerProjectionControl.d.ts +15 -0
- package/dist/src/controls/MaptilerTerrainControl.d.ts +17 -0
- package/dist/src/controls/Minimap.d.ts +57 -0
- package/dist/src/controls/index.d.ts +8 -0
- package/dist/src/converters/index.d.ts +1 -0
- package/dist/src/converters/xml.d.ts +54 -0
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +239 -0
- package/dist/src/custom-layers/CubemapLayer/constants.d.ts +3 -0
- package/dist/src/custom-layers/CubemapLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +43 -0
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +67 -0
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +149 -0
- package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +50 -0
- package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +17 -0
- package/dist/src/custom-layers/index.d.ts +6 -0
- package/dist/src/helpers/index.d.ts +5 -0
- package/dist/src/helpers/screenshot.d.ts +18 -0
- package/dist/src/helpers/stylehelper.d.ts +28 -0
- package/dist/src/helpers/vectorlayerhelpers.d.ts +508 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/language.d.ts +107 -0
- package/dist/src/mapstyle.d.ts +18 -0
- package/dist/src/ml-types.d.ts +634 -0
- package/dist/src/tools.d.ts +84 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/errors.d.ts +5 -0
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/logSDKVersion.d.ts +1 -0
- package/dist/src/utils/math-utils.d.ts +8 -0
- package/dist/src/utils/object.d.ts +1 -0
- package/dist/src/utils/webgl-utils.d.ts +49 -0
- package/package.json +3 -3
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare enum CubemapImagesPresets {
|
|
2
|
+
UNIVERSE_DARK = "universe-dark"
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Constructor options for the CubemapLayer.
|
|
6
|
+
* This type is equivalent to {@link CubemapDefinition} with no additional properties.
|
|
7
|
+
*/
|
|
8
|
+
export type CubemapLayerConstructorOptions = CubemapDefinition & {};
|
|
9
|
+
export declare const cubemapPresets: Record<string, CubemapDefinition>;
|
|
10
|
+
/**
|
|
11
|
+
* Defines how a cubemap should be constructed from source materials.
|
|
12
|
+
* This is a discriminated union type with four possible formats:
|
|
13
|
+
*
|
|
14
|
+
* 1. Path-based: Specify a base URL and optional format for cube face images
|
|
15
|
+
* 2. Faces-based: Provide explicit URLs for each cube face
|
|
16
|
+
* 3. Preset-based: Use a predefined cubemap from available presets
|
|
17
|
+
* 4. Color-based: Use a single color for all faces
|
|
18
|
+
*
|
|
19
|
+
* Only one of `path`, `faces`, `preset`, or `color` should be provided.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Path-based cubemap
|
|
23
|
+
* const pathCubemap: CubemapDefinition = {
|
|
24
|
+
* path: {
|
|
25
|
+
* baseUrl: 'https://example.com/cubemap',
|
|
26
|
+
* format: 'png'
|
|
27
|
+
* }
|
|
28
|
+
* };
|
|
29
|
+
*
|
|
30
|
+
* // Color-based cubemap
|
|
31
|
+
* const colorCubemap: CubemapDefinition = {
|
|
32
|
+
* color: '#ff0000'
|
|
33
|
+
* };
|
|
34
|
+
*/
|
|
35
|
+
export type CubemapDefinition = {
|
|
36
|
+
path: {
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
format?: "png" | "jpg" | "webp";
|
|
39
|
+
};
|
|
40
|
+
faces?: never;
|
|
41
|
+
preset?: never;
|
|
42
|
+
color?: string;
|
|
43
|
+
} | {
|
|
44
|
+
faces: CubemapFaces;
|
|
45
|
+
path?: never;
|
|
46
|
+
preset?: never;
|
|
47
|
+
color?: string;
|
|
48
|
+
} | {
|
|
49
|
+
preset: keyof typeof cubemapPresets;
|
|
50
|
+
path?: never;
|
|
51
|
+
faces?: never;
|
|
52
|
+
color?: string;
|
|
53
|
+
} | {
|
|
54
|
+
color: string;
|
|
55
|
+
path?: never;
|
|
56
|
+
faces?: never;
|
|
57
|
+
preset?: never;
|
|
58
|
+
};
|
|
59
|
+
export declare enum CubemapFaceNames {
|
|
60
|
+
POSITIVE_X = "pX",
|
|
61
|
+
NEGATIVE_X = "nX",
|
|
62
|
+
POSITIVE_Y = "pY",
|
|
63
|
+
NEGATIVE_Y = "nY",
|
|
64
|
+
POSITIVE_Z = "pZ",
|
|
65
|
+
NEGATIVE_Z = "nZ"
|
|
66
|
+
}
|
|
67
|
+
export type CubemapFaces = Record<CubemapFaceNames, string>;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { CustomLayerInterface, CustomRenderMethodInput } from 'maplibre-gl';
|
|
2
|
+
import { Map as MapSDK } from '../../Map';
|
|
3
|
+
import { GradientDefinition, RadialGradientLayerConstructorOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A custom map layer that renders a radial gradient effect, typically used as a halo around a globe.
|
|
6
|
+
* This layer uses WebGL for rendering and provides animation capabilities.
|
|
7
|
+
*
|
|
8
|
+
* The layer is implemented as a 3D custom layer that renders a billboard quad with a radial gradient shader.
|
|
9
|
+
* The gradient can be configured with multiple color stops and can be animated.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Create a simple halo layer with default settings
|
|
14
|
+
* const haloLayer = new RadialGradientLayer(true);
|
|
15
|
+
* map.addLayer(haloLayer);
|
|
16
|
+
*
|
|
17
|
+
* // Create a customized halo layer
|
|
18
|
+
* const customHalo = new RadialGradientLayer({
|
|
19
|
+
* scale: 1.5,
|
|
20
|
+
* stops: [
|
|
21
|
+
* [0, "rgba(255, 255, 255, 0.8)"],
|
|
22
|
+
* [1, "rgba(255, 255, 255, 0)"]
|
|
23
|
+
* ]
|
|
24
|
+
* });
|
|
25
|
+
* map.addLayer(customHalo);
|
|
26
|
+
* ```
|
|
27
|
+
* @remarks You shouldn't have to use this class directly.
|
|
28
|
+
* Instead, use the `Map.setHalo` method to create and add a halo layer to the map.
|
|
29
|
+
*/
|
|
30
|
+
export declare class RadialGradientLayer implements CustomLayerInterface {
|
|
31
|
+
id: string;
|
|
32
|
+
type: CustomLayerInterface["type"];
|
|
33
|
+
renderingMode: CustomLayerInterface["renderingMode"];
|
|
34
|
+
/**
|
|
35
|
+
* The gradient definition used by this layer.
|
|
36
|
+
* It contains the stops and scale for the radial gradient.
|
|
37
|
+
* @private
|
|
38
|
+
* @type {GradientDefinition}
|
|
39
|
+
*/
|
|
40
|
+
private gradient;
|
|
41
|
+
/**
|
|
42
|
+
* The scale of the radial gradient, which determines its size.
|
|
43
|
+
* This value is animated from 0 to the target scale during the layer's appearance.
|
|
44
|
+
* @private
|
|
45
|
+
* @type {number}
|
|
46
|
+
*/
|
|
47
|
+
private scale;
|
|
48
|
+
/**
|
|
49
|
+
* The animation delta value used to control the progress of the gradient's appearance animation.
|
|
50
|
+
* It is incremented during each frame of the animation until it reaches 1.
|
|
51
|
+
* @private
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
private animationDelta;
|
|
55
|
+
/**
|
|
56
|
+
* The MapSDK instance to which this layer is added.
|
|
57
|
+
* This is set when the layer is added to the map.
|
|
58
|
+
* @private
|
|
59
|
+
* @type {MapSDK}
|
|
60
|
+
*/
|
|
61
|
+
private map;
|
|
62
|
+
/**
|
|
63
|
+
* The 3D object representing the radial gradient plane.
|
|
64
|
+
* This object is created when the layer is added to the map and contains the shader program and buffers.
|
|
65
|
+
* It is used for rendering the radial gradient effect.
|
|
66
|
+
* @private
|
|
67
|
+
* @type {Object3D<(typeof ATTRIBUTES_KEYS)[number], (typeof UNIFORMS_KEYS)[number]>}
|
|
68
|
+
*/
|
|
69
|
+
private plane?;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the halo should be animated in and out.
|
|
72
|
+
* @private
|
|
73
|
+
* @type {boolean}
|
|
74
|
+
*/
|
|
75
|
+
private animationActive;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new RadialGradientLayer instance.
|
|
78
|
+
*
|
|
79
|
+
* @param {RadialGradientLayerConstructorOptions | boolean} gradient - Configuration options for the radial gradient or a boolean value.
|
|
80
|
+
* If a boolean is provided, default configuration options will be used.
|
|
81
|
+
* If an `RadialGradientLayerConstructorOptions` is provided, it will be merged with default options.
|
|
82
|
+
*/
|
|
83
|
+
constructor(gradient: RadialGradientLayerConstructorOptions | boolean);
|
|
84
|
+
/**
|
|
85
|
+
* Adds the radial gradient layer to the specified map.
|
|
86
|
+
* This method is called by the map when the layer is added to it.
|
|
87
|
+
*
|
|
88
|
+
* @param {MapSDK} map - The MapSDK instance to which this layer is being added
|
|
89
|
+
* @param {WebGLRenderingContext | WebGL2RenderingContext} gl - The WebGL rendering context used for rendering the layer
|
|
90
|
+
* @returns void
|
|
91
|
+
*/
|
|
92
|
+
onAdd(map: MapSDK, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the current gradient configuration of the radial gradient layer.
|
|
95
|
+
*
|
|
96
|
+
* @returns {GradientDefinition} The current gradient configuration.
|
|
97
|
+
*/
|
|
98
|
+
getConfig(): GradientDefinition;
|
|
99
|
+
/**
|
|
100
|
+
* Checks if the gradient needs to be updated based on the provided specification.
|
|
101
|
+
*
|
|
102
|
+
* @param {GradientDefinition} spec - The gradient specification to compare with the current gradient.
|
|
103
|
+
* @returns {boolean} True if the gradient needs to be updated, false otherwise.
|
|
104
|
+
*/
|
|
105
|
+
shouldUpdate(newSpec?: GradientDefinition | boolean): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Animates the radial gradient into view by gradually scaling from 0 to the target scale.
|
|
108
|
+
*
|
|
109
|
+
* This method uses requestAnimationFrame to create a smooth scaling animation effect.
|
|
110
|
+
* During each frame, it:
|
|
111
|
+
* 1. Interpolates the scale value between 0 and the target scale
|
|
112
|
+
* 2. Increments the animation progress (animationDelta)
|
|
113
|
+
* 3. Triggers a map repaint
|
|
114
|
+
*
|
|
115
|
+
* @private
|
|
116
|
+
* @returns {Promise<void>} A promise that resolves when the animation completes
|
|
117
|
+
*/
|
|
118
|
+
private animateIn;
|
|
119
|
+
/**
|
|
120
|
+
* Animates the radial gradient layer out by gradually reducing its scale to zero.
|
|
121
|
+
*
|
|
122
|
+
* This method creates a smooth transition effect by linearly interpolating the scale
|
|
123
|
+
* from its current value to zero over multiple animation frames. During each frame,
|
|
124
|
+
* the animation progresses by incrementing the internal animation delta value.
|
|
125
|
+
*
|
|
126
|
+
* The map is repainted after each animation step to reflect the updated scale.
|
|
127
|
+
*
|
|
128
|
+
* @private
|
|
129
|
+
* @returns A Promise that resolves when the animation is complete.
|
|
130
|
+
*/
|
|
131
|
+
private animateOut;
|
|
132
|
+
onRemove(_map: MapSDK, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
133
|
+
prerender(_gl: WebGLRenderingContext | WebGL2RenderingContext, _options: CustomRenderMethodInput): void;
|
|
134
|
+
render(gl: WebGLRenderingContext | WebGL2RenderingContext, options: CustomRenderMethodInput): void;
|
|
135
|
+
/**
|
|
136
|
+
* Sets a new gradient for the radial gradient layer and animates the transition.
|
|
137
|
+
*
|
|
138
|
+
* This method first animates the current gradient out, then updates the gradient
|
|
139
|
+
* property with the new gradient definition, and finally animates the new gradient in.
|
|
140
|
+
*
|
|
141
|
+
* @param {GradientDefinition} gradient - The new gradient definition to set for this layer.
|
|
142
|
+
* @returns {Promise<void>} A promise that resolves when the new gradient is set and animated in.
|
|
143
|
+
*/
|
|
144
|
+
setGradient(gradient: GradientDefinition | boolean): Promise<void>;
|
|
145
|
+
setAnimationActive(active: boolean): void;
|
|
146
|
+
show(): void;
|
|
147
|
+
hide(): void;
|
|
148
|
+
}
|
|
149
|
+
export declare function validateHaloSpecification(halo: RadialGradientLayerConstructorOptions | boolean): Array<string>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Object3D } from '../../utils/webgl-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a color string. Can be any valid CSS color format such as hex (#RRGGBB),
|
|
4
|
+
* RGB/RGBA (rgb(r, g, b) / rgba(r, g, b, a)), HSL/HSLA, or named colors (e.g., 'red', 'blue').
|
|
5
|
+
* Used within RadialGradientLayer implementations.
|
|
6
|
+
*/
|
|
7
|
+
export type GradientStopColor = string;
|
|
8
|
+
/**
|
|
9
|
+
* Represents a position in a radial gradient.
|
|
10
|
+
* The numeric value typically indicates the position along the gradient where a color stop should be placed.
|
|
11
|
+
* Usually normalized between 0 and 1, where 0 represents the center of the gradient and 1 represents the outer edge.
|
|
12
|
+
*/
|
|
13
|
+
export type GradientStop = number;
|
|
14
|
+
/**
|
|
15
|
+
* Options for constructing a RadialGradientLayer.
|
|
16
|
+
* This type is an alias for {@link GradientDefinition}, which defines the properties
|
|
17
|
+
* needed to create a radial gradient visualization on a map.
|
|
18
|
+
*/
|
|
19
|
+
export type RadialGradientLayerConstructorOptions = GradientDefinition;
|
|
20
|
+
/**
|
|
21
|
+
* Defines a gradient for use in a radial gradient layer.
|
|
22
|
+
*
|
|
23
|
+
* @typedef {Object} GradientDefinition
|
|
24
|
+
* @property {Array<[GradientStop, GradientStopColor]>} stops - Array of gradient stops, where each stop is a tuple containing a position and a color
|
|
25
|
+
* @property {number} scale - Scale factor that affects the size/reach of the gradient
|
|
26
|
+
*/
|
|
27
|
+
export type GradientDefinition = {
|
|
28
|
+
stops: Array<[GradientStop, GradientStopColor]>;
|
|
29
|
+
scale: number;
|
|
30
|
+
};
|
|
31
|
+
export type GradientAttributeKey = "vertexPosition";
|
|
32
|
+
/**
|
|
33
|
+
* Keys for gradient uniform values used in the RadialGradientLayer.
|
|
34
|
+
*
|
|
35
|
+
* @typedef {string} GradientUniformKey
|
|
36
|
+
* @property {"stopsNumber"} stopsNumber - Key for the number of stops in the gradient.
|
|
37
|
+
* @property {"stops"} stops - Key for the positions of color stops in the gradient.
|
|
38
|
+
* @property {"colors"} colors - Key for the color values at each stop in the gradient.
|
|
39
|
+
*/
|
|
40
|
+
export type GradientUniformKey = "stopsNumber" | "stops" | "colors";
|
|
41
|
+
/**
|
|
42
|
+
* Represents a subset of a 3D object used for gradient rendering.
|
|
43
|
+
*
|
|
44
|
+
* This type picks only the essential properties from Object3D that are needed
|
|
45
|
+
* for rendering radial gradients.
|
|
46
|
+
*
|
|
47
|
+
* @template GradientAttributeKey - The type defining attribute keys for the gradient
|
|
48
|
+
* @template GradientUniformKey - The type defining uniform keys for the gradient
|
|
49
|
+
*/
|
|
50
|
+
export type GradientPlaneObject3D = Pick<Object3D<GradientAttributeKey, GradientUniformKey>, "shaderProgram" | "programInfo" | "positionBuffer">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Map as MapSDK } from '../Map';
|
|
2
|
+
import { StyleSpecification } from 'maplibre-gl';
|
|
3
|
+
import { CubemapLayerConstructorOptions, RadialGradientLayerConstructorOptions } from '../custom-layers';
|
|
4
|
+
export type StyleSpecificationWithMetaData = StyleSpecification & {
|
|
5
|
+
metadata?: {
|
|
6
|
+
"maptiler:copyright": string;
|
|
7
|
+
maptiler?: {
|
|
8
|
+
halo: RadialGradientLayerConstructorOptions;
|
|
9
|
+
space: CubemapLayerConstructorOptions;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export interface IExtractCustomLayerStyleOptions {
|
|
14
|
+
map: MapSDK;
|
|
15
|
+
property: "halo" | "space";
|
|
16
|
+
}
|
|
17
|
+
export default function extractCustomLayerStyle<T extends CubemapLayerConstructorOptions | RadialGradientLayerConstructorOptions | null>(options: IExtractCustomLayerStyleOptions): T | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RadialGradientLayer } from './RadialGradientLayer';
|
|
2
|
+
import { CubemapLayer } from './CubemapLayer';
|
|
3
|
+
export { RadialGradientLayer, CubemapLayer };
|
|
4
|
+
export * from './RadialGradientLayer/types';
|
|
5
|
+
export * from './CubemapLayer/types';
|
|
6
|
+
export type { StyleSpecificationWithMetaData } from './extractCustomLayerStyle';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Map as MapSDK } from '../Map';
|
|
2
|
+
/**
|
|
3
|
+
* Takes a screenshot (PNG file) of the curent map view.
|
|
4
|
+
* Depending on the options, this function can automatically trigger a download of te file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function takeScreenshot(map: MapSDK, options?: {
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, this function will trigger a download in addition to returning a blob.
|
|
9
|
+
* Default: `false`
|
|
10
|
+
*/
|
|
11
|
+
download?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Only if `options.download` is `true`. Indicates the filename under which
|
|
14
|
+
* the file will be downloaded.
|
|
15
|
+
* Default: `"maptiler_screenshot.png"`
|
|
16
|
+
*/
|
|
17
|
+
filename?: string;
|
|
18
|
+
}): Promise<Blob>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataDrivenPropertyValueSpecification, ExpressionSpecification } from 'maplibre-gl';
|
|
2
|
+
import { ColorRamp } from '../ColorRamp';
|
|
3
|
+
import { DataDrivenStyle, PropertyValues, ZoomNumberValues, ZoomStringValues } from './vectorlayerhelpers';
|
|
4
|
+
export type ColorPalette = [string, string, string, string];
|
|
5
|
+
export declare const colorPalettes: Array<ColorPalette>;
|
|
6
|
+
export declare function getRandomColor(): string;
|
|
7
|
+
export declare function generateRandomSourceName(): string;
|
|
8
|
+
export declare function generateRandomLayerName(): string;
|
|
9
|
+
/**
|
|
10
|
+
* Linera interpolation to find a value at an arbitrary zoom level, given a list of tuple zoom-value
|
|
11
|
+
*/
|
|
12
|
+
export declare function lerpZoomNumberValues(znv: ZoomNumberValues, z: number): number;
|
|
13
|
+
export declare function paintColorOptionsToPaintSpec(color: ZoomStringValues): DataDrivenPropertyValueSpecification<string>;
|
|
14
|
+
export declare function rampedOptionsToLayerPaintSpec(ramp: ZoomNumberValues): DataDrivenPropertyValueSpecification<number>;
|
|
15
|
+
export declare function computeRampedOutlineWidth(lineWidth: number | ZoomNumberValues, outlineWidth: number | ZoomNumberValues): number | DataDrivenPropertyValueSpecification<number>;
|
|
16
|
+
export declare function rampedPropertyValueWeight(ramp: PropertyValues, property: string): DataDrivenPropertyValueSpecification<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Create a dash array from a string pattern that uses underscore and whitespace characters
|
|
19
|
+
*/
|
|
20
|
+
export declare function dashArrayMaker(pattern: string): Array<number>;
|
|
21
|
+
export declare function colorDrivenByProperty(style: DataDrivenStyle, property: string): DataDrivenPropertyValueSpecification<string>;
|
|
22
|
+
export declare function radiusDrivenByProperty(style: DataDrivenStyle, property: string, zoomCompensation?: boolean): DataDrivenPropertyValueSpecification<number>;
|
|
23
|
+
export declare function radiusDrivenByPropertyHeatmap(style: PropertyValues, property: string, zoomCompensation?: boolean): DataDrivenPropertyValueSpecification<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Turns a ColorRamp instance into a MapLibre style for ramping the opacity, driven by a property
|
|
26
|
+
*/
|
|
27
|
+
export declare function opacityDrivenByProperty(colorramp: ColorRamp, property: string): DataDrivenPropertyValueSpecification<number>;
|
|
28
|
+
export declare function heatmapIntensityFromColorRamp(colorRamp: ColorRamp, steps?: number): ExpressionSpecification;
|