@mapcreator/sdk 0.0.0-opacity.0

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