@emuanalytics/flow-rdf-core 4.0.4 → 4.0.6
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/README.md +1 -64
- package/dist/index.d.mts +36 -31
- package/dist/index.d.ts +36 -31
- package/dist/index.mjs +20 -3249
- package/dist/lib/context/context-registry.mjs +63 -0
- package/dist/lib/context/debugger.mjs +240 -0
- package/dist/lib/context/flow-context.mjs +61 -0
- package/dist/lib/context/global-state.mjs +70 -0
- package/dist/lib/context/map-registry.mjs +59 -0
- package/dist/lib/context/query-registry.mjs +53 -0
- package/dist/lib/errors/flow-error.mjs +10 -0
- package/dist/lib/errors/flow-expression-error.mjs +14 -0
- package/dist/lib/errors/flow-map-error.mjs +9 -0
- package/dist/lib/expressions/expression-parser.mjs +198 -0
- package/dist/lib/expressions/functions/from-palette.mjs +75 -0
- package/dist/lib/expressions/functions/regex.mjs +25 -0
- package/dist/lib/expressions/functions/state.mjs +25 -0
- package/dist/lib/expressions/parser-helpers.mjs +37 -0
- package/dist/lib/expressions/reactive-expression.mjs +253 -0
- package/dist/lib/map/flow-core-map.mjs +749 -0
- package/dist/lib/map/plugins/annotations/annotation-layers.mjs +163 -0
- package/dist/lib/map/plugins/annotations/annotation.events.mjs +27 -0
- package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +498 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DirectModeOverride.mjs +67 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DragCircleMode.mjs +65 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/create_supplementary_points_circle.mjs +15 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/drag_pan.mjs +20 -0
- package/dist/lib/map/plugins/data-join.plugin.mjs +173 -0
- package/dist/lib/map/plugins/export/export.plugin.mjs +21 -0
- package/dist/lib/map/plugins/export/map-exporter.mjs +177 -0
- package/dist/lib/map/plugins/hover-effect.plugin.mjs +58 -0
- package/dist/lib/map/plugins/index.d.mts +37 -72
- package/dist/lib/map/plugins/index.d.ts +37 -72
- package/dist/lib/map/plugins/index.mjs +11 -1810
- package/dist/lib/map/plugins/keyboard-shortcut-manager.mjs +120 -0
- package/dist/lib/map/plugins/map-plugin-base.mjs +25 -0
- package/dist/lib/map/plugins/plugin-manager.mjs +135 -0
- package/dist/lib/map/plugins/popup.plugin.mjs +55 -0
- package/dist/lib/map/plugins/selection/selection.events.mjs +21 -0
- package/dist/lib/map/plugins/selection/selection.plugin.mjs +136 -0
- package/dist/lib/map/plugins/selection/source-selection.mjs +156 -0
- package/dist/lib/map/plugins/url-sync.plugin.mjs +55 -0
- package/dist/lib/map/support/image-registry.mjs +82 -0
- package/dist/lib/map/support/map-events.mjs +71 -0
- package/dist/lib/map/support/map-feature-stream.mjs +158 -0
- package/dist/lib/map/support/map-popup.mjs +159 -0
- package/dist/lib/map/types.mjs +7 -0
- package/dist/lib/map-style/map-data-source.mjs +192 -0
- package/dist/lib/map-style/map-layer-style-builder-generated.mjs +1307 -0
- package/dist/lib/map-style/map-layer-style-builder.mjs +86 -0
- package/dist/lib/map-style/map-layer.mjs +223 -0
- package/dist/lib/map-style/map-style.mjs +178 -0
- package/dist/lib/queries/async-committer.mjs +30 -0
- package/dist/lib/queries/query.mjs +172 -0
- package/dist/lib/state-store/decorators.mjs +83 -0
- package/dist/lib/state-store/state-store.mjs +534 -0
- package/dist/lib/state-store/utils.mjs +7 -0
- package/dist/lib/utils/announce.mjs +12 -0
- package/dist/lib/utils/assert.mjs +12 -0
- package/dist/{shared/flow-rdf-core.187cb345.mjs → lib/utils/debounce.mjs} +3 -39
- package/dist/lib/utils/decorators.mjs +59 -0
- package/dist/lib/utils/deferred.mjs +11 -0
- package/dist/lib/utils/ensure-array.mjs +16 -0
- package/dist/{shared/flow-rdf-core.1f0901c5.mjs → lib/utils/feature-type-checks.mjs} +2 -2
- package/dist/lib/utils/functional.mjs +22 -0
- package/dist/lib/utils/global.mjs +18 -0
- package/dist/lib/utils/index.mjs +8 -5
- package/dist/lib/utils/random-id.mjs +9 -0
- package/dist/lib/utils/string-utils.mjs +3 -0
- package/dist/lib/utils/throttle.mjs +20 -0
- package/dist/{shared/flow-rdf-core.25e5f6d7.mjs → lib/utils/type-checks.mjs} +1 -26
- package/dist/lib/utils/watchable-promise.mjs +55 -0
- package/dist/package.json.mjs +3 -0
- package/dist/shared/{flow-rdf-core.4dde996e.d.cts → flow-rdf-core.cef13c7e.d.mts} +1315 -172
- package/dist/shared/{flow-rdf-core.4dde996e.d.ts → flow-rdf-core.cef13c7e.d.ts} +1315 -172
- package/package.json +4 -8
- package/dist/index.cjs +0 -3316
- package/dist/index.d.cts +0 -90
- package/dist/lib/map/plugins/index.cjs +0 -1850
- package/dist/lib/map/plugins/index.d.cts +0 -345
- package/dist/lib/utils/index.cjs +0 -48
- package/dist/lib/utils/index.d.cts +0 -160
- package/dist/shared/flow-rdf-core.06e85a6c.cjs +0 -1394
- package/dist/shared/flow-rdf-core.4dde996e.d.mts +0 -1916
- package/dist/shared/flow-rdf-core.55c169ca.cjs +0 -150
- package/dist/shared/flow-rdf-core.63162669.d.cts +0 -10
- package/dist/shared/flow-rdf-core.65045caf.mjs +0 -1360
- package/dist/shared/flow-rdf-core.a82b9be4.cjs +0 -34
- package/dist/shared/flow-rdf-core.f50908f0.cjs +0 -102
|
@@ -1,1916 +0,0 @@
|
|
|
1
|
-
import { Client } from '@emuanalytics/flow-engine-client';
|
|
2
|
-
import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
|
|
3
|
-
import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
|
|
4
|
-
import EventEmitter$1, { EventEmitter } from 'eventemitter3';
|
|
5
|
-
|
|
6
|
-
type Annotation = {
|
|
7
|
-
annotationType: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
declare function traceReaction(): void;
|
|
11
|
-
type IsStrictlyAny<T> = (T extends never ? true : false) extends false ? false : true;
|
|
12
|
-
type HasIndexSignature<T> = T extends {
|
|
13
|
-
[k in 'FlowStateStoreDummyVal']?: any;
|
|
14
|
-
} ? true : false;
|
|
15
|
-
type StoreKey<T, TBase> = Exclude<Exclude<keyof T, keyof TBase>, keyof []> & string;
|
|
16
|
-
type PathImpl<T, TBase, Key extends StoreKey<T, TBase>> = Key extends string ? IsStrictlyAny<T[Key]> extends true ? never : HasIndexSignature<T[Key]> extends true ? never : T[Key] extends Record<string, any> ? `${Key}.${StoreKey<T[Key], TBase>}` | `${Key}.${PathImpl<T[Key], TBase, StoreKey<T[Key], TBase>>}` : never : never;
|
|
17
|
-
type Path<T, TBase = Record<string, unknown>> = PathImpl<T, TBase, StoreKey<T, TBase>> | StoreKey<T, TBase>;
|
|
18
|
-
type PathValue<T, P extends Path<T, TBase>, TBase = Record<string, unknown>> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? Rest extends Path<T[Key], TBase> ? PathValue<T[Key], Rest, TBase> : never : never : P extends keyof T ? T[P] : never;
|
|
19
|
-
|
|
20
|
-
type StoreConstructor<T extends StateStore> = new () => T;
|
|
21
|
-
type StoreAnnotations<T extends StateStore> = {
|
|
22
|
-
[P in StoreKey<T, StateStore>]?: Annotation | Annotation[];
|
|
23
|
-
};
|
|
24
|
-
type SerializationFormat = 'raw' | 'json' | 'lz';
|
|
25
|
-
declare class StateStore {
|
|
26
|
-
private get formattedName();
|
|
27
|
-
private serializationAnnotations;
|
|
28
|
-
get initialized(): boolean;
|
|
29
|
-
id: string;
|
|
30
|
-
constructor();
|
|
31
|
-
get<P extends Path<this, StateStore>>(path: P): PathValue<this, P, StateStore>;
|
|
32
|
-
set<P extends Path<this, StateStore>>(path: P, val: PathValue<this, P, StateStore>): void;
|
|
33
|
-
transaction(fn: (state: this) => void): void;
|
|
34
|
-
toggle<P extends Path<this, StateStore>>(path: P): boolean;
|
|
35
|
-
increment<P extends Path<this, StateStore>>(path: P): number;
|
|
36
|
-
decrement<P extends Path<this, StateStore>>(path: P): number;
|
|
37
|
-
bindControl<TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>, TElementValue, TElement extends HTMLElement & {
|
|
38
|
-
value: TElementValue;
|
|
39
|
-
}>(el: TElement, statePath: TStatePath, options?: {
|
|
40
|
-
toState?: (value: TElementValue) => TStateValue;
|
|
41
|
-
fromState?: (value: TStateValue) => TElementValue;
|
|
42
|
-
}): ISubscription;
|
|
43
|
-
bindElementProp<TElementProp extends keyof TElement, TElement extends HTMLElement, TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>>(el: TElement, prop: TElementProp, statePath: TStatePath, options?: {
|
|
44
|
-
fromState?: (value: TStateValue) => TElement[TElementProp];
|
|
45
|
-
}): ISubscription;
|
|
46
|
-
bindElementAttr<TElement extends HTMLElement, P extends Path<this, StateStore>>(el: TElement, attr: string, statePath: P): ISubscription;
|
|
47
|
-
toStream<P extends Path<this, StateStore>>(path: P, fireImmediately?: boolean): IObservableStream<PathValue<this, P, StateStore>>;
|
|
48
|
-
autorun(autorunFn: (state: this) => void, name?: string): IDisposer;
|
|
49
|
-
initialize(annotations?: StoreAnnotations<this>): void;
|
|
50
|
-
private makeObservable;
|
|
51
|
-
private makeAutoObservable;
|
|
52
|
-
serialize(): Record<string, string>;
|
|
53
|
-
serialize(format: 'raw'): Record<string, string>;
|
|
54
|
-
serialize(format: 'lz' | 'json'): string;
|
|
55
|
-
deserialize(value: Record<string, string>): void;
|
|
56
|
-
deserialize(value: Record<string, string>, format: 'raw'): void;
|
|
57
|
-
deserialize(value: string, format: 'json' | 'lz'): void;
|
|
58
|
-
private checkInitialized;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Flo.w context debugger. Provides debugging methods available in the browser web developer console.
|
|
63
|
-
*
|
|
64
|
-
* If the `enableDebug` is specified when initializing a Flo.w context a `Debugger` instance is available
|
|
65
|
-
* as the global property `window.FDBG`.
|
|
66
|
-
*/
|
|
67
|
-
declare class Debugger<TState extends StateStore = StateStore> {
|
|
68
|
-
readonly context: FlowContext<TState>;
|
|
69
|
-
private spyDisposer;
|
|
70
|
-
private watchDisposers;
|
|
71
|
-
/**
|
|
72
|
-
* Constructs a new Flo.w debugger instance.
|
|
73
|
-
*
|
|
74
|
-
* A new Flo.w debugger will be created automatically if the `enableDebug` option is
|
|
75
|
-
* specified when initializing a Flo.w context.
|
|
76
|
-
*
|
|
77
|
-
* @param context Flo.w context ID.
|
|
78
|
-
*/
|
|
79
|
-
constructor(context: FlowContext<TState>);
|
|
80
|
-
/**
|
|
81
|
-
* Install a 'watch' for the specified context state property path.
|
|
82
|
-
*
|
|
83
|
-
* @param path Context state property path.
|
|
84
|
-
*/
|
|
85
|
-
watch(path: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* Remove a previously-installed 'watch' for the specified context state property path.
|
|
88
|
-
*
|
|
89
|
-
* @param path Context state property path.
|
|
90
|
-
*/
|
|
91
|
-
unwatch(path?: string): void;
|
|
92
|
-
/**
|
|
93
|
-
* Set a Flo.w context state property.
|
|
94
|
-
*
|
|
95
|
-
* @param path Context state property path
|
|
96
|
-
* @param value New value to set
|
|
97
|
-
*/
|
|
98
|
-
set(path: string, value: any): void;
|
|
99
|
-
/**
|
|
100
|
-
* Read the value of a Flo.w context state property.
|
|
101
|
-
*
|
|
102
|
-
* @param keyOrPath Context state property path.
|
|
103
|
-
* @returns The context state property value.
|
|
104
|
-
*/
|
|
105
|
-
get(keyOrPath?: string | string[]): any;
|
|
106
|
-
/**
|
|
107
|
-
* Enable verbose debugging of all reactive updates.
|
|
108
|
-
*/
|
|
109
|
-
spy(): void;
|
|
110
|
-
/**
|
|
111
|
-
* Disable verbose debugging of all reactive updates.
|
|
112
|
-
*/
|
|
113
|
-
unspy(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Get a registered map instance by ID.
|
|
116
|
-
*/
|
|
117
|
-
maps(mapId?: string): any;
|
|
118
|
-
/**
|
|
119
|
-
* Get a registered reactive query by ID.
|
|
120
|
-
*/
|
|
121
|
-
queries(queryId?: string): any;
|
|
122
|
-
private spyListener;
|
|
123
|
-
private logStateValue;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Result format of a [[Query]]. */
|
|
127
|
-
type QueryResultFormat = 'json' | 'geojson' | 'csv';
|
|
128
|
-
/** [[FlowQueryDefinition]] 'attributes' entry. */
|
|
129
|
-
type QueryAttribute = string | [any, string];
|
|
130
|
-
/**
|
|
131
|
-
* [[FlowQueryDefinition]] 'where' clauses.
|
|
132
|
-
*/
|
|
133
|
-
interface QueryWhereClauses {
|
|
134
|
-
[attribute: string]: any;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* [[FlowQueryDefinition]] extra parameters.
|
|
138
|
-
*/
|
|
139
|
-
interface QueryExtraParams {
|
|
140
|
-
[key: string]: string | number;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* [[FlowQueryDefinition]] 'order' clause.
|
|
144
|
-
*
|
|
145
|
-
* A field name or [field, asc/desc] tuple.
|
|
146
|
-
*/
|
|
147
|
-
type QueryOrderClause = string | number | [string | number, 'asc' | 'desc'];
|
|
148
|
-
interface QuerySampleOptions {
|
|
149
|
-
percentage: number;
|
|
150
|
-
method?: 'system' | 'bernoulli';
|
|
151
|
-
seed?: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Definition of a Flo.w reactive dataset query.
|
|
155
|
-
*/
|
|
156
|
-
interface QueryDefinition {
|
|
157
|
-
/** ID of dataset to query. */
|
|
158
|
-
datasetId: string;
|
|
159
|
-
/** Attributes to return in results. */
|
|
160
|
-
attributes?: QueryAttribute[];
|
|
161
|
-
/** DISTINCT ON attributes */
|
|
162
|
-
distinct?: string | string[];
|
|
163
|
-
/** Filter results using 'where' clauses. */
|
|
164
|
-
where?: QueryWhereClauses;
|
|
165
|
-
/** Sort results by attributes. */
|
|
166
|
-
order?: QueryOrderClause[];
|
|
167
|
-
/** Group results by attributes. */
|
|
168
|
-
group?: (string | number)[];
|
|
169
|
-
/** Start offset of returned results */
|
|
170
|
-
offset?: number;
|
|
171
|
-
/** Limit number of returned results */
|
|
172
|
-
limit?: number;
|
|
173
|
-
/** Format of returned data. */
|
|
174
|
-
format?: QueryResultFormat;
|
|
175
|
-
/** Additional query parameters. */
|
|
176
|
-
params?: QueryExtraParams;
|
|
177
|
-
/** Sampling options. */
|
|
178
|
-
sample?: QuerySampleOptions;
|
|
179
|
-
}
|
|
180
|
-
interface QueryOptions {
|
|
181
|
-
id?: string;
|
|
182
|
-
fireImmediately?: boolean;
|
|
183
|
-
delay?: number;
|
|
184
|
-
contextId?: string;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* [[FlowQuery]] query definition function.
|
|
188
|
-
*
|
|
189
|
-
* @typeParam TState Type of application state.
|
|
190
|
-
*/
|
|
191
|
-
type QueryDefinitionFn<TState> = (this: TState, store: TState) => QueryDefinition | Promise<QueryDefinition> | null;
|
|
192
|
-
/**
|
|
193
|
-
* [[FlowQuery]] result transform function.
|
|
194
|
-
*
|
|
195
|
-
* @typeParam T Type of transformed query results.
|
|
196
|
-
*/
|
|
197
|
-
type QueryResultTransformFn<T = any> = (results: any) => T | null;
|
|
198
|
-
|
|
199
|
-
declare class Query<TResults, TState extends StateStore = any> {
|
|
200
|
-
private queryFn;
|
|
201
|
-
private static _defaultOptions;
|
|
202
|
-
static setDefaultOptions(options: QueryOptions): void;
|
|
203
|
-
private _options;
|
|
204
|
-
private _committer;
|
|
205
|
-
private _disposer;
|
|
206
|
-
private _transformFn;
|
|
207
|
-
private get formattedName();
|
|
208
|
-
get id(): string;
|
|
209
|
-
results: TResults | null;
|
|
210
|
-
busy: boolean;
|
|
211
|
-
error: Error | null;
|
|
212
|
-
constructor(queryFn: QueryDefinitionFn<TState | null>, transformFn?: QueryResultTransformFn<TResults>, options?: QueryOptions);
|
|
213
|
-
destroy(): void;
|
|
214
|
-
runImmediately(): Promise<TResults | null>;
|
|
215
|
-
private wake;
|
|
216
|
-
private sleep;
|
|
217
|
-
private runQuery;
|
|
218
|
-
}
|
|
219
|
-
declare function query<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, options: QueryOptions): Query<TResult, TState>;
|
|
220
|
-
declare function query<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, transformFn?: QueryResultTransformFn<TResult>, options?: QueryOptions): Query<TResult, TState>;
|
|
221
|
-
declare function queryMany<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, options: QueryOptions): Query<TResult[], TState>;
|
|
222
|
-
declare function queryMany<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, transformFn?: QueryResultTransformFn<TResult[]>, options?: QueryOptions): Query<TResult[], TState>;
|
|
223
|
-
declare function queryOne<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, options: QueryOptions): Query<TResult, TState>;
|
|
224
|
-
declare function queryOne<TResult = any, TState extends StateStore = any>(queryFn: QueryDefinitionFn<TState>, transformFn?: QueryResultTransformFn<TResult>, options?: QueryOptions): Query<TResult, TState>;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* The `QueryRegistry` is a container for [[Query]] instances.
|
|
228
|
-
*
|
|
229
|
-
* Queries can be registered and retrieved by ID.
|
|
230
|
-
*/
|
|
231
|
-
declare class QueryRegistry {
|
|
232
|
-
private _queries;
|
|
233
|
-
/**
|
|
234
|
-
* Register a Flo.w reactive query.
|
|
235
|
-
*
|
|
236
|
-
* @param query Query to register.
|
|
237
|
-
*/
|
|
238
|
-
registerQuery(query: Query<any>): void;
|
|
239
|
-
/**
|
|
240
|
-
* Un-register a Flo.w reactive query.
|
|
241
|
-
*
|
|
242
|
-
* @param query Query to unregister.
|
|
243
|
-
*/
|
|
244
|
-
unregisterQuery(query: Query<any>): void;
|
|
245
|
-
/**
|
|
246
|
-
* Retrieve the specified query.
|
|
247
|
-
*
|
|
248
|
-
* This method returns a promise that resolves when the query has been initialized.
|
|
249
|
-
*
|
|
250
|
-
* @param id Map ID.
|
|
251
|
-
*/
|
|
252
|
-
getQuery<TResults = any, TState extends StateStore = any>(id: string): Promise<Query<TResults, TState>>;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
declare class FlowError extends Error {
|
|
256
|
-
cause?: Error | undefined;
|
|
257
|
-
constructor(message: string, cause?: Error | undefined);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
declare class FlowExpressionError extends FlowError {
|
|
261
|
-
readonly reason: 'parseError' | 'evaluationError';
|
|
262
|
-
readonly errors: string[];
|
|
263
|
-
constructor(expression: string, reason: 'parseError' | 'evaluationError', errors: string[]);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
declare class ReactiveExpression<TState extends StateStore = StateStore, R = any> {
|
|
267
|
-
private static parser;
|
|
268
|
-
private static customFunctions;
|
|
269
|
-
static hasCustomFunction(fn: string): boolean;
|
|
270
|
-
static registerCustomFunction(fn: FlowCoreExpressionCustomFunction): void;
|
|
271
|
-
private _expression;
|
|
272
|
-
private parsedResult;
|
|
273
|
-
private _store;
|
|
274
|
-
static parseProgram(program: string): {
|
|
275
|
-
[key: string]: ReactiveExpression;
|
|
276
|
-
};
|
|
277
|
-
get maplibreExpression(): ParserExpression | undefined;
|
|
278
|
-
get value(): R;
|
|
279
|
-
get parseError(): FlowExpressionError | null;
|
|
280
|
-
get expression(): string;
|
|
281
|
-
get store(): TState | null;
|
|
282
|
-
constructor(expression: string, parsedExpression?: ParserExpression);
|
|
283
|
-
bindState(store: TState | null): this;
|
|
284
|
-
toStream(fireImmediately?: boolean): IObservableStream<R>;
|
|
285
|
-
private evaluateExpression;
|
|
286
|
-
private expandCustomFunctions;
|
|
287
|
-
private isParseError;
|
|
288
|
-
private isFunctionExpression;
|
|
289
|
-
private formatName;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
interface FlowCoreExpressionCustomFunction {
|
|
293
|
-
name: string;
|
|
294
|
-
initialize?: () => void;
|
|
295
|
-
fn: FlowCoreExpressionCustomFunctionSignature;
|
|
296
|
-
}
|
|
297
|
-
type FlowCoreExpressionCustomFunctionSignature = <TState extends StateStore = any>(expr: ParserFunctionExpression, parentExpression: ReactiveExpression) => ParserExpression;
|
|
298
|
-
type ParserExpression = number | string | boolean | null | ParserFunctionExpression;
|
|
299
|
-
type ParserFunctionExpression = [string, ...any[]];
|
|
300
|
-
|
|
301
|
-
declare class MapLayerStyleBuilder {
|
|
302
|
-
private static _styleBuilders;
|
|
303
|
-
static registerStyleBuilder(layerType: string, builder: typeof MapLayerStyleBuilder): void;
|
|
304
|
-
static createStyleBuilder(layerType: string): MapLayerStyleBuilder;
|
|
305
|
-
private _styles;
|
|
306
|
-
/**
|
|
307
|
-
* Whether this layer is displayed.
|
|
308
|
-
*
|
|
309
|
-
* @param value - visible value (default `true`)
|
|
310
|
-
*/
|
|
311
|
-
visibility(value: boolean | StyleExpression): this;
|
|
312
|
-
/**
|
|
313
|
-
* Create a style specification string.
|
|
314
|
-
*
|
|
315
|
-
* Call this method after setting all style properties
|
|
316
|
-
* on the style builder.
|
|
317
|
-
*
|
|
318
|
-
* @returns Layer style specification string
|
|
319
|
-
*/
|
|
320
|
-
build(): string;
|
|
321
|
-
/**
|
|
322
|
-
* Format and add style property to the style builder.
|
|
323
|
-
*/
|
|
324
|
-
protected addStyle(property: string, value: unknown): void;
|
|
325
|
-
private formatValue;
|
|
326
|
-
}
|
|
327
|
-
declare class StyleExpression {
|
|
328
|
-
private _expr;
|
|
329
|
-
__styleExpression: string;
|
|
330
|
-
constructor(_expr: string);
|
|
331
|
-
toString(): string;
|
|
332
|
-
}
|
|
333
|
-
declare function expr(expr: string): StyleExpression;
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* WARNING - this file is auto generated
|
|
337
|
-
*/
|
|
338
|
-
|
|
339
|
-
type MapLayerType = 'fill' | 'line' | 'symbol' | 'circle' | 'heatmap' | 'fill-extrusion' | 'raster' | 'hillshade' | 'background';
|
|
340
|
-
/**
|
|
341
|
-
* Style builder for 'fill' layers.
|
|
342
|
-
*/
|
|
343
|
-
declare class FillLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
344
|
-
/**
|
|
345
|
-
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
346
|
-
*
|
|
347
|
-
* @param value - fill-sort-key value
|
|
348
|
-
*/
|
|
349
|
-
fillSortKey(value: number | StyleExpression): this;
|
|
350
|
-
/**
|
|
351
|
-
* Whether or not the fill should be antialiased.
|
|
352
|
-
*
|
|
353
|
-
* @param value - fill-antialias value (default `true`)
|
|
354
|
-
*/
|
|
355
|
-
fillAntialias(value: boolean | StyleExpression): this;
|
|
356
|
-
/**
|
|
357
|
-
* The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
|
|
358
|
-
*
|
|
359
|
-
* @param value - fill-opacity value (default `1`)
|
|
360
|
-
*/
|
|
361
|
-
fillOpacity(value: number | StyleExpression): this;
|
|
362
|
-
/**
|
|
363
|
-
* The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
|
|
364
|
-
*
|
|
365
|
-
* @param value - fill-color value (default `#000000`)
|
|
366
|
-
*/
|
|
367
|
-
fillColor(value: string | StyleExpression): this;
|
|
368
|
-
/**
|
|
369
|
-
* The outline color of the fill. Matches the value of `fill-color` if unspecified.
|
|
370
|
-
*
|
|
371
|
-
* @param value - fill-outline-color value
|
|
372
|
-
*/
|
|
373
|
-
fillOutlineColor(value: string | StyleExpression): this;
|
|
374
|
-
/**
|
|
375
|
-
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
376
|
-
*
|
|
377
|
-
* @param value - fill-translate value in pixels (default `0,0`)
|
|
378
|
-
*/
|
|
379
|
-
fillTranslate(value: number[] | StyleExpression): this;
|
|
380
|
-
/**
|
|
381
|
-
* Controls the frame of reference for `fill-translate`.
|
|
382
|
-
*
|
|
383
|
-
* Values:
|
|
384
|
-
* - map: The fill is translated relative to the map.
|
|
385
|
-
* - viewport: The fill is translated relative to the viewport.
|
|
386
|
-
*
|
|
387
|
-
* @param value - fill-translate-anchor value (default `map`)
|
|
388
|
-
*/
|
|
389
|
-
fillTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
390
|
-
/**
|
|
391
|
-
* Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
392
|
-
*
|
|
393
|
-
* @param value - fill-pattern value
|
|
394
|
-
*/
|
|
395
|
-
fillPattern(value: string | StyleExpression): this;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Style builder for 'line' layers.
|
|
399
|
-
*/
|
|
400
|
-
declare class LineLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
401
|
-
/**
|
|
402
|
-
* The display of line endings.
|
|
403
|
-
*
|
|
404
|
-
* Values:
|
|
405
|
-
* - butt: A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
406
|
-
* - 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.
|
|
407
|
-
* - 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.
|
|
408
|
-
*
|
|
409
|
-
* @param value - line-cap value (default `butt`)
|
|
410
|
-
*/
|
|
411
|
-
lineCap(value: ('butt' | 'round' | 'square') | StyleExpression): this;
|
|
412
|
-
/**
|
|
413
|
-
* The display of lines when joining.
|
|
414
|
-
*
|
|
415
|
-
* Values:
|
|
416
|
-
* - 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.
|
|
417
|
-
* - 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.
|
|
418
|
-
* - miter: A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
419
|
-
*
|
|
420
|
-
* @param value - line-join value (default `miter`)
|
|
421
|
-
*/
|
|
422
|
-
lineJoin(value: ('bevel' | 'round' | 'miter') | StyleExpression): this;
|
|
423
|
-
/**
|
|
424
|
-
* Used to automatically convert miter joins to bevel joins for sharp angles.
|
|
425
|
-
*
|
|
426
|
-
* @param value - line-miter-limit value (default `2`)
|
|
427
|
-
*/
|
|
428
|
-
lineMiterLimit(value: number | StyleExpression): this;
|
|
429
|
-
/**
|
|
430
|
-
* Used to automatically convert round joins to miter joins for shallow angles.
|
|
431
|
-
*
|
|
432
|
-
* @param value - line-round-limit value (default `1.05`)
|
|
433
|
-
*/
|
|
434
|
-
lineRoundLimit(value: number | StyleExpression): this;
|
|
435
|
-
/**
|
|
436
|
-
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
437
|
-
*
|
|
438
|
-
* @param value - line-sort-key value
|
|
439
|
-
*/
|
|
440
|
-
lineSortKey(value: number | StyleExpression): this;
|
|
441
|
-
/**
|
|
442
|
-
* The opacity at which the line will be drawn.
|
|
443
|
-
*
|
|
444
|
-
* @param value - line-opacity value (default `1`)
|
|
445
|
-
*/
|
|
446
|
-
lineOpacity(value: number | StyleExpression): this;
|
|
447
|
-
/**
|
|
448
|
-
* The color with which the line will be drawn.
|
|
449
|
-
*
|
|
450
|
-
* @param value - line-color value (default `#000000`)
|
|
451
|
-
*/
|
|
452
|
-
lineColor(value: string | StyleExpression): this;
|
|
453
|
-
/**
|
|
454
|
-
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
455
|
-
*
|
|
456
|
-
* @param value - line-translate value in pixels (default `0,0`)
|
|
457
|
-
*/
|
|
458
|
-
lineTranslate(value: number[] | StyleExpression): this;
|
|
459
|
-
/**
|
|
460
|
-
* Controls the frame of reference for `line-translate`.
|
|
461
|
-
*
|
|
462
|
-
* Values:
|
|
463
|
-
* - map: The line is translated relative to the map.
|
|
464
|
-
* - viewport: The line is translated relative to the viewport.
|
|
465
|
-
*
|
|
466
|
-
* @param value - line-translate-anchor value (default `map`)
|
|
467
|
-
*/
|
|
468
|
-
lineTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
469
|
-
/**
|
|
470
|
-
* Stroke thickness.
|
|
471
|
-
*
|
|
472
|
-
* @param value - line-width value in pixels (default `1`)
|
|
473
|
-
*/
|
|
474
|
-
lineWidth(value: number | StyleExpression): this;
|
|
475
|
-
/**
|
|
476
|
-
* Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
|
|
477
|
-
*
|
|
478
|
-
* @param value - line-gap-width value in pixels
|
|
479
|
-
*/
|
|
480
|
-
lineGapWidth(value: number | StyleExpression): this;
|
|
481
|
-
/**
|
|
482
|
-
* The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
|
|
483
|
-
*
|
|
484
|
-
* @param value - line-offset value in pixels
|
|
485
|
-
*/
|
|
486
|
-
lineOffset(value: number | StyleExpression): this;
|
|
487
|
-
/**
|
|
488
|
-
* Blur applied to the line, in pixels.
|
|
489
|
-
*
|
|
490
|
-
* @param value - line-blur value in pixels
|
|
491
|
-
*/
|
|
492
|
-
lineBlur(value: number | StyleExpression): this;
|
|
493
|
-
/**
|
|
494
|
-
* Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
495
|
-
*
|
|
496
|
-
* @param value - line-dasharray value in line widths
|
|
497
|
-
*/
|
|
498
|
-
lineDasharray(value: number[] | StyleExpression): this;
|
|
499
|
-
/**
|
|
500
|
-
* Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
501
|
-
*
|
|
502
|
-
* @param value - line-pattern value
|
|
503
|
-
*/
|
|
504
|
-
linePattern(value: string | StyleExpression): this;
|
|
505
|
-
/**
|
|
506
|
-
* Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.
|
|
507
|
-
*
|
|
508
|
-
* @param value - line-gradient value
|
|
509
|
-
*/
|
|
510
|
-
lineGradient(value: string | StyleExpression): this;
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Style builder for 'symbol' layers.
|
|
514
|
-
*/
|
|
515
|
-
declare class SymbolLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
516
|
-
/**
|
|
517
|
-
* Label placement relative to its geometry.
|
|
518
|
-
*
|
|
519
|
-
* Values:
|
|
520
|
-
* - point: The label is placed at the point where the geometry is located.
|
|
521
|
-
* - line: The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
|
|
522
|
-
* - line-center: The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries.
|
|
523
|
-
*
|
|
524
|
-
* @param value - symbol-placement value (default `point`)
|
|
525
|
-
*/
|
|
526
|
-
symbolPlacement(value: ('point' | 'line' | 'line-center') | StyleExpression): this;
|
|
527
|
-
/**
|
|
528
|
-
* Distance between two symbol anchors.
|
|
529
|
-
*
|
|
530
|
-
* @param value - symbol-spacing value in pixels (default `250`)
|
|
531
|
-
*/
|
|
532
|
-
symbolSpacing(value: number | StyleExpression): this;
|
|
533
|
-
/**
|
|
534
|
-
* If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
|
|
535
|
-
*
|
|
536
|
-
* @param value - symbol-avoid-edges value
|
|
537
|
-
*/
|
|
538
|
-
symbolAvoidEdges(value: boolean | StyleExpression): this;
|
|
539
|
-
/**
|
|
540
|
-
* Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.
|
|
541
|
-
*
|
|
542
|
-
* @param value - symbol-sort-key value
|
|
543
|
-
*/
|
|
544
|
-
symbolSortKey(value: number | StyleExpression): this;
|
|
545
|
-
/**
|
|
546
|
-
* Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.
|
|
547
|
-
*
|
|
548
|
-
* Values:
|
|
549
|
-
* - auto: Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.
|
|
550
|
-
* - viewport-y: Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.
|
|
551
|
-
* - source: Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data.
|
|
552
|
-
*
|
|
553
|
-
* @param value - symbol-z-order value (default `auto`)
|
|
554
|
-
*/
|
|
555
|
-
symbolZOrder(value: ('auto' | 'viewport-y' | 'source') | StyleExpression): this;
|
|
556
|
-
/**
|
|
557
|
-
* If true, the icon will be visible even if it collides with other previously drawn symbols.
|
|
558
|
-
*
|
|
559
|
-
* @param value - icon-allow-overlap value
|
|
560
|
-
*/
|
|
561
|
-
iconAllowOverlap(value: boolean | StyleExpression): this;
|
|
562
|
-
/**
|
|
563
|
-
* Allows for control over whether to show an icon when it overlaps other symbols on the map. If `icon-overlap` is not set, `icon-allow-overlap` is used instead.
|
|
564
|
-
*
|
|
565
|
-
* Values:
|
|
566
|
-
* - never: The icon will be hidden if it collides with any other previously drawn symbol.
|
|
567
|
-
* - always: The icon will be visible even if it collides with any other previously drawn symbol.
|
|
568
|
-
* - cooperative: If the icon collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new icon is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new icon is visible.
|
|
569
|
-
*
|
|
570
|
-
* @param value - icon-overlap value
|
|
571
|
-
*/
|
|
572
|
-
iconOverlap(value: ('never' | 'always' | 'cooperative') | StyleExpression): this;
|
|
573
|
-
/**
|
|
574
|
-
* If true, other symbols can be visible even if they collide with the icon.
|
|
575
|
-
*
|
|
576
|
-
* @param value - icon-ignore-placement value
|
|
577
|
-
*/
|
|
578
|
-
iconIgnorePlacement(value: boolean | StyleExpression): this;
|
|
579
|
-
/**
|
|
580
|
-
* If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
|
|
581
|
-
*
|
|
582
|
-
* @param value - icon-optional value
|
|
583
|
-
*/
|
|
584
|
-
iconOptional(value: boolean | StyleExpression): this;
|
|
585
|
-
/**
|
|
586
|
-
* In combination with `symbol-placement`, determines the rotation behavior of icons.
|
|
587
|
-
*
|
|
588
|
-
* Values:
|
|
589
|
-
* - map: When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line.
|
|
590
|
-
* - viewport: Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
|
|
591
|
-
* - auto: When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.
|
|
592
|
-
*
|
|
593
|
-
* @param value - icon-rotation-alignment value (default `auto`)
|
|
594
|
-
*/
|
|
595
|
-
iconRotationAlignment(value: ('map' | 'viewport' | 'auto') | StyleExpression): this;
|
|
596
|
-
/**
|
|
597
|
-
* Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.
|
|
598
|
-
*
|
|
599
|
-
* @param value - icon-size value in factor of the original icon size (default `1`)
|
|
600
|
-
*/
|
|
601
|
-
iconSize(value: number | StyleExpression): this;
|
|
602
|
-
/**
|
|
603
|
-
* Scales the icon to fit around the associated text.
|
|
604
|
-
*
|
|
605
|
-
* Values:
|
|
606
|
-
* - none: The icon is displayed at its intrinsic aspect ratio.
|
|
607
|
-
* - width: The icon is scaled in the x-dimension to fit the width of the text.
|
|
608
|
-
* - height: The icon is scaled in the y-dimension to fit the height of the text.
|
|
609
|
-
* - both: The icon is scaled in both x- and y-dimensions.
|
|
610
|
-
*
|
|
611
|
-
* @param value - icon-text-fit value (default `none`)
|
|
612
|
-
*/
|
|
613
|
-
iconTextFit(value: ('none' | 'width' | 'height' | 'both') | StyleExpression): this;
|
|
614
|
-
/**
|
|
615
|
-
* Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.
|
|
616
|
-
*
|
|
617
|
-
* @param value - icon-text-fit-padding value in pixels (default `0,0,0,0`)
|
|
618
|
-
*/
|
|
619
|
-
iconTextFitPadding(value: number[] | StyleExpression): this;
|
|
620
|
-
/**
|
|
621
|
-
* Name of image in sprite to use for drawing an image background.
|
|
622
|
-
*
|
|
623
|
-
* @param value - icon-image value
|
|
624
|
-
*/
|
|
625
|
-
iconImage(value: string | StyleExpression): this;
|
|
626
|
-
/**
|
|
627
|
-
* Rotates the icon clockwise.
|
|
628
|
-
*
|
|
629
|
-
* @param value - icon-rotate value in degrees
|
|
630
|
-
*/
|
|
631
|
-
iconRotate(value: number | StyleExpression): this;
|
|
632
|
-
/**
|
|
633
|
-
* Size of additional area round the icon bounding box used for detecting symbol collisions. Values are declared using CSS margin shorthand syntax: a single value applies to all four sides; two values apply to [top/bottom, left/right]; three values apply to [top, left/right, bottom]; four values apply to [top, right, bottom, left]. For backwards compatibility, a single bare number is accepted, and treated the same as a one-element array - padding applied to all sides.
|
|
634
|
-
*
|
|
635
|
-
* @param value - icon-padding value in pixels (default `2`)
|
|
636
|
-
*/
|
|
637
|
-
iconPadding(value: string | StyleExpression): this;
|
|
638
|
-
/**
|
|
639
|
-
* If true, the icon may be flipped to prevent it from being rendered upside-down.
|
|
640
|
-
*
|
|
641
|
-
* @param value - icon-keep-upright value
|
|
642
|
-
*/
|
|
643
|
-
iconKeepUpright(value: boolean | StyleExpression): this;
|
|
644
|
-
/**
|
|
645
|
-
* Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.
|
|
646
|
-
*
|
|
647
|
-
* @param value - icon-offset value (default `0,0`)
|
|
648
|
-
*/
|
|
649
|
-
iconOffset(value: number[] | StyleExpression): this;
|
|
650
|
-
/**
|
|
651
|
-
* Part of the icon placed closest to the anchor.
|
|
652
|
-
*
|
|
653
|
-
* Values:
|
|
654
|
-
* - center: The center of the icon is placed closest to the anchor.
|
|
655
|
-
* - left: The left side of the icon is placed closest to the anchor.
|
|
656
|
-
* - right: The right side of the icon is placed closest to the anchor.
|
|
657
|
-
* - top: The top of the icon is placed closest to the anchor.
|
|
658
|
-
* - bottom: The bottom of the icon is placed closest to the anchor.
|
|
659
|
-
* - top-left: The top left corner of the icon is placed closest to the anchor.
|
|
660
|
-
* - top-right: The top right corner of the icon is placed closest to the anchor.
|
|
661
|
-
* - bottom-left: The bottom left corner of the icon is placed closest to the anchor.
|
|
662
|
-
* - bottom-right: The bottom right corner of the icon is placed closest to the anchor.
|
|
663
|
-
*
|
|
664
|
-
* @param value - icon-anchor value (default `center`)
|
|
665
|
-
*/
|
|
666
|
-
iconAnchor(value: ('center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right') | StyleExpression): this;
|
|
667
|
-
/**
|
|
668
|
-
* Orientation of icon when map is pitched.
|
|
669
|
-
*
|
|
670
|
-
* Values:
|
|
671
|
-
* - map: The icon is aligned to the plane of the map.
|
|
672
|
-
* - viewport: The icon is aligned to the plane of the viewport.
|
|
673
|
-
* - auto: Automatically matches the value of `icon-rotation-alignment`.
|
|
674
|
-
*
|
|
675
|
-
* @param value - icon-pitch-alignment value (default `auto`)
|
|
676
|
-
*/
|
|
677
|
-
iconPitchAlignment(value: ('map' | 'viewport' | 'auto') | StyleExpression): this;
|
|
678
|
-
/**
|
|
679
|
-
* Orientation of text when map is pitched.
|
|
680
|
-
*
|
|
681
|
-
* Values:
|
|
682
|
-
* - map: The text is aligned to the plane of the map.
|
|
683
|
-
* - viewport: The text is aligned to the plane of the viewport.
|
|
684
|
-
* - auto: Automatically matches the value of `text-rotation-alignment`.
|
|
685
|
-
*
|
|
686
|
-
* @param value - text-pitch-alignment value (default `auto`)
|
|
687
|
-
*/
|
|
688
|
-
textPitchAlignment(value: ('map' | 'viewport' | 'auto') | StyleExpression): this;
|
|
689
|
-
/**
|
|
690
|
-
* In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
|
|
691
|
-
*
|
|
692
|
-
* Values:
|
|
693
|
-
* - map: When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line.
|
|
694
|
-
* - viewport: Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
|
|
695
|
-
* - viewport-glyph: When `symbol-placement` is set to `point`, aligns text to the x-axis of the viewport. When `symbol-placement` is set to `line` or `line-center`, aligns glyphs to the x-axis of the viewport and places them along the line.
|
|
696
|
-
* - auto: When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.
|
|
697
|
-
*
|
|
698
|
-
* @param value - text-rotation-alignment value (default `auto`)
|
|
699
|
-
*/
|
|
700
|
-
textRotationAlignment(value: ('map' | 'viewport' | 'viewport-glyph' | 'auto') | StyleExpression): this;
|
|
701
|
-
/**
|
|
702
|
-
* Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
|
|
703
|
-
*
|
|
704
|
-
* @param value - text-field value
|
|
705
|
-
*/
|
|
706
|
-
textField(value: string | StyleExpression): this;
|
|
707
|
-
/**
|
|
708
|
-
* Font stack to use for displaying text.
|
|
709
|
-
*
|
|
710
|
-
* @param value - text-font value (default `Open Sans Regular,Arial Unicode MS Regular`)
|
|
711
|
-
*/
|
|
712
|
-
textFont(value: string[] | StyleExpression): this;
|
|
713
|
-
/**
|
|
714
|
-
* Font size.
|
|
715
|
-
*
|
|
716
|
-
* @param value - text-size value in pixels (default `16`)
|
|
717
|
-
*/
|
|
718
|
-
textSize(value: number | StyleExpression): this;
|
|
719
|
-
/**
|
|
720
|
-
* The maximum line width for text wrapping.
|
|
721
|
-
*
|
|
722
|
-
* @param value - text-max-width value in ems (default `10`)
|
|
723
|
-
*/
|
|
724
|
-
textMaxWidth(value: number | StyleExpression): this;
|
|
725
|
-
/**
|
|
726
|
-
* Text leading value for multi-line text.
|
|
727
|
-
*
|
|
728
|
-
* @param value - text-line-height value in ems (default `1.2`)
|
|
729
|
-
*/
|
|
730
|
-
textLineHeight(value: number | StyleExpression): this;
|
|
731
|
-
/**
|
|
732
|
-
* Text tracking amount.
|
|
733
|
-
*
|
|
734
|
-
* @param value - text-letter-spacing value in ems
|
|
735
|
-
*/
|
|
736
|
-
textLetterSpacing(value: number | StyleExpression): this;
|
|
737
|
-
/**
|
|
738
|
-
* Text justification options.
|
|
739
|
-
*
|
|
740
|
-
* Values:
|
|
741
|
-
* - auto: The text is aligned towards the anchor position.
|
|
742
|
-
* - left: The text is aligned to the left.
|
|
743
|
-
* - center: The text is centered.
|
|
744
|
-
* - right: The text is aligned to the right.
|
|
745
|
-
*
|
|
746
|
-
* @param value - text-justify value (default `center`)
|
|
747
|
-
*/
|
|
748
|
-
textJustify(value: ('auto' | 'left' | 'center' | 'right') | StyleExpression): this;
|
|
749
|
-
/**
|
|
750
|
-
* Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.
|
|
751
|
-
*
|
|
752
|
-
* @param value - text-radial-offset value in ems
|
|
753
|
-
*/
|
|
754
|
-
textRadialOffset(value: number | StyleExpression): this;
|
|
755
|
-
/**
|
|
756
|
-
* To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.
|
|
757
|
-
*
|
|
758
|
-
* Values:
|
|
759
|
-
* - center: The center of the text is placed closest to the anchor.
|
|
760
|
-
* - left: The left side of the text is placed closest to the anchor.
|
|
761
|
-
* - right: The right side of the text is placed closest to the anchor.
|
|
762
|
-
* - top: The top of the text is placed closest to the anchor.
|
|
763
|
-
* - bottom: The bottom of the text is placed closest to the anchor.
|
|
764
|
-
* - top-left: The top left corner of the text is placed closest to the anchor.
|
|
765
|
-
* - top-right: The top right corner of the text is placed closest to the anchor.
|
|
766
|
-
* - bottom-left: The bottom left corner of the text is placed closest to the anchor.
|
|
767
|
-
* - bottom-right: The bottom right corner of the text is placed closest to the anchor.
|
|
768
|
-
*
|
|
769
|
-
* @param value - text-variable-anchor value
|
|
770
|
-
*/
|
|
771
|
-
textVariableAnchor(value: ('center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right')[] | StyleExpression): this;
|
|
772
|
-
/**
|
|
773
|
-
* To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use `text-justify: auto` to choose justification based on anchor position.
|
|
774
|
-
|
|
775
|
-
The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.
|
|
776
|
-
|
|
777
|
-
When present, this property takes precedence over `text-anchor`, `text-variable-anchor`, `text-offset`, and `text-radial-offset`.
|
|
778
|
-
|
|
779
|
-
```json
|
|
780
|
-
{ "text-variable-anchor-offset": ["top", [0, 4], "left", [3,0], "bottom", [1, 1]] }
|
|
781
|
-
```
|
|
782
|
-
|
|
783
|
-
When the renderer chooses the `top` anchor, `[0, 4]` will be used for `text-offset`; the text will be shifted down by 4 ems.
|
|
784
|
-
|
|
785
|
-
When the renderer chooses the `left` anchor, `[3, 0]` will be used for `text-offset`; the text will be shifted right by 3 ems.
|
|
786
|
-
*
|
|
787
|
-
* @param value - text-variable-anchor-offset value
|
|
788
|
-
*/
|
|
789
|
-
textVariableAnchorOffset(value: string | StyleExpression): this;
|
|
790
|
-
/**
|
|
791
|
-
* Part of the text placed closest to the anchor.
|
|
792
|
-
*
|
|
793
|
-
* Values:
|
|
794
|
-
* - center: The center of the text is placed closest to the anchor.
|
|
795
|
-
* - left: The left side of the text is placed closest to the anchor.
|
|
796
|
-
* - right: The right side of the text is placed closest to the anchor.
|
|
797
|
-
* - top: The top of the text is placed closest to the anchor.
|
|
798
|
-
* - bottom: The bottom of the text is placed closest to the anchor.
|
|
799
|
-
* - top-left: The top left corner of the text is placed closest to the anchor.
|
|
800
|
-
* - top-right: The top right corner of the text is placed closest to the anchor.
|
|
801
|
-
* - bottom-left: The bottom left corner of the text is placed closest to the anchor.
|
|
802
|
-
* - bottom-right: The bottom right corner of the text is placed closest to the anchor.
|
|
803
|
-
*
|
|
804
|
-
* @param value - text-anchor value (default `center`)
|
|
805
|
-
*/
|
|
806
|
-
textAnchor(value: ('center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right') | StyleExpression): this;
|
|
807
|
-
/**
|
|
808
|
-
* Maximum angle change between adjacent characters.
|
|
809
|
-
*
|
|
810
|
-
* @param value - text-max-angle value in degrees (default `45`)
|
|
811
|
-
*/
|
|
812
|
-
textMaxAngle(value: number | StyleExpression): this;
|
|
813
|
-
/**
|
|
814
|
-
* The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
|
|
815
|
-
*
|
|
816
|
-
* Values:
|
|
817
|
-
* - horizontal: If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally.
|
|
818
|
-
* - vertical: If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically.
|
|
819
|
-
*
|
|
820
|
-
* @param value - text-writing-mode value
|
|
821
|
-
*/
|
|
822
|
-
textWritingMode(value: ('horizontal' | 'vertical')[] | StyleExpression): this;
|
|
823
|
-
/**
|
|
824
|
-
* Rotates the text clockwise.
|
|
825
|
-
*
|
|
826
|
-
* @param value - text-rotate value in degrees
|
|
827
|
-
*/
|
|
828
|
-
textRotate(value: number | StyleExpression): this;
|
|
829
|
-
/**
|
|
830
|
-
* Size of the additional area around the text bounding box used for detecting symbol collisions.
|
|
831
|
-
*
|
|
832
|
-
* @param value - text-padding value in pixels (default `2`)
|
|
833
|
-
*/
|
|
834
|
-
textPadding(value: number | StyleExpression): this;
|
|
835
|
-
/**
|
|
836
|
-
* If true, the text may be flipped vertically to prevent it from being rendered upside-down.
|
|
837
|
-
*
|
|
838
|
-
* @param value - text-keep-upright value (default `true`)
|
|
839
|
-
*/
|
|
840
|
-
textKeepUpright(value: boolean | StyleExpression): this;
|
|
841
|
-
/**
|
|
842
|
-
* Specifies how to capitalize text, similar to the CSS `text-transform` property.
|
|
843
|
-
*
|
|
844
|
-
* Values:
|
|
845
|
-
* - none: The text is not altered.
|
|
846
|
-
* - uppercase: Forces all letters to be displayed in uppercase.
|
|
847
|
-
* - lowercase: Forces all letters to be displayed in lowercase.
|
|
848
|
-
*
|
|
849
|
-
* @param value - text-transform value (default `none`)
|
|
850
|
-
*/
|
|
851
|
-
textTransform(value: ('none' | 'uppercase' | 'lowercase') | StyleExpression): this;
|
|
852
|
-
/**
|
|
853
|
-
* Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.
|
|
854
|
-
*
|
|
855
|
-
* @param value - text-offset value in ems (default `0,0`)
|
|
856
|
-
*/
|
|
857
|
-
textOffset(value: number[] | StyleExpression): this;
|
|
858
|
-
/**
|
|
859
|
-
* If true, the text will be visible even if it collides with other previously drawn symbols.
|
|
860
|
-
*
|
|
861
|
-
* @param value - text-allow-overlap value
|
|
862
|
-
*/
|
|
863
|
-
textAllowOverlap(value: boolean | StyleExpression): this;
|
|
864
|
-
/**
|
|
865
|
-
* Allows for control over whether to show symbol text when it overlaps other symbols on the map. If `text-overlap` is not set, `text-allow-overlap` is used instead
|
|
866
|
-
*
|
|
867
|
-
* Values:
|
|
868
|
-
* - never: The text will be hidden if it collides with any other previously drawn symbol.
|
|
869
|
-
* - always: The text will be visible even if it collides with any other previously drawn symbol.
|
|
870
|
-
* - cooperative: If the text collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new text is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new text is visible.
|
|
871
|
-
*
|
|
872
|
-
* @param value - text-overlap value
|
|
873
|
-
*/
|
|
874
|
-
textOverlap(value: ('never' | 'always' | 'cooperative') | StyleExpression): this;
|
|
875
|
-
/**
|
|
876
|
-
* If true, other symbols can be visible even if they collide with the text.
|
|
877
|
-
*
|
|
878
|
-
* @param value - text-ignore-placement value
|
|
879
|
-
*/
|
|
880
|
-
textIgnorePlacement(value: boolean | StyleExpression): this;
|
|
881
|
-
/**
|
|
882
|
-
* If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
|
|
883
|
-
*
|
|
884
|
-
* @param value - text-optional value
|
|
885
|
-
*/
|
|
886
|
-
textOptional(value: boolean | StyleExpression): this;
|
|
887
|
-
/**
|
|
888
|
-
* The opacity at which the icon will be drawn.
|
|
889
|
-
*
|
|
890
|
-
* @param value - icon-opacity value (default `1`)
|
|
891
|
-
*/
|
|
892
|
-
iconOpacity(value: number | StyleExpression): this;
|
|
893
|
-
/**
|
|
894
|
-
* The color of the icon. This can only be used with sdf icons.
|
|
895
|
-
*
|
|
896
|
-
* @param value - icon-color value (default `#000000`)
|
|
897
|
-
*/
|
|
898
|
-
iconColor(value: string | StyleExpression): this;
|
|
899
|
-
/**
|
|
900
|
-
* The color of the icon's halo. Icon halos can only be used with SDF icons.
|
|
901
|
-
*
|
|
902
|
-
* @param value - icon-halo-color value (default `rgba(0, 0, 0, 0)`)
|
|
903
|
-
*/
|
|
904
|
-
iconHaloColor(value: string | StyleExpression): this;
|
|
905
|
-
/**
|
|
906
|
-
* Distance of halo to the icon outline.
|
|
907
|
-
*
|
|
908
|
-
* @param value - icon-halo-width value in pixels
|
|
909
|
-
*/
|
|
910
|
-
iconHaloWidth(value: number | StyleExpression): this;
|
|
911
|
-
/**
|
|
912
|
-
* Fade out the halo towards the outside.
|
|
913
|
-
*
|
|
914
|
-
* @param value - icon-halo-blur value in pixels
|
|
915
|
-
*/
|
|
916
|
-
iconHaloBlur(value: number | StyleExpression): this;
|
|
917
|
-
/**
|
|
918
|
-
* Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
|
|
919
|
-
*
|
|
920
|
-
* @param value - icon-translate value in pixels (default `0,0`)
|
|
921
|
-
*/
|
|
922
|
-
iconTranslate(value: number[] | StyleExpression): this;
|
|
923
|
-
/**
|
|
924
|
-
* Controls the frame of reference for `icon-translate`.
|
|
925
|
-
*
|
|
926
|
-
* Values:
|
|
927
|
-
* - map: Icons are translated relative to the map.
|
|
928
|
-
* - viewport: Icons are translated relative to the viewport.
|
|
929
|
-
*
|
|
930
|
-
* @param value - icon-translate-anchor value (default `map`)
|
|
931
|
-
*/
|
|
932
|
-
iconTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
933
|
-
/**
|
|
934
|
-
* The opacity at which the text will be drawn.
|
|
935
|
-
*
|
|
936
|
-
* @param value - text-opacity value (default `1`)
|
|
937
|
-
*/
|
|
938
|
-
textOpacity(value: number | StyleExpression): this;
|
|
939
|
-
/**
|
|
940
|
-
* The color with which the text will be drawn.
|
|
941
|
-
*
|
|
942
|
-
* @param value - text-color value (default `#000000`)
|
|
943
|
-
*/
|
|
944
|
-
textColor(value: string | StyleExpression): this;
|
|
945
|
-
/**
|
|
946
|
-
* The color of the text's halo, which helps it stand out from backgrounds.
|
|
947
|
-
*
|
|
948
|
-
* @param value - text-halo-color value (default `rgba(0, 0, 0, 0)`)
|
|
949
|
-
*/
|
|
950
|
-
textHaloColor(value: string | StyleExpression): this;
|
|
951
|
-
/**
|
|
952
|
-
* Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
|
|
953
|
-
*
|
|
954
|
-
* @param value - text-halo-width value in pixels
|
|
955
|
-
*/
|
|
956
|
-
textHaloWidth(value: number | StyleExpression): this;
|
|
957
|
-
/**
|
|
958
|
-
* The halo's fadeout distance towards the outside.
|
|
959
|
-
*
|
|
960
|
-
* @param value - text-halo-blur value in pixels
|
|
961
|
-
*/
|
|
962
|
-
textHaloBlur(value: number | StyleExpression): this;
|
|
963
|
-
/**
|
|
964
|
-
* Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
|
|
965
|
-
*
|
|
966
|
-
* @param value - text-translate value in pixels (default `0,0`)
|
|
967
|
-
*/
|
|
968
|
-
textTranslate(value: number[] | StyleExpression): this;
|
|
969
|
-
/**
|
|
970
|
-
* Controls the frame of reference for `text-translate`.
|
|
971
|
-
*
|
|
972
|
-
* Values:
|
|
973
|
-
* - map: The text is translated relative to the map.
|
|
974
|
-
* - viewport: The text is translated relative to the viewport.
|
|
975
|
-
*
|
|
976
|
-
* @param value - text-translate-anchor value (default `map`)
|
|
977
|
-
*/
|
|
978
|
-
textTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Style builder for 'circle' layers.
|
|
982
|
-
*/
|
|
983
|
-
declare class CircleLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
984
|
-
/**
|
|
985
|
-
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
986
|
-
*
|
|
987
|
-
* @param value - circle-sort-key value
|
|
988
|
-
*/
|
|
989
|
-
circleSortKey(value: number | StyleExpression): this;
|
|
990
|
-
/**
|
|
991
|
-
* Circle radius.
|
|
992
|
-
*
|
|
993
|
-
* @param value - circle-radius value in pixels (default `5`)
|
|
994
|
-
*/
|
|
995
|
-
circleRadius(value: number | StyleExpression): this;
|
|
996
|
-
/**
|
|
997
|
-
* The fill color of the circle.
|
|
998
|
-
*
|
|
999
|
-
* @param value - circle-color value (default `#000000`)
|
|
1000
|
-
*/
|
|
1001
|
-
circleColor(value: string | StyleExpression): this;
|
|
1002
|
-
/**
|
|
1003
|
-
* Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
|
|
1004
|
-
*
|
|
1005
|
-
* @param value - circle-blur value
|
|
1006
|
-
*/
|
|
1007
|
-
circleBlur(value: number | StyleExpression): this;
|
|
1008
|
-
/**
|
|
1009
|
-
* The opacity at which the circle will be drawn.
|
|
1010
|
-
*
|
|
1011
|
-
* @param value - circle-opacity value (default `1`)
|
|
1012
|
-
*/
|
|
1013
|
-
circleOpacity(value: number | StyleExpression): this;
|
|
1014
|
-
/**
|
|
1015
|
-
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
1016
|
-
*
|
|
1017
|
-
* @param value - circle-translate value in pixels (default `0,0`)
|
|
1018
|
-
*/
|
|
1019
|
-
circleTranslate(value: number[] | StyleExpression): this;
|
|
1020
|
-
/**
|
|
1021
|
-
* Controls the frame of reference for `circle-translate`.
|
|
1022
|
-
*
|
|
1023
|
-
* Values:
|
|
1024
|
-
* - map: The circle is translated relative to the map.
|
|
1025
|
-
* - viewport: The circle is translated relative to the viewport.
|
|
1026
|
-
*
|
|
1027
|
-
* @param value - circle-translate-anchor value (default `map`)
|
|
1028
|
-
*/
|
|
1029
|
-
circleTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
1030
|
-
/**
|
|
1031
|
-
* Controls the scaling behavior of the circle when the map is pitched.
|
|
1032
|
-
*
|
|
1033
|
-
* Values:
|
|
1034
|
-
* - map: Circles are scaled according to their apparent distance to the camera.
|
|
1035
|
-
* - viewport: Circles are not scaled.
|
|
1036
|
-
*
|
|
1037
|
-
* @param value - circle-pitch-scale value (default `map`)
|
|
1038
|
-
*/
|
|
1039
|
-
circlePitchScale(value: ('map' | 'viewport') | StyleExpression): this;
|
|
1040
|
-
/**
|
|
1041
|
-
* Orientation of circle when map is pitched.
|
|
1042
|
-
*
|
|
1043
|
-
* Values:
|
|
1044
|
-
* - map: The circle is aligned to the plane of the map.
|
|
1045
|
-
* - viewport: The circle is aligned to the plane of the viewport.
|
|
1046
|
-
*
|
|
1047
|
-
* @param value - circle-pitch-alignment value (default `viewport`)
|
|
1048
|
-
*/
|
|
1049
|
-
circlePitchAlignment(value: ('map' | 'viewport') | StyleExpression): this;
|
|
1050
|
-
/**
|
|
1051
|
-
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
|
|
1052
|
-
*
|
|
1053
|
-
* @param value - circle-stroke-width value in pixels
|
|
1054
|
-
*/
|
|
1055
|
-
circleStrokeWidth(value: number | StyleExpression): this;
|
|
1056
|
-
/**
|
|
1057
|
-
* The stroke color of the circle.
|
|
1058
|
-
*
|
|
1059
|
-
* @param value - circle-stroke-color value (default `#000000`)
|
|
1060
|
-
*/
|
|
1061
|
-
circleStrokeColor(value: string | StyleExpression): this;
|
|
1062
|
-
/**
|
|
1063
|
-
* The opacity of the circle's stroke.
|
|
1064
|
-
*
|
|
1065
|
-
* @param value - circle-stroke-opacity value (default `1`)
|
|
1066
|
-
*/
|
|
1067
|
-
circleStrokeOpacity(value: number | StyleExpression): this;
|
|
1068
|
-
}
|
|
1069
|
-
/**
|
|
1070
|
-
* Style builder for 'heatmap' layers.
|
|
1071
|
-
*/
|
|
1072
|
-
declare class HeatmapLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1073
|
-
/**
|
|
1074
|
-
* Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.
|
|
1075
|
-
*
|
|
1076
|
-
* @param value - heatmap-radius value in pixels (default `30`)
|
|
1077
|
-
*/
|
|
1078
|
-
heatmapRadius(value: number | StyleExpression): this;
|
|
1079
|
-
/**
|
|
1080
|
-
* A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.
|
|
1081
|
-
*
|
|
1082
|
-
* @param value - heatmap-weight value (default `1`)
|
|
1083
|
-
*/
|
|
1084
|
-
heatmapWeight(value: number | StyleExpression): this;
|
|
1085
|
-
/**
|
|
1086
|
-
* Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
|
|
1087
|
-
*
|
|
1088
|
-
* @param value - heatmap-intensity value (default `1`)
|
|
1089
|
-
*/
|
|
1090
|
-
heatmapIntensity(value: number | StyleExpression): this;
|
|
1091
|
-
/**
|
|
1092
|
-
* Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
|
|
1093
|
-
*
|
|
1094
|
-
* @param value - heatmap-color value (default `interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red`)
|
|
1095
|
-
*/
|
|
1096
|
-
heatmapColor(value: string | StyleExpression): this;
|
|
1097
|
-
/**
|
|
1098
|
-
* The global opacity at which the heatmap layer will be drawn.
|
|
1099
|
-
*
|
|
1100
|
-
* @param value - heatmap-opacity value (default `1`)
|
|
1101
|
-
*/
|
|
1102
|
-
heatmapOpacity(value: number | StyleExpression): this;
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* Style builder for 'fill-extrusion' layers.
|
|
1106
|
-
*/
|
|
1107
|
-
declare class FillExtrusionLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1108
|
-
/**
|
|
1109
|
-
* The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.
|
|
1110
|
-
*
|
|
1111
|
-
* @param value - fill-extrusion-opacity value (default `1`)
|
|
1112
|
-
*/
|
|
1113
|
-
fillExtrusionOpacity(value: number | StyleExpression): this;
|
|
1114
|
-
/**
|
|
1115
|
-
* The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.
|
|
1116
|
-
*
|
|
1117
|
-
* @param value - fill-extrusion-color value (default `#000000`)
|
|
1118
|
-
*/
|
|
1119
|
-
fillExtrusionColor(value: string | StyleExpression): this;
|
|
1120
|
-
/**
|
|
1121
|
-
* The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
|
|
1122
|
-
*
|
|
1123
|
-
* @param value - fill-extrusion-translate value in pixels (default `0,0`)
|
|
1124
|
-
*/
|
|
1125
|
-
fillExtrusionTranslate(value: number[] | StyleExpression): this;
|
|
1126
|
-
/**
|
|
1127
|
-
* Controls the frame of reference for `fill-extrusion-translate`.
|
|
1128
|
-
*
|
|
1129
|
-
* Values:
|
|
1130
|
-
* - map: The fill extrusion is translated relative to the map.
|
|
1131
|
-
* - viewport: The fill extrusion is translated relative to the viewport.
|
|
1132
|
-
*
|
|
1133
|
-
* @param value - fill-extrusion-translate-anchor value (default `map`)
|
|
1134
|
-
*/
|
|
1135
|
-
fillExtrusionTranslateAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
1136
|
-
/**
|
|
1137
|
-
* Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
1138
|
-
*
|
|
1139
|
-
* @param value - fill-extrusion-pattern value
|
|
1140
|
-
*/
|
|
1141
|
-
fillExtrusionPattern(value: string | StyleExpression): this;
|
|
1142
|
-
/**
|
|
1143
|
-
* The height with which to extrude this layer.
|
|
1144
|
-
*
|
|
1145
|
-
* @param value - fill-extrusion-height value in meters
|
|
1146
|
-
*/
|
|
1147
|
-
fillExtrusionHeight(value: number | StyleExpression): this;
|
|
1148
|
-
/**
|
|
1149
|
-
* The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.
|
|
1150
|
-
*
|
|
1151
|
-
* @param value - fill-extrusion-base value in meters
|
|
1152
|
-
*/
|
|
1153
|
-
fillExtrusionBase(value: number | StyleExpression): this;
|
|
1154
|
-
/**
|
|
1155
|
-
* Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.
|
|
1156
|
-
*
|
|
1157
|
-
* @param value - fill-extrusion-vertical-gradient value (default `true`)
|
|
1158
|
-
*/
|
|
1159
|
-
fillExtrusionVerticalGradient(value: boolean | StyleExpression): this;
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Style builder for 'raster' layers.
|
|
1163
|
-
*/
|
|
1164
|
-
declare class RasterLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1165
|
-
/**
|
|
1166
|
-
* The opacity at which the image will be drawn.
|
|
1167
|
-
*
|
|
1168
|
-
* @param value - raster-opacity value (default `1`)
|
|
1169
|
-
*/
|
|
1170
|
-
rasterOpacity(value: number | StyleExpression): this;
|
|
1171
|
-
/**
|
|
1172
|
-
* Rotates hues around the color wheel.
|
|
1173
|
-
*
|
|
1174
|
-
* @param value - raster-hue-rotate value in degrees
|
|
1175
|
-
*/
|
|
1176
|
-
rasterHueRotate(value: number | StyleExpression): this;
|
|
1177
|
-
/**
|
|
1178
|
-
* Increase or reduce the brightness of the image. The value is the minimum brightness.
|
|
1179
|
-
*
|
|
1180
|
-
* @param value - raster-brightness-min value
|
|
1181
|
-
*/
|
|
1182
|
-
rasterBrightnessMin(value: number | StyleExpression): this;
|
|
1183
|
-
/**
|
|
1184
|
-
* Increase or reduce the brightness of the image. The value is the maximum brightness.
|
|
1185
|
-
*
|
|
1186
|
-
* @param value - raster-brightness-max value (default `1`)
|
|
1187
|
-
*/
|
|
1188
|
-
rasterBrightnessMax(value: number | StyleExpression): this;
|
|
1189
|
-
/**
|
|
1190
|
-
* Increase or reduce the saturation of the image.
|
|
1191
|
-
*
|
|
1192
|
-
* @param value - raster-saturation value
|
|
1193
|
-
*/
|
|
1194
|
-
rasterSaturation(value: number | StyleExpression): this;
|
|
1195
|
-
/**
|
|
1196
|
-
* Increase or reduce the contrast of the image.
|
|
1197
|
-
*
|
|
1198
|
-
* @param value - raster-contrast value
|
|
1199
|
-
*/
|
|
1200
|
-
rasterContrast(value: number | StyleExpression): this;
|
|
1201
|
-
/**
|
|
1202
|
-
* The resampling/interpolation method to use for overscaling, also known as texture magnification filter
|
|
1203
|
-
*
|
|
1204
|
-
* Values:
|
|
1205
|
-
* - linear: (Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled
|
|
1206
|
-
* - nearest: Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled
|
|
1207
|
-
*
|
|
1208
|
-
* @param value - raster-resampling value (default `linear`)
|
|
1209
|
-
*/
|
|
1210
|
-
rasterResampling(value: ('linear' | 'nearest') | StyleExpression): this;
|
|
1211
|
-
/**
|
|
1212
|
-
* Fade duration when a new tile is added.
|
|
1213
|
-
*
|
|
1214
|
-
* @param value - raster-fade-duration value in milliseconds (default `300`)
|
|
1215
|
-
*/
|
|
1216
|
-
rasterFadeDuration(value: number | StyleExpression): this;
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* Style builder for 'hillshade' layers.
|
|
1220
|
-
*/
|
|
1221
|
-
declare class HillshadeLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1222
|
-
/**
|
|
1223
|
-
* The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.
|
|
1224
|
-
*
|
|
1225
|
-
* @param value - hillshade-illumination-direction value (default `335`)
|
|
1226
|
-
*/
|
|
1227
|
-
hillshadeIlluminationDirection(value: number | StyleExpression): this;
|
|
1228
|
-
/**
|
|
1229
|
-
* Direction of light source when map is rotated.
|
|
1230
|
-
*
|
|
1231
|
-
* Values:
|
|
1232
|
-
* - map: The hillshade illumination is relative to the north direction.
|
|
1233
|
-
* - viewport: The hillshade illumination is relative to the top of the viewport.
|
|
1234
|
-
*
|
|
1235
|
-
* @param value - hillshade-illumination-anchor value (default `viewport`)
|
|
1236
|
-
*/
|
|
1237
|
-
hillshadeIlluminationAnchor(value: ('map' | 'viewport') | StyleExpression): this;
|
|
1238
|
-
/**
|
|
1239
|
-
* Intensity of the hillshade
|
|
1240
|
-
*
|
|
1241
|
-
* @param value - hillshade-exaggeration value (default `0.5`)
|
|
1242
|
-
*/
|
|
1243
|
-
hillshadeExaggeration(value: number | StyleExpression): this;
|
|
1244
|
-
/**
|
|
1245
|
-
* The shading color of areas that face away from the light source.
|
|
1246
|
-
*
|
|
1247
|
-
* @param value - hillshade-shadow-color value (default `#000000`)
|
|
1248
|
-
*/
|
|
1249
|
-
hillshadeShadowColor(value: string | StyleExpression): this;
|
|
1250
|
-
/**
|
|
1251
|
-
* The shading color of areas that faces towards the light source.
|
|
1252
|
-
*
|
|
1253
|
-
* @param value - hillshade-highlight-color value (default `#FFFFFF`)
|
|
1254
|
-
*/
|
|
1255
|
-
hillshadeHighlightColor(value: string | StyleExpression): this;
|
|
1256
|
-
/**
|
|
1257
|
-
* The shading color used to accentuate rugged terrain like sharp cliffs and gorges.
|
|
1258
|
-
*
|
|
1259
|
-
* @param value - hillshade-accent-color value (default `#000000`)
|
|
1260
|
-
*/
|
|
1261
|
-
hillshadeAccentColor(value: string | StyleExpression): this;
|
|
1262
|
-
}
|
|
1263
|
-
/**
|
|
1264
|
-
* Style builder for 'background' layers.
|
|
1265
|
-
*/
|
|
1266
|
-
declare class BackgroundLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1267
|
-
/**
|
|
1268
|
-
* The color with which the background will be drawn.
|
|
1269
|
-
*
|
|
1270
|
-
* @param value - background-color value (default `#000000`)
|
|
1271
|
-
*/
|
|
1272
|
-
backgroundColor(value: string | StyleExpression): this;
|
|
1273
|
-
/**
|
|
1274
|
-
* Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
1275
|
-
*
|
|
1276
|
-
* @param value - background-pattern value
|
|
1277
|
-
*/
|
|
1278
|
-
backgroundPattern(value: string | StyleExpression): this;
|
|
1279
|
-
/**
|
|
1280
|
-
* The opacity at which the background will be drawn.
|
|
1281
|
-
*
|
|
1282
|
-
* @param value - background-opacity value (default `1`)
|
|
1283
|
-
*/
|
|
1284
|
-
backgroundOpacity(value: number | StyleExpression): this;
|
|
1285
|
-
}
|
|
1286
|
-
declare function layerStyle(layerType: 'fill'): FillLayerStyleBuilder;
|
|
1287
|
-
declare function layerStyle(layerType: 'line'): LineLayerStyleBuilder;
|
|
1288
|
-
declare function layerStyle(layerType: 'symbol'): SymbolLayerStyleBuilder;
|
|
1289
|
-
declare function layerStyle(layerType: 'circle'): CircleLayerStyleBuilder;
|
|
1290
|
-
declare function layerStyle(layerType: 'heatmap'): HeatmapLayerStyleBuilder;
|
|
1291
|
-
declare function layerStyle(layerType: 'fill-extrusion'): FillExtrusionLayerStyleBuilder;
|
|
1292
|
-
declare function layerStyle(layerType: 'raster'): RasterLayerStyleBuilder;
|
|
1293
|
-
declare function layerStyle(layerType: 'hillshade'): HillshadeLayerStyleBuilder;
|
|
1294
|
-
declare function layerStyle(layerType: 'background'): BackgroundLayerStyleBuilder;
|
|
1295
|
-
|
|
1296
|
-
interface MapLayerOptions {
|
|
1297
|
-
/** Layer ID. */
|
|
1298
|
-
id: string;
|
|
1299
|
-
/** Layer type. */
|
|
1300
|
-
type: MapLayerType;
|
|
1301
|
-
/** Map data source to display. */
|
|
1302
|
-
source: string;
|
|
1303
|
-
/** Map data source layer to display. (Applicable to 'vector'-type data sources). */
|
|
1304
|
-
sourceLayer?: string;
|
|
1305
|
-
/** Enable feature hover effect and click handling. */
|
|
1306
|
-
interactive?: boolean;
|
|
1307
|
-
/** Minimum visible zoom level. */
|
|
1308
|
-
minZoom?: number;
|
|
1309
|
-
/** Maximum visible zoom level. */
|
|
1310
|
-
maxZoom?: number;
|
|
1311
|
-
above?: string;
|
|
1312
|
-
below?: string;
|
|
1313
|
-
filter?: string;
|
|
1314
|
-
style?: string;
|
|
1315
|
-
}
|
|
1316
|
-
type MapLayerExpression = ParserExpression;
|
|
1317
|
-
interface MapLayerSpecification {
|
|
1318
|
-
id: string;
|
|
1319
|
-
type: MapLayerType;
|
|
1320
|
-
metadata?: any;
|
|
1321
|
-
source: string;
|
|
1322
|
-
'source-layer'?: string;
|
|
1323
|
-
minzoom?: number;
|
|
1324
|
-
maxzoom?: number;
|
|
1325
|
-
filter?: MapLayerExpression;
|
|
1326
|
-
layout?: Record<string, MapLayerExpression>;
|
|
1327
|
-
paint?: Record<string, MapLayerExpression>;
|
|
1328
|
-
}
|
|
1329
|
-
/**
|
|
1330
|
-
* @internal
|
|
1331
|
-
*
|
|
1332
|
-
* Map layer metadata index
|
|
1333
|
-
*/
|
|
1334
|
-
interface MapLayerPropertyMetadataIndex {
|
|
1335
|
-
[layerType: string]: {
|
|
1336
|
-
[property: string]: MapLayerPropertyMetadata;
|
|
1337
|
-
};
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* @internal
|
|
1341
|
-
*
|
|
1342
|
-
* Map layer style property set.
|
|
1343
|
-
*/
|
|
1344
|
-
interface MapLayerPropertyMetadata {
|
|
1345
|
-
property: string;
|
|
1346
|
-
type: 'paint' | 'layout';
|
|
1347
|
-
definition: any;
|
|
1348
|
-
}
|
|
1349
|
-
declare class MapLayer {
|
|
1350
|
-
private static _propertyMetadataIndex;
|
|
1351
|
-
private static _defaultOptions;
|
|
1352
|
-
private _options;
|
|
1353
|
-
private _state;
|
|
1354
|
-
private _filter;
|
|
1355
|
-
private _paintProps;
|
|
1356
|
-
private _layoutProps;
|
|
1357
|
-
get layerSpecification(): MapLayerSpecification;
|
|
1358
|
-
get id(): string;
|
|
1359
|
-
get type(): string;
|
|
1360
|
-
get source(): string;
|
|
1361
|
-
get interactive(): boolean;
|
|
1362
|
-
get above(): string | undefined;
|
|
1363
|
-
get below(): string | undefined;
|
|
1364
|
-
constructor(options: MapLayerOptions);
|
|
1365
|
-
bindState(state: StateStore | null): this;
|
|
1366
|
-
setMinZoom(zoom: number): this;
|
|
1367
|
-
setMaxZoom(zoom: number): this;
|
|
1368
|
-
setInteractive(interactive: boolean): this;
|
|
1369
|
-
setAbove(layerId: string | undefined): this;
|
|
1370
|
-
setBelow(layerId: string | undefined): this;
|
|
1371
|
-
setStyle(styleProgram: string): void;
|
|
1372
|
-
/**
|
|
1373
|
-
* Set an individual style property.
|
|
1374
|
-
*
|
|
1375
|
-
* @param property Property name.
|
|
1376
|
-
* @param expression Property style expression.
|
|
1377
|
-
*/
|
|
1378
|
-
setStyleProperty(property: string, expression: string | null): void;
|
|
1379
|
-
setFilter(expression: string | null): void;
|
|
1380
|
-
private formattedName;
|
|
1381
|
-
private getPropertyMetadata;
|
|
1382
|
-
private static initializePropertyMetadataIndex;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
type MapDataSourceType = 'vector' | 'geojson' | 'raster';
|
|
1386
|
-
interface MapDataSourceOptions {
|
|
1387
|
-
/** Data source ID. */
|
|
1388
|
-
id: string;
|
|
1389
|
-
/** Data source: dataset ID, external URL or GeoJSON FeatureCollection. */
|
|
1390
|
-
src: MapGeojsonData | null;
|
|
1391
|
-
/** Data source type: 'vector', 'geojson', 'raster'. */
|
|
1392
|
-
type: MapDataSourceType;
|
|
1393
|
-
/** Enable GeoJSON point clustering. */
|
|
1394
|
-
cluster?: boolean;
|
|
1395
|
-
/** GeoJSON point clustering radius. */
|
|
1396
|
-
clusterRadius?: number;
|
|
1397
|
-
/** GeoJSON point clustering maximum zoom level. */
|
|
1398
|
-
clusterMaxZoom?: number;
|
|
1399
|
-
/** GeoJSON point clustering minimum points required to form a cluster. */
|
|
1400
|
-
clusterMinPoints?: number;
|
|
1401
|
-
/** Data source limit - applied to dataset queries. */
|
|
1402
|
-
limit?: number;
|
|
1403
|
-
/** Specify feature property to use as unique ID. */
|
|
1404
|
-
featureId?: string;
|
|
1405
|
-
/** Set to override Flo.w host for this data source */
|
|
1406
|
-
flowHost?: string;
|
|
1407
|
-
/** Set to override application-wide API key for this data source */
|
|
1408
|
-
flowApiKey?: string;
|
|
1409
|
-
}
|
|
1410
|
-
interface MapDataSourceSpecification {
|
|
1411
|
-
type: MapDataSourceType;
|
|
1412
|
-
promoteId?: string;
|
|
1413
|
-
url?: string;
|
|
1414
|
-
data?: MapGeojsonData;
|
|
1415
|
-
cluster?: boolean;
|
|
1416
|
-
clusterRadius?: number;
|
|
1417
|
-
clusterMaxZoom?: number;
|
|
1418
|
-
clusterMinPoints?: number;
|
|
1419
|
-
}
|
|
1420
|
-
type MapGeojsonData = string | GeoJSON.FeatureCollection;
|
|
1421
|
-
interface MapStyleSpecification {
|
|
1422
|
-
version: 8;
|
|
1423
|
-
id: string;
|
|
1424
|
-
name?: string;
|
|
1425
|
-
metadata?: {
|
|
1426
|
-
insertionPoints: Record<string, string>;
|
|
1427
|
-
};
|
|
1428
|
-
center?: Array<number>;
|
|
1429
|
-
zoom?: number;
|
|
1430
|
-
bearing?: number;
|
|
1431
|
-
pitch?: number;
|
|
1432
|
-
sources: {
|
|
1433
|
-
[_: string]: MapDataSourceSpecification;
|
|
1434
|
-
};
|
|
1435
|
-
sprite?: string;
|
|
1436
|
-
glyphs?: string;
|
|
1437
|
-
transition?: {
|
|
1438
|
-
duration?: number | undefined;
|
|
1439
|
-
delay?: number | undefined;
|
|
1440
|
-
};
|
|
1441
|
-
layers: Array<MapLayerSpecification>;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
interface FlowEngineEndpoint {
|
|
1445
|
-
host: string;
|
|
1446
|
-
apiKey?: string;
|
|
1447
|
-
}
|
|
1448
|
-
declare class MapDataSource {
|
|
1449
|
-
private static defaultOptions;
|
|
1450
|
-
private _options;
|
|
1451
|
-
private _srcExpression;
|
|
1452
|
-
private _parameters;
|
|
1453
|
-
private _state;
|
|
1454
|
-
get id(): string;
|
|
1455
|
-
get type(): MapDataSourceType;
|
|
1456
|
-
get featureId(): string | undefined;
|
|
1457
|
-
get dataSourceSpecification(): MapDataSourceSpecification;
|
|
1458
|
-
constructor(options: MapDataSourceOptions);
|
|
1459
|
-
bindState(state: StateStore | null): this;
|
|
1460
|
-
setSrc(val: MapGeojsonData): void;
|
|
1461
|
-
setParameter(name: string, expression: string | null): void;
|
|
1462
|
-
setFlowEndpoint(endpoint: FlowEngineEndpoint): void;
|
|
1463
|
-
private formattedName;
|
|
1464
|
-
private setSrcExpression;
|
|
1465
|
-
/**
|
|
1466
|
-
* Convert a src parameter to final URL
|
|
1467
|
-
*
|
|
1468
|
-
* @param src Data source url/dataset/tilesource ID
|
|
1469
|
-
* @param type Data source type
|
|
1470
|
-
* @returns URL
|
|
1471
|
-
*/
|
|
1472
|
-
private expandSrc;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
1476
|
-
|
|
1477
|
-
declare class FlowMapError extends FlowError {
|
|
1478
|
-
constructor(message: string, originalError?: Error);
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
type MapFeatureId = string | number;
|
|
1482
|
-
interface MapSourceIdentifier {
|
|
1483
|
-
source: string;
|
|
1484
|
-
sourceLayer?: string;
|
|
1485
|
-
}
|
|
1486
|
-
interface MapFeatureIdentifier {
|
|
1487
|
-
id: MapFeatureId;
|
|
1488
|
-
source: string;
|
|
1489
|
-
sourceLayer?: string;
|
|
1490
|
-
}
|
|
1491
|
-
interface MapFeature {
|
|
1492
|
-
geometry: GeoJSON.Geometry;
|
|
1493
|
-
id?: MapFeatureId;
|
|
1494
|
-
layer?: string;
|
|
1495
|
-
properties: {
|
|
1496
|
-
[key: string]: any;
|
|
1497
|
-
};
|
|
1498
|
-
source: string;
|
|
1499
|
-
sourceLayer?: string;
|
|
1500
|
-
state?: {
|
|
1501
|
-
[key: string]: any;
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
interface MapCenterOptions {
|
|
1505
|
-
lng: number;
|
|
1506
|
-
lat: number;
|
|
1507
|
-
zoom: number;
|
|
1508
|
-
bearing: number;
|
|
1509
|
-
pitch: number;
|
|
1510
|
-
}
|
|
1511
|
-
interface MapAnimationOptions {
|
|
1512
|
-
mode?: 'jump' | 'ease' | 'fly';
|
|
1513
|
-
duration?: number;
|
|
1514
|
-
easing?: (time: number) => number;
|
|
1515
|
-
}
|
|
1516
|
-
interface MapPaddingOptions {
|
|
1517
|
-
/**
|
|
1518
|
-
* Padding in pixels from the top of the map canvas.
|
|
1519
|
-
*/
|
|
1520
|
-
top: number;
|
|
1521
|
-
/**
|
|
1522
|
-
* Padding in pixels from the bottom of the map canvas.
|
|
1523
|
-
*/
|
|
1524
|
-
bottom: number;
|
|
1525
|
-
/**
|
|
1526
|
-
* Padding in pixels from the left of the map canvas.
|
|
1527
|
-
*/
|
|
1528
|
-
right: number;
|
|
1529
|
-
/**
|
|
1530
|
-
* Padding in pixels from the right of the map canvas.
|
|
1531
|
-
*/
|
|
1532
|
-
left: number;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
interface MapEventTypes {
|
|
1536
|
-
click: (event: MapMouseEvent) => void;
|
|
1537
|
-
dblClick: (event: MapMouseEvent) => void;
|
|
1538
|
-
mouseMove: (event: MapMouseEvent) => void;
|
|
1539
|
-
mouseOut: (event: MapMouseEvent) => void;
|
|
1540
|
-
moveEnd: (event: MapEvent) => void;
|
|
1541
|
-
sourceAdded: (event: MapSourceEvent) => void;
|
|
1542
|
-
sourceRemoved: (event: MapSourceEvent) => void;
|
|
1543
|
-
beforeSourceAdded: (event: MapSourceEvent) => void;
|
|
1544
|
-
beforeSourceRemoved: (event: MapSourceEvent) => void;
|
|
1545
|
-
sourceFeatureState: (event: MapSourceEvent) => void;
|
|
1546
|
-
destroyed: (event: MapEvent) => void;
|
|
1547
|
-
loading: (event: MapLoadingEvent) => void;
|
|
1548
|
-
beforeStyleChanged: (event: MapStyleChangeEvent) => void;
|
|
1549
|
-
styleChanged: (event: MapStyleChangeEvent) => void;
|
|
1550
|
-
error: (event: FlowMapError) => void;
|
|
1551
|
-
}
|
|
1552
|
-
interface MapEventTypes {
|
|
1553
|
-
click: (event: MapMouseEvent) => void;
|
|
1554
|
-
dblClick: (event: MapMouseEvent) => void;
|
|
1555
|
-
mouseMove: (event: MapMouseEvent) => void;
|
|
1556
|
-
mouseOut: (event: MapMouseEvent) => void;
|
|
1557
|
-
moveEnd: (event: MapEvent) => void;
|
|
1558
|
-
sourceAdded: (event: MapSourceEvent) => void;
|
|
1559
|
-
sourceRemoved: (event: MapSourceEvent) => void;
|
|
1560
|
-
beforeSourceAdded: (event: MapSourceEvent) => void;
|
|
1561
|
-
beforeSourceRemoved: (event: MapSourceEvent) => void;
|
|
1562
|
-
sourceFeatureState: (event: MapSourceEvent) => void;
|
|
1563
|
-
destroyed: (event: MapEvent) => void;
|
|
1564
|
-
loading: (event: MapLoadingEvent) => void;
|
|
1565
|
-
beforeStyleChanged: (event: MapStyleChangeEvent) => void;
|
|
1566
|
-
styleChanged: (event: MapStyleChangeEvent) => void;
|
|
1567
|
-
error: (event: FlowMapError) => void;
|
|
1568
|
-
}
|
|
1569
|
-
type MapEventType = keyof MapEventTypes;
|
|
1570
|
-
declare class MapEvent<EventType extends string = MapEventType, TOrig = unknown> {
|
|
1571
|
-
type: EventType;
|
|
1572
|
-
map: FlowCoreMap;
|
|
1573
|
-
originalEvent?: TOrig;
|
|
1574
|
-
static fromMaplibreEvent(type: string, map: FlowCoreMap, maplibreEvent: MapLibreEvent): MapEvent<any, unknown>;
|
|
1575
|
-
constructor(type: EventType, map: FlowCoreMap, originalEvent?: TOrig);
|
|
1576
|
-
}
|
|
1577
|
-
type MapMouseEventType = 'click' | 'dblClick' | 'mouseMove' | 'mouseOut';
|
|
1578
|
-
declare class MapMouseEvent extends MapEvent<MapMouseEventType, MouseEvent> {
|
|
1579
|
-
/**
|
|
1580
|
-
* The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
|
|
1581
|
-
*/
|
|
1582
|
-
point: [number, number];
|
|
1583
|
-
/**
|
|
1584
|
-
* The geographic location on the map of the mouse cursor.
|
|
1585
|
-
*/
|
|
1586
|
-
lngLat: [number, number];
|
|
1587
|
-
features: MapFeature[];
|
|
1588
|
-
static fromMaplibreMouseEvent(type: MapMouseEventType, maplibreMouseEvent: MapMouseEvent$1, map: FlowCoreMap, features: MapFeature[]): MapMouseEvent;
|
|
1589
|
-
constructor(type: MapMouseEventType, map: FlowCoreMap, point: [number, number], lngLat: [number, number], features: MapFeature[], originalEvent: MouseEvent);
|
|
1590
|
-
}
|
|
1591
|
-
type SourceEventType = 'sourceAdded' | 'sourceRemoved' | 'beforeSourceAdded' | 'beforeSourceRemoved' | 'sourceFeatureState';
|
|
1592
|
-
declare class MapSourceEvent extends MapEvent<SourceEventType> {
|
|
1593
|
-
source: string;
|
|
1594
|
-
constructor(type: SourceEventType, map: FlowCoreMap, source: string);
|
|
1595
|
-
}
|
|
1596
|
-
type LoadingEventType = 'loading';
|
|
1597
|
-
declare class MapLoadingEvent extends MapEvent<LoadingEventType> {
|
|
1598
|
-
loading: boolean;
|
|
1599
|
-
constructor(map: FlowCoreMap, loading: boolean);
|
|
1600
|
-
}
|
|
1601
|
-
type StyleChangeEventType = 'beforeStyleChanged' | 'styleChanged';
|
|
1602
|
-
declare class MapStyleChangeEvent extends MapEvent<StyleChangeEventType> {
|
|
1603
|
-
oldStyle: MapStyleSpecification;
|
|
1604
|
-
newStyle: MapStyleSpecification;
|
|
1605
|
-
constructor(type: StyleChangeEventType, map: FlowCoreMap, oldStyle: MapStyleSpecification, newStyle: MapStyleSpecification);
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
interface Handler {
|
|
1609
|
-
(event: KeyboardEvent): boolean | void;
|
|
1610
|
-
}
|
|
1611
|
-
interface Bindings {
|
|
1612
|
-
[key: string]: Handler;
|
|
1613
|
-
}
|
|
1614
|
-
interface RemoveListener {
|
|
1615
|
-
(): void;
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
declare class PluginManager {
|
|
1619
|
-
private _map;
|
|
1620
|
-
private _keyboardShortcutManager;
|
|
1621
|
-
private _plugins;
|
|
1622
|
-
private _initialized;
|
|
1623
|
-
private _exclusivePlugins;
|
|
1624
|
-
get map(): FlowCoreMap<StateStore>;
|
|
1625
|
-
constructor(map: FlowCoreMap);
|
|
1626
|
-
usePlugin<T extends MapPluginBase>(plugin: PluginConstructor<T>, options?: PluginOptionsType<T>): T;
|
|
1627
|
-
getPlugin<T extends MapPluginBase = MapPluginBase>(pluginOrName: PluginConstructor<T> | string): T;
|
|
1628
|
-
removePlugin<T extends MapPluginBase>(pluginOrName: PluginConstructor<T> | string): this;
|
|
1629
|
-
removeAllPlugins(): this;
|
|
1630
|
-
setExclusivePlugin(plugin: MapPluginBase): this;
|
|
1631
|
-
removeExclusivePlugin(plugin: MapPluginBase): this;
|
|
1632
|
-
addKeyboardShortcuts(keyboardShortcuts: Bindings, priority?: number): RemoveListener;
|
|
1633
|
-
forwardEvent<T extends keyof MapEventTypes>(eventName: T, ...args: Parameters<MapEventTypes[T]>): void;
|
|
1634
|
-
forwardStyleChangeEvent(event: MapStyleChangeEvent): MapStyleSpecification;
|
|
1635
|
-
private forwardSetExclusivePlugin;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
type PluginOptionsType<T extends MapPluginBase> = T extends MapPluginBase<infer Options> ? Options : never;
|
|
1639
|
-
type PluginEventsType<T extends MapPluginBase> = T extends MapPluginBase<infer _, infer Events> ? Events : never;
|
|
1640
|
-
type PluginConstructor<T extends MapPluginBase = MapPluginBase> = new (pluginManager: PluginManager, options?: PluginOptionsType<T>) => T;
|
|
1641
|
-
type EventHandlers<T> = {
|
|
1642
|
-
[P in keyof T as P extends string ? `handle${Capitalize<P>}` : never]+?: T[P];
|
|
1643
|
-
};
|
|
1644
|
-
interface MapPluginBase<Options = any, Events extends EventEmitter.ValidEventTypes = string | symbol> {
|
|
1645
|
-
initialize?(): void;
|
|
1646
|
-
destroy?(): void;
|
|
1647
|
-
handleClick?(event: MapMouseEvent): void;
|
|
1648
|
-
handleDblClick?(event: MapMouseEvent): void;
|
|
1649
|
-
handleMouseMove?(event: MapMouseEvent): void;
|
|
1650
|
-
handleMouseOut?(event: MapEvent): void;
|
|
1651
|
-
handleMoveEnd?(event: MapEvent): void;
|
|
1652
|
-
handleSourceAdded?(event: MapSourceEvent): void;
|
|
1653
|
-
handleSourceRemoved?(event: MapSourceEvent): void;
|
|
1654
|
-
handleBeforeSourceAdded?(event: MapSourceEvent): void;
|
|
1655
|
-
handleBeforeSourceRemoved?(event: MapSourceEvent): void;
|
|
1656
|
-
handleSourceFeatureState?(event: MapSourceEvent): void;
|
|
1657
|
-
handleBeforeStyleChanged?(event: MapStyleChangeEvent): MapStyleSpecification | undefined;
|
|
1658
|
-
handleStyleChanged?(event: MapStyleChangeEvent): void;
|
|
1659
|
-
handleLoading?(event: MapLoadingEvent): void;
|
|
1660
|
-
handleSetExclusivePlugin?(exclusivePlugins: MapPluginBase[]): void;
|
|
1661
|
-
handleError?(error: FlowMapError): void;
|
|
1662
|
-
}
|
|
1663
|
-
declare abstract class MapPluginBase<Options extends object | undefined = any, Events extends EventEmitter.ValidEventTypes = string | symbol> extends EventEmitter<Events> {
|
|
1664
|
-
private _pluginManager;
|
|
1665
|
-
options: Options;
|
|
1666
|
-
get map(): FlowCoreMap<StateStore>;
|
|
1667
|
-
get pluginManager(): PluginManager;
|
|
1668
|
-
abstract readonly name: string;
|
|
1669
|
-
constructor(pluginManager: PluginManager, options?: Options);
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
/**
|
|
1673
|
-
* @internal
|
|
1674
|
-
*/
|
|
1675
|
-
interface ImageRegistryEntry {
|
|
1676
|
-
id: string;
|
|
1677
|
-
src: string;
|
|
1678
|
-
width?: number;
|
|
1679
|
-
height?: number;
|
|
1680
|
-
pixelDensity?: number;
|
|
1681
|
-
recolor?: boolean;
|
|
1682
|
-
image?: HTMLImageElement;
|
|
1683
|
-
}
|
|
1684
|
-
/**
|
|
1685
|
-
*
|
|
1686
|
-
* The `ImageRegistry` is a container for map icon images.
|
|
1687
|
-
*
|
|
1688
|
-
* Images can be registered and retrieved by ID.
|
|
1689
|
-
*/
|
|
1690
|
-
declare class ImageRegistry {
|
|
1691
|
-
private _registry;
|
|
1692
|
-
private _unknownImage;
|
|
1693
|
-
get unknownImage(): ImageRegistryEntry & {
|
|
1694
|
-
image: HTMLImageElement;
|
|
1695
|
-
};
|
|
1696
|
-
/**
|
|
1697
|
-
* Register a map icon image.
|
|
1698
|
-
*
|
|
1699
|
-
* @param id Image ID.
|
|
1700
|
-
* @param src Image source URL.
|
|
1701
|
-
* @param width Image display width.
|
|
1702
|
-
* @param height Image display height.
|
|
1703
|
-
* @param pixelDensity Image pixel density. Defaults to `2` - the source image should be @2x resolution to enable better quality rendering on high-resolution displays.
|
|
1704
|
-
* @param recolor Set to `true` to allow recoloring of map icon image using map layer style properties.
|
|
1705
|
-
*/
|
|
1706
|
-
registerImage(id: string, src: string, width?: number, height?: number, pixelDensity?: number, recolor?: boolean): ImageRegistryEntry;
|
|
1707
|
-
/**
|
|
1708
|
-
* Get an image registry entry.
|
|
1709
|
-
*
|
|
1710
|
-
* @param id Image ID.
|
|
1711
|
-
* @returns The image registry entry.
|
|
1712
|
-
*/
|
|
1713
|
-
getImage(id: string): ImageRegistryEntry & {
|
|
1714
|
-
image: HTMLImageElement;
|
|
1715
|
-
};
|
|
1716
|
-
/**
|
|
1717
|
-
*
|
|
1718
|
-
* @param src Image source URL.
|
|
1719
|
-
* @param width Image display width in pixels.
|
|
1720
|
-
* @param height Image display height in pixels.
|
|
1721
|
-
* @param pixelDensity Image pixel density. Defaults to `2` - the source image should be @2x resolution to enable better quality rendering on high-resolution displays.
|
|
1722
|
-
*/
|
|
1723
|
-
private loadImage;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
interface FeatureStreamOptions {
|
|
1727
|
-
featureIds: Array<string | number>;
|
|
1728
|
-
fireImmediately?: boolean;
|
|
1729
|
-
map: FlowCoreMap;
|
|
1730
|
-
source: string;
|
|
1731
|
-
sourceLayer?: string;
|
|
1732
|
-
}
|
|
1733
|
-
declare class MapFeatureStream {
|
|
1734
|
-
private _boundHandleLoading;
|
|
1735
|
-
private _boundHandleSourceFeatureState;
|
|
1736
|
-
private _options;
|
|
1737
|
-
private _sourceLoadCount;
|
|
1738
|
-
private _sourceLoaded;
|
|
1739
|
-
constructor(options: FeatureStreamOptions);
|
|
1740
|
-
get featureData(): Record<string | number, MapFeature>;
|
|
1741
|
-
get featureIds(): Array<string | number>;
|
|
1742
|
-
set featureIds(featureIds: Array<string | number>);
|
|
1743
|
-
subscribe(handler: (featureData: Record<string | number, MapFeature>) => void): ISubscription;
|
|
1744
|
-
private featureFromMaplibreFeature;
|
|
1745
|
-
private handleLoading;
|
|
1746
|
-
private handleSourceFeatureState;
|
|
1747
|
-
private queryFeatureData;
|
|
1748
|
-
private resume;
|
|
1749
|
-
private suspend;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
interface MapOptions<TState extends StateStore = StateStore> extends Omit<MapOptions$1, 'style'> {
|
|
1753
|
-
id?: string;
|
|
1754
|
-
baseStyle?: string | MapStyleSpecification;
|
|
1755
|
-
container: string | HTMLElement;
|
|
1756
|
-
featureClickTolerance?: number;
|
|
1757
|
-
contextId?: string;
|
|
1758
|
-
}
|
|
1759
|
-
declare class FlowCoreMap<TState extends StateStore = StateStore> extends EventEmitter$1<MapEventTypes> {
|
|
1760
|
-
private static _defaultOptions;
|
|
1761
|
-
private _context;
|
|
1762
|
-
private _initialized;
|
|
1763
|
-
private _loading;
|
|
1764
|
-
private _debouncedEmitSourceEvent;
|
|
1765
|
-
private _imageRegistry;
|
|
1766
|
-
private _options;
|
|
1767
|
-
private _pluginManager;
|
|
1768
|
-
private _resolveInitialized;
|
|
1769
|
-
private _style;
|
|
1770
|
-
private _styleUpdateSubscription;
|
|
1771
|
-
private _throttledMouseMove;
|
|
1772
|
-
maplibreMap: Map;
|
|
1773
|
-
constructor(options: MapOptions<TState>);
|
|
1774
|
-
get context(): FlowContext<TState>;
|
|
1775
|
-
get container(): HTMLElement;
|
|
1776
|
-
get id(): string;
|
|
1777
|
-
get initialized(): Promise<void>;
|
|
1778
|
-
get styleSpecification(): MapStyleSpecification;
|
|
1779
|
-
/**
|
|
1780
|
-
* @internal
|
|
1781
|
-
*
|
|
1782
|
-
* Used by map export to get images added to map.
|
|
1783
|
-
*/
|
|
1784
|
-
get imageRegistry(): ImageRegistry;
|
|
1785
|
-
addLayer(layer: MapLayer): MapLayer;
|
|
1786
|
-
addLayer(layerOptions: MapLayerOptions): MapLayer;
|
|
1787
|
-
addSource(source: MapDataSource): MapDataSource;
|
|
1788
|
-
addSource(sourceOptions: MapDataSourceOptions): MapDataSource;
|
|
1789
|
-
destroy(): void;
|
|
1790
|
-
emitError(message: string, originalError?: Error): void;
|
|
1791
|
-
emitEvent<T extends MapEvent<keyof MapEventTypes, any>>(event: T): void;
|
|
1792
|
-
featureStream(options: Omit<FeatureStreamOptions, 'map'>): MapFeatureStream;
|
|
1793
|
-
private get formattedName();
|
|
1794
|
-
getFeatureState(feature: MapFeatureIdentifier): Record<string, any>;
|
|
1795
|
-
getLayer(id: string): MapLayer;
|
|
1796
|
-
getLayers(filter?: (layer: MapLayer) => boolean): MapLayer[];
|
|
1797
|
-
getPlugin<T extends MapPluginBase = MapPluginBase>(pluginOrName: PluginConstructor<T> | string): T;
|
|
1798
|
-
getSource(id: string): MapDataSource;
|
|
1799
|
-
getSources(filter?: (source: MapDataSource) => boolean): MapDataSource[];
|
|
1800
|
-
/**
|
|
1801
|
-
* Register a map icon image.
|
|
1802
|
-
*
|
|
1803
|
-
* @param id Image ID.
|
|
1804
|
-
* @param src Image source URL.
|
|
1805
|
-
* @param width Image display width.
|
|
1806
|
-
* @param height Image display height.
|
|
1807
|
-
* @param pixelDensity Image pixel density. Defaults to `2` - the source image should be @2x resolution to enable better quality rendering on high-resolution displays.
|
|
1808
|
-
* @param recolor Set to `true` to allow recoloring of map icon image using map layer style properties.
|
|
1809
|
-
*/
|
|
1810
|
-
registerImage(id: string, src: string, width?: number, height?: number, pixelDensity?: number, recolor?: boolean): void;
|
|
1811
|
-
/**
|
|
1812
|
-
* Programmatically remove feature state properties from a map feature.
|
|
1813
|
-
*
|
|
1814
|
-
* @param feature Feature to modify. Specify `null` to modify all map features.
|
|
1815
|
-
* @param key Feature state key to remove. Specify `null` to remove all feature state for specified feature(s).
|
|
1816
|
-
*/
|
|
1817
|
-
removeFeatureState(feature: PartialBy<MapFeatureIdentifier, 'id'>, key?: string, fireEvent?: boolean): void;
|
|
1818
|
-
removeLayer(id: string): this;
|
|
1819
|
-
removeSource(id: string, removeLayers?: boolean): this;
|
|
1820
|
-
setBaseStyle(style: string | MapStyleSpecification): Promise<void>;
|
|
1821
|
-
getCenter(): MapCenterOptions;
|
|
1822
|
-
setCenter(center: Partial<MapCenterOptions>, animationOptions?: MapAnimationOptions): this;
|
|
1823
|
-
getBounds(): [number, number, number, number];
|
|
1824
|
-
setBounds(bounds: [number, number, number, number], options?: MapAnimationOptions & {
|
|
1825
|
-
padding?: number;
|
|
1826
|
-
}): void;
|
|
1827
|
-
getVisibleBounds(): [number, number, number, number];
|
|
1828
|
-
/**
|
|
1829
|
-
* Programmatically set feature state properties for a map feature.
|
|
1830
|
-
*
|
|
1831
|
-
* @param feature Feature to modify.
|
|
1832
|
-
* @param state Feature state properties to set.
|
|
1833
|
-
*/
|
|
1834
|
-
setFeatureState(feature: MapFeatureIdentifier, state: Record<string, any>, fireEvent?: boolean): void;
|
|
1835
|
-
setFeatureStateBulk(sourceId: MapSourceIdentifier, featureState: {
|
|
1836
|
-
[featureId: MapFeatureId]: Record<string, any>;
|
|
1837
|
-
}): void;
|
|
1838
|
-
transaction(fn: () => void): void;
|
|
1839
|
-
usePlugin<T extends MapPluginBase>(plugin: PluginConstructor<T>, options?: PluginOptionsType<T>): T;
|
|
1840
|
-
usePlugins(plugins: PluginConstructor[]): void;
|
|
1841
|
-
private bindMapEvents;
|
|
1842
|
-
private featureFromMaplibreFeature;
|
|
1843
|
-
private featureQueryBox;
|
|
1844
|
-
private handleLoading;
|
|
1845
|
-
private handleMissingImage;
|
|
1846
|
-
private handleMouseClick;
|
|
1847
|
-
private handleMouseMove;
|
|
1848
|
-
private initialize;
|
|
1849
|
-
private loadBaseStyle;
|
|
1850
|
-
private transformMapRequest;
|
|
1851
|
-
private updateMapStyle;
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
/**
|
|
1855
|
-
* The `MapRegistry` is a container for [[FlowCoreMap]] instances.
|
|
1856
|
-
*
|
|
1857
|
-
* Maps can be registered and retrieved by ID.
|
|
1858
|
-
*/
|
|
1859
|
-
declare class MapRegistry {
|
|
1860
|
-
private _maps;
|
|
1861
|
-
/**
|
|
1862
|
-
* Register a Flo.w map.
|
|
1863
|
-
*
|
|
1864
|
-
* @param id Map ID.
|
|
1865
|
-
* @param map Map to register.
|
|
1866
|
-
*/
|
|
1867
|
-
registerMap(map: FlowCoreMap): FlowCoreMap;
|
|
1868
|
-
/**
|
|
1869
|
-
* Un-register a Flo.w map.
|
|
1870
|
-
*
|
|
1871
|
-
* @param id Map ID.
|
|
1872
|
-
*/
|
|
1873
|
-
unregisterMap(map: FlowCoreMap): void;
|
|
1874
|
-
/**
|
|
1875
|
-
* Retrieve the specified map.
|
|
1876
|
-
*
|
|
1877
|
-
* This method returns a promise that resolves when the map has been initialized.
|
|
1878
|
-
*
|
|
1879
|
-
* @param id Map ID.
|
|
1880
|
-
*/
|
|
1881
|
-
getMap(id: string): Promise<FlowCoreMap>;
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
declare const DEFAULT_CONTEXT_ID = "default";
|
|
1885
|
-
interface FlowContextOptions<TState extends StateStore = StateStore> {
|
|
1886
|
-
id?: string;
|
|
1887
|
-
host?: string;
|
|
1888
|
-
apiKey: string;
|
|
1889
|
-
state: TState;
|
|
1890
|
-
enableDebug?: boolean;
|
|
1891
|
-
}
|
|
1892
|
-
declare class FlowContext<TState extends StateStore = StateStore> {
|
|
1893
|
-
private static _defaultOptions;
|
|
1894
|
-
private _options;
|
|
1895
|
-
get id(): string;
|
|
1896
|
-
readonly flowClient: Client;
|
|
1897
|
-
readonly state: TState;
|
|
1898
|
-
readonly maps: MapRegistry;
|
|
1899
|
-
readonly queries: QueryRegistry;
|
|
1900
|
-
/** The Flo.w debugger. Available as `window.FDBG` in the browser's web developer console. */
|
|
1901
|
-
readonly debugger?: Debugger<TState>;
|
|
1902
|
-
/**
|
|
1903
|
-
* Constructs a new `FlowCoreContext`.
|
|
1904
|
-
*
|
|
1905
|
-
* Use [[ContextRegistry.initializeContext]] to create an instance of `FlowCoreContext`.
|
|
1906
|
-
*
|
|
1907
|
-
* @param id The ID of the context.
|
|
1908
|
-
* @param host The Flo.w Engine host URL.
|
|
1909
|
-
* @param apiKey The Flo.w Engine API key.
|
|
1910
|
-
* @param enableDebug Set to `true` to enable the debugger.
|
|
1911
|
-
*/
|
|
1912
|
-
constructor(options: FlowContextOptions<TState>);
|
|
1913
|
-
evaluateExpression(expr: string): any;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
export { type QueryOptions as $, type Annotation as A, BackgroundLayerStyleBuilder as B, CircleLayerStyleBuilder as C, DEFAULT_CONTEXT_ID as D, type MapFeatureIdentifier as E, type FlowContextOptions as F, type MapPaddingOptions as G, HeatmapLayerStyleBuilder as H, type MapSourceIdentifier as I, type MapOptions as J, FlowCoreMap as K, LineLayerStyleBuilder as L, type MapStyleSpecification as M, Query as N, query as O, queryMany as P, QueryRegistry as Q, ReactiveExpression as R, StateStore as S, queryOne as T, type QueryResultFormat as U, type QueryAttribute as V, type QueryWhereClauses as W, type QueryExtraParams as X, type QueryOrderClause as Y, type QuerySampleOptions as Z, type QueryDefinition as _, FlowContext as a, type QueryDefinitionFn as a0, type QueryResultTransformFn as a1, traceReaction as a2, type Path as a3, type PathValue as a4, type StoreConstructor as a5, type StoreAnnotations as a6, type SerializationFormat as a7, MapEvent as a8, type MapFeatureId as a9, MapPluginBase as aa, PluginManager as ab, MapSourceEvent as ac, MapMouseEvent as ad, MapFeatureStream as ae, type PartialBy as af, MapStyleChangeEvent as ag, type PluginOptionsType as ah, type PluginEventsType as ai, type PluginConstructor as aj, type EventHandlers as ak, MapDataSource as b, MapLayer as c, MapRegistry as d, type FlowEngineEndpoint as e, type MapLayerType as f, FillLayerStyleBuilder as g, SymbolLayerStyleBuilder as h, FillExtrusionLayerStyleBuilder as i, RasterLayerStyleBuilder as j, HillshadeLayerStyleBuilder as k, layerStyle as l, MapLayerStyleBuilder as m, StyleExpression as n, expr as o, type MapLayerOptions as p, type MapLayerExpression as q, type MapLayerSpecification as r, type MapLayerPropertyMetadataIndex as s, type MapDataSourceType as t, type MapDataSourceOptions as u, type MapDataSourceSpecification as v, type MapGeojsonData as w, type MapAnimationOptions as x, type MapCenterOptions as y, type MapFeature as z };
|