@mapcreator/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/HighlightManager.d.ts +23 -0
  2. package/dist/PopupManager.d.ts +44 -0
  3. package/dist/Registry.d.ts +23 -0
  4. package/dist/adornments/categoricalLegend.d.ts +2 -0
  5. package/dist/adornments/connectedLegend.d.ts +3 -0
  6. package/dist/adornments/customAdornment.d.ts +2 -0
  7. package/dist/adornments/heading.d.ts +2 -0
  8. package/dist/adornments/insetMap.d.ts +3 -0
  9. package/dist/adornments/manualLegend.d.ts +2 -0
  10. package/dist/adornments/northArrow.d.ts +3 -0
  11. package/dist/adornments/scalebar.d.ts +3 -0
  12. package/dist/constants/index.d.ts +11 -0
  13. package/dist/controls/controls.d.ts +7 -0
  14. package/dist/controls/fullscreenControls.d.ts +2 -0
  15. package/dist/controls/geocoderControl.d.ts +33 -0
  16. package/dist/controls/geolocationControls.d.ts +2 -0
  17. package/dist/controls/refreshMapControls.d.ts +3 -0
  18. package/dist/controls/webControls.d.ts +4 -0
  19. package/dist/controls/zoomControls.d.ts +3 -0
  20. package/dist/i18n.d.ts +56 -0
  21. package/dist/index.d.ts +16 -0
  22. package/dist/locales/da_DK/strings.json.d.ts +10 -0
  23. package/dist/locales/de_DE/strings.json.d.ts +10 -0
  24. package/dist/locales/en_GB/strings.json.d.ts +10 -0
  25. package/dist/locales/es_ES/strings.json.d.ts +10 -0
  26. package/dist/locales/fr_FR/strings.json.d.ts +10 -0
  27. package/dist/locales/it_IT/strings.json.d.ts +10 -0
  28. package/dist/locales/nl_NL/strings.json.d.ts +10 -0
  29. package/dist/mapcreator-sdk.css +2 -0
  30. package/dist/mapcreator-sdk.js +39590 -0
  31. package/dist/mapcreator-sdk.umd.cjs +1140 -0
  32. package/dist/models/area.d.ts +5 -0
  33. package/dist/models/circle.d.ts +5 -0
  34. package/dist/models/dot.d.ts +3 -0
  35. package/dist/models/line.d.ts +4 -0
  36. package/dist/models/marker.d.ts +5 -0
  37. package/dist/models/polygon.d.ts +5 -0
  38. package/dist/renderAdornments.d.ts +4 -0
  39. package/dist/types/geometry.d.ts +6 -0
  40. package/dist/types/index.d.ts +19 -0
  41. package/dist/types/jobObject.d.ts +514 -0
  42. package/dist/types/mapstyle.d.ts +62 -0
  43. package/dist/utils/browser.d.ts +2 -0
  44. package/dist/utils/choropleth.d.ts +12 -0
  45. package/dist/utils/fullscreen.d.ts +4 -0
  46. package/dist/utils/geolocation.d.ts +6 -0
  47. package/dist/utils/graphhopper.d.ts +6 -0
  48. package/dist/utils/helpers.d.ts +28 -0
  49. package/dist/utils/language.d.ts +19 -0
  50. package/dist/utils/models.d.ts +16 -0
  51. package/dist/utils/overlays.d.ts +4 -0
  52. package/dist/utils/scalebar.d.ts +2 -0
  53. package/dist/utils/svgHelpers.d.ts +90 -0
  54. package/dist/utils/template.d.ts +5 -0
  55. package/dist/utils/youtube.d.ts +4 -0
  56. package/package.json +63 -0
@@ -0,0 +1,5 @@
1
+ import { SvgCache } from '../utils/svgHelpers';
2
+ import { JobObjectAreaGroup } from '../types/jobObject';
3
+ import { Map as MapLibre } from '@mapcreator/maplibre-gl';
4
+ import { Svgs } from '../types';
5
+ export declare function addAreaGroup(map: MapLibre, group: JobObjectAreaGroup, beforeId: string, svgs: Svgs, svgCache: SvgCache, vectorUrl: string, accessToken: string): void;
@@ -0,0 +1,5 @@
1
+ import { SvgCache } from '../utils/svgHelpers';
2
+ import { JobObjectCircleGroup } from '../types/jobObject';
3
+ import { Svgs } from '../types';
4
+ import { Map } from '@mapcreator/maplibre-gl';
5
+ export declare function addCircleGroup(map: Map, group: JobObjectCircleGroup, beforeId: string, svgs: Svgs, svgCache: SvgCache): void;
@@ -0,0 +1,3 @@
1
+ import { JobObjectDotGroup } from '../types/jobObject';
2
+ import { Map } from '@mapcreator/maplibre-gl';
3
+ export declare function addDotGroup(map: Map, group: JobObjectDotGroup, beforeId: string): void;
@@ -0,0 +1,4 @@
1
+ import { SvgCache } from '../utils/svgHelpers';
2
+ import { JobObjectLineGroup } from '../types/jobObject';
3
+ import { Map } from '@mapcreator/maplibre-gl';
4
+ export declare function addLineGroup(map: Map, group: JobObjectLineGroup, beforeId: string, svgCache: SvgCache): void;
@@ -0,0 +1,5 @@
1
+ import { SvgCache } from '../utils/svgHelpers';
2
+ import { JobObjectMarkerGroup } from '../types/jobObject';
3
+ import { Map } from '@mapcreator/maplibre-gl';
4
+ import { Svgs } from '../types';
5
+ export declare function addMarkerGroup(map: Map, group: JobObjectMarkerGroup, beforeId: string, svgs: Svgs, svgCache: SvgCache): void;
@@ -0,0 +1,5 @@
1
+ import { SvgCache } from '../utils/svgHelpers';
2
+ import { JobObjectPolygonGroup } from '../types/jobObject';
3
+ import { Map } from '@mapcreator/maplibre-gl';
4
+ import { Svgs } from '../types';
5
+ export declare function addPolygonGroup(map: Map, group: JobObjectPolygonGroup, beforeId: string, svgs: Svgs, svgCache: SvgCache): void;
@@ -0,0 +1,4 @@
1
+ import { PositionOffsets, JobObject } from './types/jobObject';
2
+ import { Map as MapLibre } from '@mapcreator/maplibre-gl';
3
+ import { InitialPositionInfo } from './types';
4
+ export declare function useRenderAdornments(jobObject: JobObject, positionOffsets: PositionOffsets | undefined, map: MapLibre, initialPosition: InitialPositionInfo, vapiUrl: string, cdnUrl: string, accessToken: string): void;
@@ -0,0 +1,6 @@
1
+ export type LngLat = {
2
+ lng: number;
3
+ lat: number;
4
+ };
5
+ export type Position = [number, number];
6
+ export type BBox = [number, number, number, number];
@@ -0,0 +1,19 @@
1
+ import { JobObjectDataBindings } from './jobObject';
2
+ export type Svgs = Record<string, string>;
3
+ export type ModelBindings = {
4
+ dataBindings?: JobObjectDataBindings | undefined;
5
+ };
6
+ export type InitialPositionInfo = {
7
+ center: {
8
+ lng: number;
9
+ lat: number;
10
+ };
11
+ zoom: number;
12
+ pitch: number;
13
+ rotation: number;
14
+ detailLevel: number;
15
+ width: number;
16
+ height: number;
17
+ };
18
+ export type Mode = 'sdk' | 'app' | 'preview';
19
+ export type Env = 'production' | 'beta' | 'bleeding';
@@ -0,0 +1,514 @@
1
+ /**
2
+ * This type is copy-pasted from V5 and needs to stay in sync with it.
3
+ * TODO: consider extracting type into a separate package
4
+ */
5
+ export type JobObject = {
6
+ type: 'v5';
7
+ version: 1;
8
+ title?: Optional<string>;
9
+ export?: Optional<{
10
+ size?: Optional<[number, number]>;
11
+ unit?: Optional<'millimeter' | 'centimeter' | 'inch' | 'pixel' | 'pica'>;
12
+ format?: Optional<'jpg' | 'png' | 'svg' | 'pdf' | 'tiff' | 'eps' | 'eps_log' | 'mp4' | 'mov' | 'mkv' | 'mxf' | 'webm' | 'jpg_sequence' | 'png_sequence' | 'web' | 'web_download'>;
13
+ dpi?: Optional<number>;
14
+ frameRate?: Optional<number>;
15
+ videoEncoding?: Optional<VideoEncoding>;
16
+ }>;
17
+ map: {
18
+ center: {
19
+ lng: number;
20
+ lat: number;
21
+ };
22
+ zoom: number;
23
+ rotation?: Optional<number>;
24
+ pitch?: Optional<number>;
25
+ fov?: Optional<number>;
26
+ detailLevel?: Optional<number>;
27
+ fitToScreen?: Optional<boolean>;
28
+ language: string;
29
+ mapstyleId: number;
30
+ hideBasemap?: Optional<boolean>;
31
+ layerInfo?: Optional<Array<{
32
+ id: string;
33
+ visibility: boolean;
34
+ }>>;
35
+ overlays?: Optional<number[]>;
36
+ projection?: Optional<'mercator' | 'globe'>;
37
+ terrain?: Optional<boolean>;
38
+ terrainExaggeration?: Optional<number>;
39
+ };
40
+ aspectBox?: Optional<{
41
+ lock?: Optional<boolean>;
42
+ } & ({
43
+ grid: Grid;
44
+ } | {
45
+ gridStatic: Grid;
46
+ })>;
47
+ registry?: Optional<{
48
+ models?: Optional<JobObjectModels>;
49
+ slots?: Optional<JobObjectSlots>;
50
+ svgs?: Optional<Record<string, string>>;
51
+ }>;
52
+ web?: Optional<{
53
+ restrictMapMovement: boolean;
54
+ preserveAspectRatio: boolean;
55
+ popupPosition: PopupPosition;
56
+ }>;
57
+ adornments?: Optional<Array<JobObjectAdornment>>;
58
+ positionOffsets?: Optional<PositionOffsets>;
59
+ video?: Optional<{
60
+ keyframes: JobObjectKeyframe[];
61
+ animations: JobObjectAnimation[];
62
+ }>;
63
+ };
64
+ export type JobObjectModels = {
65
+ area?: Optional<JobObjectAreaGroup[]>;
66
+ circle?: Optional<JobObjectCircleGroup[]>;
67
+ dot?: Optional<JobObjectDotGroup[]>;
68
+ line?: Optional<JobObjectLineGroup[]>;
69
+ marker?: Optional<JobObjectMarkerGroup[]>;
70
+ polygon?: Optional<JobObjectPolygonGroup[]>;
71
+ };
72
+ export type PopupPosition = 'bottomLeft' | 'mapElement';
73
+ type Optional<T> = T | undefined;
74
+ type JobObjectGroupType = JobObjectArea | JobObjectCircle | JobObjectDot | JobObjectLine | JobObjectMarker | JobObjectPolygon;
75
+ type JobObjectGroupBase<GT extends JobObjectGroupType> = {
76
+ id: string;
77
+ name: string;
78
+ models: GT[];
79
+ };
80
+ export type JobObjectAreaGroup = JobObjectGroupBase<JobObjectArea> & {
81
+ fillColor?: Optional<string>;
82
+ outlineColor?: Optional<string>;
83
+ choropleth?: Optional<Choropleth>;
84
+ };
85
+ export type JobObjectCircleGroup = JobObjectGroupBase<JobObjectCircle> & {
86
+ fillColor?: Optional<string>;
87
+ outlineColor?: Optional<string>;
88
+ radiusLineColor?: Optional<string>;
89
+ };
90
+ export type JobObjectDotGroup = JobObjectGroupBase<JobObjectDot> & {
91
+ fillColor?: Optional<string>;
92
+ };
93
+ export type JobObjectLineGroup = JobObjectGroupBase<JobObjectLine> & {
94
+ lineColor?: Optional<string>;
95
+ };
96
+ export type JobObjectMarkerGroup = JobObjectGroupBase<JobObjectMarker> & {
97
+ svg?: Optional<string>;
98
+ text?: Optional<string>;
99
+ textColor?: Optional<string>;
100
+ textHaloColor?: Optional<string>;
101
+ collisionDetection?: Optional<boolean>;
102
+ clustering?: Optional<boolean>;
103
+ clusterMaxZoom?: Optional<number>;
104
+ clusterRadius?: Optional<number>;
105
+ clusterCircleRadius?: Optional<Array<[number, number]>>;
106
+ clusterCircleColor?: Optional<Array<[number, string]>>;
107
+ clusterTextColor?: Optional<Array<[number, string]>>;
108
+ clusterTextSize?: Optional<Array<[number, number]>>;
109
+ };
110
+ export type JobObjectPolygonGroup = JobObjectGroupBase<JobObjectPolygon> & {
111
+ fillColor?: Optional<string>;
112
+ outlineColor?: Optional<string>;
113
+ };
114
+ export type JobObjectAdornment = JobObjectCustomAdornment | JobObjectCopyright | JobObjectNorthArrow | JobObjectScalebar | JobObjectInsetMap | JobObjectHeading | JobObjectWebControls | JobObjectManualLegend | JobObjectConnectedLegend;
115
+ export type JobObjectCustomAdornment = {
116
+ type: 'custom';
117
+ id: string;
118
+ name: string;
119
+ position: AdornmentPosition;
120
+ stacking?: Optional<Orientation>;
121
+ svg: string;
122
+ scale?: Optional<number>;
123
+ };
124
+ export type JobObjectCopyright = {
125
+ type: 'copyright';
126
+ id: string;
127
+ name: string;
128
+ position: AdornmentPosition;
129
+ stacking?: Optional<Orientation>;
130
+ color?: Optional<string>;
131
+ font?: Optional<string>;
132
+ fontSize?: Optional<number>;
133
+ orientation?: Optional<Orientation>;
134
+ };
135
+ export type JobObjectNorthArrow = {
136
+ type: 'northArrow';
137
+ id: string;
138
+ name: string;
139
+ position: AdornmentPosition;
140
+ stacking?: Optional<Orientation>;
141
+ scale?: Optional<number>;
142
+ };
143
+ export type JobObjectScalebar = {
144
+ type: 'scalebar';
145
+ id: string;
146
+ name: string;
147
+ position: AdornmentPosition;
148
+ stacking?: Optional<Orientation>;
149
+ color?: Optional<string>;
150
+ font?: Optional<string>;
151
+ fontSize?: Optional<number>;
152
+ maxWidth?: Optional<number>;
153
+ unit?: Optional<ScalebarUnit>;
154
+ };
155
+ export type JobObjectWebControls = {
156
+ type: 'webControls';
157
+ buttons: WebControlsSubType[];
158
+ id: string;
159
+ name: string;
160
+ position: AdornmentPosition;
161
+ stacking?: Optional<Orientation>;
162
+ };
163
+ export type JobObjectInsetMap = {
164
+ type: 'insetMap';
165
+ id: string;
166
+ name: string;
167
+ position: AdornmentPosition;
168
+ stacking?: Optional<Orientation>;
169
+ fileName: string;
170
+ boundingBox: [number, number, number, number];
171
+ isGlobe: boolean;
172
+ scale?: Optional<number>;
173
+ backgroundColor?: Optional<string>;
174
+ globeBackgroundColor?: Optional<string>;
175
+ borderColor?: Optional<string>;
176
+ primaryFillColor?: Optional<string>;
177
+ primaryStrokeColor?: Optional<string>;
178
+ secondaryFillColor?: Optional<string>;
179
+ secondaryStrokeColor?: Optional<string>;
180
+ graticuleColor?: Optional<string>;
181
+ frameColor?: Optional<string>;
182
+ frameOutlineColor?: Optional<string>;
183
+ dotColor?: Optional<string>;
184
+ dotOutlineColor?: Optional<string>;
185
+ };
186
+ export type JobObjectHeading = {
187
+ type: 'heading';
188
+ id: string;
189
+ name: string;
190
+ position: AdornmentPosition;
191
+ stacking?: Optional<Orientation>;
192
+ title: string;
193
+ titleColor?: Optional<string>;
194
+ titleFont?: Optional<string>;
195
+ titleFontSize?: Optional<number>;
196
+ titleJustify?: Optional<string>;
197
+ subtitle: string;
198
+ subtitleColor?: Optional<string>;
199
+ subtitleFont?: Optional<string>;
200
+ subtitleFontSize?: Optional<number>;
201
+ subtitleJustify?: Optional<string>;
202
+ background?: Optional<string>;
203
+ showBackground?: Optional<boolean>;
204
+ };
205
+ export type JobObjectManualLegend = {
206
+ type: 'manualLegend';
207
+ id: string;
208
+ name: string;
209
+ position: AdornmentPosition;
210
+ stacking?: Optional<Orientation>;
211
+ layout?: Optional<Orientation>;
212
+ title?: Optional<string>;
213
+ titleFont?: Optional<string>;
214
+ titleFontColor?: Optional<string>;
215
+ titleFontSize?: Optional<number>;
216
+ entryFont?: Optional<string>;
217
+ entryFontColor?: Optional<string>;
218
+ entryFontSize?: Optional<number>;
219
+ entryShape?: Optional<'rectangle' | 'circle' | 'line' | 'icon'>;
220
+ entries: Array<{
221
+ label: string;
222
+ color: string;
223
+ svg: string;
224
+ }>;
225
+ background?: Optional<string>;
226
+ showBackground?: Optional<boolean>;
227
+ };
228
+ export type JobObjectConnectedLegend = {
229
+ type: 'connectedLegend';
230
+ id: string;
231
+ name: string;
232
+ target: {
233
+ modelType: 'area';
234
+ groupId: string;
235
+ };
236
+ position: AdornmentPosition;
237
+ stacking?: Optional<Orientation>;
238
+ layout?: Optional<Orientation>;
239
+ title?: Optional<string>;
240
+ titleFont?: Optional<string>;
241
+ titleFontColor?: Optional<string>;
242
+ titleFontSize?: Optional<number>;
243
+ labelFont?: Optional<string>;
244
+ labelFontColor?: Optional<string>;
245
+ labelFontSize?: Optional<number>;
246
+ labelStyle?: Optional<'range' | 'threshold'>;
247
+ numberFormat?: Optional<string>;
248
+ decimalSeparator?: Optional<string>;
249
+ groupSeparator?: Optional<string>;
250
+ background?: Optional<string>;
251
+ showBackground?: Optional<boolean>;
252
+ };
253
+ export type JobObjectLine = {
254
+ id: string;
255
+ name: string;
256
+ anchorPoints: Array<[number, number]>;
257
+ anchorPointNames?: Optional<Array<string | null>>;
258
+ geometry: Array<[number, number]>;
259
+ lineWidth?: Optional<number>;
260
+ lineColor?: Optional<string>;
261
+ lineStyle?: Optional<'solid' | 'dashed' | 'dotted'>;
262
+ lineType?: Optional<'line' | 'route'>;
263
+ lineDashArray?: Optional<number[]>;
264
+ transportType?: Optional<'car' | 'bicycle' | 'pedestrian'>;
265
+ smoothness?: Optional<number>;
266
+ svg?: Optional<string>;
267
+ iconScale?: Optional<number>;
268
+ iconRotation?: Optional<number>;
269
+ iconOffset?: Optional<[number, number]>;
270
+ iconAlign?: Optional<boolean>;
271
+ locked?: Optional<boolean>;
272
+ visible?: Optional<boolean>;
273
+ popup?: Optional<string>;
274
+ popupMedia?: Optional<PopupMedia>;
275
+ dataBindings?: Optional<JobObjectDataBindings>;
276
+ };
277
+ export type JobObjectPolygon = {
278
+ id: string;
279
+ name: string;
280
+ anchorPoints: Array<Array<[number, number]>> | Array<[number, number]>;
281
+ fillColor?: Optional<string>;
282
+ outlineColor?: Optional<string>;
283
+ polygonType?: Optional<'regular' | 'smooth'>;
284
+ outlineWidth?: Optional<number>;
285
+ fillPattern?: Optional<string>;
286
+ fillPatternName?: Optional<string>;
287
+ locked?: Optional<boolean>;
288
+ visible?: Optional<boolean>;
289
+ popup?: Optional<string>;
290
+ popupMedia?: Optional<PopupMedia>;
291
+ dataBindings?: Optional<JobObjectDataBindings>;
292
+ };
293
+ export type JobObjectDot = {
294
+ id: string;
295
+ name: string;
296
+ center: {
297
+ lng: number;
298
+ lat: number;
299
+ };
300
+ radius: number;
301
+ fillColor?: Optional<string>;
302
+ locked?: Optional<boolean>;
303
+ visible?: Optional<boolean>;
304
+ popup?: Optional<string>;
305
+ popupMedia?: Optional<PopupMedia>;
306
+ dataBindings?: Optional<JobObjectDataBindings>;
307
+ };
308
+ export type JobObjectCircle = {
309
+ id: string;
310
+ name: string;
311
+ center: {
312
+ lng: number;
313
+ lat: number;
314
+ };
315
+ radius: number;
316
+ majorUnit?: Optional<boolean>;
317
+ locationName?: Optional<string>;
318
+ fillColor?: Optional<string>;
319
+ outlineColor?: Optional<string>;
320
+ radiusLineColor?: Optional<string>;
321
+ fillPattern?: Optional<string>;
322
+ fillPatternName?: Optional<string>;
323
+ outlineWidth?: Optional<number>;
324
+ radiusLineEnabled?: Optional<boolean>;
325
+ radiusLineWidth?: Optional<number>;
326
+ radiusLineBearing?: Optional<number>;
327
+ locked?: Optional<boolean>;
328
+ visible?: Optional<boolean>;
329
+ popup?: Optional<string>;
330
+ popupMedia?: Optional<PopupMedia>;
331
+ dataBindings?: Optional<JobObjectDataBindings>;
332
+ };
333
+ export type JobObjectMarker = {
334
+ id: string;
335
+ name: string;
336
+ lngLat: {
337
+ lng: number;
338
+ lat: number;
339
+ };
340
+ locationName?: Optional<string>;
341
+ svg?: Optional<string>;
342
+ iconAnchor?: Optional<Anchor>;
343
+ iconScale?: Optional<number>;
344
+ iconRotation?: Optional<number>;
345
+ iconOffset?: Optional<[number, number]>;
346
+ text?: Optional<string>;
347
+ textFont: string;
348
+ textMaxWidth?: Optional<number>;
349
+ textSize?: Optional<number>;
350
+ textAnchor?: Optional<Anchor>;
351
+ textLineHeight?: Optional<number>;
352
+ textLetterSpacing?: Optional<number>;
353
+ textJustify?: Optional<'left' | 'center' | 'right'>;
354
+ textRotation?: Optional<number>;
355
+ textOffset?: Optional<[number, number]>;
356
+ textColor?: Optional<string>;
357
+ textHaloColor?: Optional<string>;
358
+ textHaloWidth?: Optional<number>;
359
+ locked?: Optional<boolean>;
360
+ visible?: Optional<boolean>;
361
+ popup?: Optional<string>;
362
+ popupMedia?: Optional<PopupMedia>;
363
+ dataBindings?: Optional<JobObjectDataBindings>;
364
+ };
365
+ export type JobObjectArea = {
366
+ id: string;
367
+ name: string;
368
+ featureId: Optional<number>;
369
+ vectorUrl: string;
370
+ sourceLayerId: string;
371
+ boundingBox?: Optional<[number, number, number, number]>;
372
+ fillColor?: Optional<string>;
373
+ outlineColor?: Optional<string>;
374
+ outlineWidth?: Optional<number>;
375
+ fillPattern?: Optional<string>;
376
+ fillPatternName?: Optional<string>;
377
+ locked?: Optional<boolean>;
378
+ visible?: Optional<boolean>;
379
+ popup?: Optional<string>;
380
+ popupMedia?: Optional<PopupMedia>;
381
+ dataBindings?: Optional<JobObjectDataBindings>;
382
+ };
383
+ export type JobObjectDataBindings = Record<string, JobObjectStoredValue>;
384
+ export type JobObjectModelType = 'line' | 'polygon' | 'circle' | 'dot' | 'marker' | 'area';
385
+ export type JobObjectKeyframe = {
386
+ time: number;
387
+ center: [number, number];
388
+ zoom: number;
389
+ bearing: number;
390
+ pitch: number;
391
+ fov?: Optional<number>;
392
+ elevation?: Optional<number>;
393
+ preview?: Optional<string>;
394
+ transition: 'ease' | 'linear' | 'instant';
395
+ hideLabels: boolean;
396
+ };
397
+ export type JobObjectAnimation = {
398
+ type: 'enterExit';
399
+ target: {
400
+ type: 'model';
401
+ modelType: JobObjectModelType;
402
+ groupId: string;
403
+ modelId: string | undefined;
404
+ } | {
405
+ type: 'layer';
406
+ ids: string[];
407
+ name: string;
408
+ } | {
409
+ type: 'overlay';
410
+ id: number;
411
+ };
412
+ entry: number;
413
+ entryDuration: number;
414
+ entryType: JobObjectAnimationType;
415
+ entryEasing: JobObjectEasingType;
416
+ exit: number;
417
+ exitDuration: number;
418
+ exitType: JobObjectAnimationType;
419
+ exitEasing: JobObjectEasingType;
420
+ };
421
+ export type JobObjectAnimationType = 'grow' | 'fade' | 'instant';
422
+ export type JobObjectEasingType = 'linear' | 'easeOutCubic' | 'easeOutBack' | 'easeOutBounce' | 'easeOutElastic';
423
+ /**
424
+ * All possible JobObject stored values and their representations as BoundValue objects:
425
+ *
426
+ * string -> { t: 's'; v: string } or { t: 'n'; v: string } if string can be parsed as a number
427
+ * number -> { t: 'n'; v: number }, implies 'General' format: { z: 0 | 'General' }, which is ignored
428
+ * boolean -> { t: 'b'; v: boolean }
429
+ * null -> { t: 'z' }, so-called Stub value (no data, and similar meaning)
430
+ *
431
+ * { t: 'n'; v: number; w: string; z: number | string } -> specially formatted number, like currency
432
+ * { t: 'd'; w: string; z: number | string } -> formatted data value, value is ignored as no meaning
433
+ * { t: 'e'; v: number; w?: string; z?: number | string } -> error value
434
+ */
435
+ export type JobObjectStoredValue = string | number | boolean | null | {
436
+ t: 'n';
437
+ v: number;
438
+ w: string;
439
+ z?: string | number;
440
+ } | {
441
+ t: 'd';
442
+ v?: number;
443
+ w: string;
444
+ z?: string | number;
445
+ } | {
446
+ t: 'e';
447
+ v: number;
448
+ w?: string;
449
+ z?: string | number;
450
+ };
451
+ export type AdornmentPosition = 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | 'top_center' | 'bottom_center' | 'left_center' | 'right_center';
452
+ export type Orientation = 'horizontal' | 'vertical';
453
+ export type WebControlsSubType = 'fullscreen' | 'geolocation' | 'refresh' | 'search' | 'zoom';
454
+ type Anchor = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
455
+ export type JobObjectSlotName = 'beforeNone' | 'beforeNames' | 'beforeBoundaries' | 'beforeWaters';
456
+ export type JobObjectSlots = {
457
+ [slot in JobObjectSlotName]?: Optional<SlotEntry[]>;
458
+ };
459
+ export type SlotEntry = {
460
+ type: JobObjectModelType;
461
+ groupId: string;
462
+ };
463
+ export type Grid = {
464
+ grid: boolean;
465
+ top: number;
466
+ bottom: number;
467
+ left: number;
468
+ right: number;
469
+ safeAreaTop: boolean;
470
+ safeAreaBottom: boolean;
471
+ safeAreaLeft: boolean;
472
+ safeAreaRight: boolean;
473
+ };
474
+ export type PopupMedia = {
475
+ type: 'image';
476
+ src: string;
477
+ alt: string;
478
+ fill: boolean;
479
+ } | {
480
+ type: 'video';
481
+ src: string;
482
+ allowFullscreen: boolean;
483
+ loop: boolean;
484
+ };
485
+ export type ScalebarUnit = 'metric_and_imperial' | 'metric' | 'imperial' | 'nautical';
486
+ export type OffsetUnit = 'px' | '%';
487
+ export type PositionOffset = {
488
+ x: number;
489
+ y: number;
490
+ unit: OffsetUnit;
491
+ };
492
+ export type PositionOffsets = {
493
+ [key in AdornmentPosition]: PositionOffset;
494
+ };
495
+ export type VideoEncoding = 'webCodecs' | 'ffmpegV4' | 'scripps720p' | 'scripps1080i';
496
+ export type ColorMode = 'linear' | 'quantile' | 'quantize' | 'categorical';
497
+ export type CategoricalGroup = {
498
+ values: Record<string | number, string>;
499
+ colors: Record<string, {
500
+ order: number;
501
+ title?: Optional<string>;
502
+ hidden?: Optional<boolean>;
503
+ }>;
504
+ };
505
+ export type Choropleth = {
506
+ colorMode: ColorMode;
507
+ colorCount: number;
508
+ upperColor: string;
509
+ lowerColor: string;
510
+ unmatchedColor: string;
511
+ defaultGroupName: string;
512
+ categoricalColors: Record<string, CategoricalGroup>;
513
+ };
514
+ export {};
@@ -0,0 +1,62 @@
1
+ import { JobObjectModelType } from './jobObject';
2
+ import { LayerSpecification } from '@mapcreator/maplibre-gl';
3
+ export type Anchor = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
4
+ export type Justify = 'left' | 'center' | 'right';
5
+ export interface LabelStylePreset {
6
+ id: string;
7
+ name: string;
8
+ group?: string;
9
+ layout?: {
10
+ 'icon-anchor'?: Anchor;
11
+ 'icon-image'?: string;
12
+ 'icon-offset'?: [number, number];
13
+ 'icon-rotate'?: number;
14
+ 'icon-size'?: number;
15
+ 'text-anchor'?: Anchor;
16
+ 'text-font'?: string;
17
+ 'text-max-width'?: number;
18
+ 'text-offset'?: [number, number];
19
+ 'text-rotate'?: number;
20
+ 'text-size'?: number;
21
+ 'text-line-height'?: number;
22
+ 'text-letter-spacing'?: number;
23
+ 'text-justify'?: Justify;
24
+ };
25
+ paint?: {
26
+ 'text-color'?: string;
27
+ 'text-halo-color'?: string;
28
+ 'text-halo-width'?: number;
29
+ };
30
+ }
31
+ /**
32
+ * The type for metadata field in MapLibre layers.
33
+ * It is unknown in MapLibre typings so we cast to it whenever we use layer metadata.
34
+ */
35
+ export type LayerMetadata = {
36
+ 'display-path'?: string[];
37
+ 'display-group'?: string;
38
+ 'display-name'?: string;
39
+ 'mc-add-before'?: string;
40
+ 'mc-original-layer-id'?: string;
41
+ 'mc-model-type'?: JobObjectModelType;
42
+ 'mc-model-id-prefix'?: string;
43
+ 'mc-group-id'?: string;
44
+ } | undefined;
45
+ /**
46
+ * The type for metadata field in mapstyles.
47
+ * It is unknown in MapLibre typings so we cast to it whenever we use mapstyle metadata.
48
+ */
49
+ export type MapstyleMetadata = {
50
+ 'mc:label-presets'?: LabelStylePreset[];
51
+ 'mc:background-color'?: string;
52
+ 'mc:background-color-globe'?: string;
53
+ 'colorconversion'?: Array<{
54
+ rgbin: string;
55
+ cmykout: string;
56
+ }>;
57
+ 'styleOverride'?: {
58
+ [layerId: string]: Partial<LayerSpecification>;
59
+ };
60
+ 'customCssFilePath'?: string;
61
+ 'publication'?: string;
62
+ } | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function isMobile(): boolean;
2
+ export declare function isFirefox(): boolean;
@@ -0,0 +1,12 @@
1
+ import { ScaleLinear, ScaleOrdinal, ScaleQuantile, ScaleQuantize } from 'd3-scale';
2
+ import { CategoricalGroup, JobObjectAreaGroup } from '../types/jobObject';
3
+ import { ModelBindings } from '../types';
4
+ export type ColorGenerator = ScaleLinear<string, string> | ScaleQuantile<string> | ScaleQuantize<string> | ScaleOrdinal<string, string>;
5
+ export declare const legendTickCount = 4;
6
+ export declare function getColorGenerator(group: JobObjectAreaGroup): ColorGenerator | undefined;
7
+ export declare function getChoroplethValues(group: JobObjectAreaGroup): Array<number | string> | undefined;
8
+ export declare function getColorSamples(lowerColor: string, upperColor: string, colorCount?: number): string[];
9
+ export declare function getColumnType(modelBindings: ModelBindings[], dataColumn?: string | undefined): 'color' | 'number' | 'string' | undefined;
10
+ export declare function getColumnName(value: string | undefined): string | undefined;
11
+ export declare function groupByColor(values: CategoricalGroup['values']): Record<string, string | null>;
12
+ export declare function isChoroplethColumn(modelBindings: ModelBindings[], dataColumn?: string | undefined): boolean;
@@ -0,0 +1,4 @@
1
+ export declare function isFullscreenSupported(): boolean;
2
+ export declare function isFullscreen(mapContainer: HTMLElement): boolean;
3
+ export declare function enterFullscreen(mapContainer: HTMLElement): void;
4
+ export declare function exitFullscreen(): void;
@@ -0,0 +1,6 @@
1
+ import { Map } from '@mapcreator/maplibre-gl';
2
+ export declare const loadLocationDot: (map: Map) => void;
3
+ export declare const initLayersAndSources: (map: Map) => void;
4
+ export declare const addLocationDot: (map: any, lng: number, lat: number) => void;
5
+ export declare const createCircle: (lng: number, lat: number, meters: number) => any;
6
+ export declare const showNotification: () => void;