• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jumpinjackie / mapguide-react-layout / 22997640305

12 Mar 2026 10:32AM UTC coverage: 36.597% (-0.3%) from 36.937%
22997640305

Pull #1603

github

web-flow
Merge 59c28113e into d20ddfb87
Pull Request #1603: Add declarative map swipe (layer compare) feature

1618 of 2109 branches covered (76.72%)

77 of 431 new or added lines in 17 files covered. (17.87%)

408 existing lines in 7 files now uncovered.

8897 of 24311 relevant lines covered (36.6%)

8.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.63
/src/api/common.ts
1
import { ResultColumnSet } from "./contracts/weblayout";
2
import { RuntimeMap } from "./contracts/runtime-map";
3
import { FeatureSet, LayerMetadata, QueryMapFeaturesResponse, SelectedFeature } from "./contracts/query";
4
import { IQueryMapFeaturesOptions } from './request-builder';
5

6
import olPoint from "ol/geom/Point";
7
import olLineString from "ol/geom/LineString";
8
import olCircle from "ol/geom/Circle";
9
import olPolygon from "ol/geom/Polygon";
10
import olGeometry from "ol/geom/Geometry";
11

12
import olLayerBase from "ol/layer/Base";
13
import olInteraction from "ol/interaction/Interaction";
14
import olOverlay from "ol/Overlay";
15

16
import { IOLFactory } from "./ol-factory";
17
import { ViewerAction, IGenericSubjectMapLayer, IInitialExternalLayer, ISelectedFeaturePopupTemplateConfiguration } from '../actions/defs';
18
import { ProjectionLike } from 'ol/proj';
19
import { IParsedFeatures } from './layer-manager/parsed-features';
20
import Collection from 'ol/Collection';
21
import Feature from 'ol/Feature';
22
import { ISubscriberProps } from '../containers/subscriber';
23
import Geometry from 'ol/geom/Geometry';
24
import { IBasicPointCircleStyle, IPointIconStyle, IBasicVectorLineStyle, IBasicVectorPolygonStyle, IVectorLayerStyle, IClusterSettings, ClusterClickAction, IHeatmapSettings } from './ol-style-contracts';
25
import { IToolbarAppState } from './registry/command';
26
import { ClientSelectionSet } from "./contracts/common";
27

28
// Event boilerplate
29
export type GenericEvent = any;
30

31
export type GenericEventHandler = (e: GenericEvent) => void;
32

33
/**
34
 * Defines a size
35
 */
36
export type Size = { w: number, h: number };
37

38
/**
39
 * The default blank size
40
 */
41
export const BLANK_SIZE: Size = { w: 1, h: 1 } as const;
1✔
42

43
/**
44
 * @deprecated Use UnitOfMeasure enum instead
45
 */
46
export type UnitName = 'Unknown' | 'Inches' | 'Feet' | 'Yards' | 'Miles' | 'Nautical Miles'
47
    | 'Millimeters' | 'Centimeters' | 'Meters' | 'Kilometers'
48
    | 'Degrees' | 'Decimal Degrees' | 'Degrees Minutes Seconds' | 'Pixels';
49
export enum UnitOfMeasure {
1✔
50
    /**
51
     * An unknown unit
52
     */
53
    Unknown = 0,
1✔
54
    /**
55
     * Inch unit
56
     */
57
    Inches = 1,
1✔
58
    /**
59
     * Feet unit
60
     */
61
    Feet = 2,
1✔
62
    /**
63
     * Yard unit
64
     */
65
    Yards = 3,
1✔
66
    /**
67
     * Mile unit
68
     */
69
    Miles = 4,
1✔
70
    /**
71
     * Nautical Mile unit
72
     */
73
    NauticalMiles = 5,
1✔
74
    /**
75
     * Millimeter unit
76
     */
77
    Millimeters = 6,
1✔
78
    /**
79
     * Centimeter unit
80
     */
81
    Centimeters = 7,
1✔
82
    /**
83
     * Meter unit
84
     */
85
    Meters = 8,
1✔
86
    /**
87
     * Kilometer unit
88
     */
89
    Kilometers = 9,
1✔
90
    /**
91
     * Degree unit
92
     */
93
    Degrees = 10,
1✔
94
    /**
95
     * Decimal Degree unit
96
     */
97
    DecimalDegrees = 11,
1✔
98
    /**
99
     * DMS unit
100
     */
101
    DMS = 12,
1✔
102
    /**
103
     * Pixel unit
104
     */
105
    Pixels = 13,
1✔
106
}
107

108
export interface UnitInfo {
109
    unitsPerMeter: number;
110
    metersPerUnit: number;
111
    name: UnitName;
112
    /**
113
     * @since 0.12.2
114
     */
115
    localizedName: (locale?: string) => string;
116
    abbreviation: (locale?: string) => string;
117
}
118

119
/**
120
 * Describes a map view
121
 * 
122
 * @interface IMapView
123
 */
124
export interface IMapView {
125
    /**
126
     * The x coordinate
127
     *
128
     * @type {number}
129
     *
130
     */
131
    x: number;
132
    /**
133
     * The Y coordinate
134
     *
135
     * @type {number}
136
     *
137
     */
138
    y: number;
139
    /**
140
     * The scale
141
     *
142
     * @type {number}
143
     *
144
     */
145
    scale: number;
146
    /**
147
     * The view resolution
148
     * 
149
     * @type {number | undefined}
150
     *
151
     */
152
    resolution?: number;
153
}
154

155
/**
156
 * Describes a function that is called when a command is invoked
157
 * 
158
 * @since 0.15 stronger-typed parameters
159
 */
160
export type DispatcherFunc = (dispatch: ReduxDispatch, getState: () => Readonly<IApplicationState>, viewer?: IMapViewer, parameters?: Record<string, unknown>) => any;
161

162
/**
163
 * Describes a viewer command
164
 *
165
 * @interface ICommand
166
 */
167
export interface ICommand {
168
    /**
169
     * The icon for this command
170
     *
171
     * @type {string}
172
     *
173
     */
174
    icon?: string;
175
    iconClass?: string;
176
    //tooltip?: string;
177
    /**
178
     * @since 0.12.8
179
     */
180
    title?: string;
181
    /**
182
     * Indicates if this command is enabled based on the given application state
183
     *
184
     *
185
     *
186
     */
187
    enabled: (state: Readonly<IToolbarAppState>, parameters?: any) => boolean;
188
    /**
189
     * Indicates if this command is enabled based on the given application state
190
     *
191
     *
192
     *
193
     */
194
    selected: (state: Readonly<IToolbarAppState>) => boolean;
195
    /**
196
     * Invokes the command
197
     *
198
     * @type {DispatcherFunc}
199
     *
200
     */
201
    invoke: DispatcherFunc;
202
}
203

204
/**
205
 * Valid command targets for an InvokeURL command
206
 */
207
export type CommandTarget = "TaskPane" | "NewWindow" | "SpecifiedFrame";
208

209
/**
210
 * An InvokeURL command parameter
211
 *
212
 * @interface IInvokeUrlCommandParameter
213
 */
214
export interface IInvokeUrlCommandParameter {
215
    /**
216
     * The name of the parameter
217
     *
218
     * @type {string}
219
     *Parameter
220
     */
221
    name: string;
222
    /**
223
     * The value of the parameter
224
     *
225
     * @type {string}
226
     *Parameter
227
     */
228
    value: string;
229
}
230

231
/**
232
 * Describes a command that will run in a pre-defined target frame or window
233
 *
234
 * @interface ITargetedCommand
235
 */
236
export interface ITargetedCommand {
237
    /**
238
     * Specifies the target which the URL should be invoked in
239
     *
240
     * @type {CommandTarget}
241
     *
242
     */
243
    target: CommandTarget;
244
    /**
245
     * The name of the frame to run this command in. Only applies if the target is
246
     * "SpecifiedFrame"
247
     */
248
    targetFrame?: string;
249
}
250

251
/**
252
 * Describes a command that invokes a URL into a specified target
253
 *
254
 * @interface IInvokeUrlCommand
255
 */
256
export interface IInvokeUrlCommand extends ITargetedCommand {
257
    /**
258
     * The icon for this command
259
     *
260
     * @type {string}
261
     *
262
     */
263
    icon?: string;
264
    iconClass?: string;
265
    /**
266
     * @since 0.12.8
267
     */
268
    title?: string;
269
    /**
270
     * The URL to invoke
271
     *
272
     * @type {string}
273
     *
274
     */
275
    url: string;
276
    /**
277
     * Indicates whether to disable this command if there is no map selection
278
     *
279
     * @type {boolean}
280
     *
281
     */
282
    disableIfSelectionEmpty?: boolean;
283
    /**
284
     * Additional command parameters
285
     *
286
     */
287
    parameters: IInvokeUrlCommandParameter[];
288
}
289

290
/**
291
 * Describes a search command
292
 *
293
 * @interface ISearchCommand
294
 */
295
export interface ISearchCommand extends ITargetedCommand {
296
    /**
297
     * The icon for this command
298
     *
299
     * @type {string}
300
     *
301
     */
302
    icon?: string;
303
    iconClass?: string;
304
    /**
305
     * The name of the map layer this commmand applies to
306
     *
307
     * @type {string}
308
     *
309
     */
310
    layer: string;
311
    /**
312
     * The prompt to display in the search command UI
313
     *
314
     * @type {string}
315
     *
316
     */
317
    prompt: string;
318
    /**
319
     * The title to display in the search command UI
320
     *
321
     * @type {string}
322
     *
323
     */
324
    title: string;
325
    /**
326
     * The set of feature properties to show in the search results
327
     *
328
     * @type {ResultColumnSet}
329
     *
330
     */
331
    resultColumns: ResultColumnSet;
332
    /**
333
     * The search filter to apply based on user input
334
     *
335
     * @type {string}
336
     *
337
     */
338
    filter?: string;
339
    /**
340
     * The maximum number of results to return
341
     *
342
     * @type {number}
343
     *
344
     */
345
    matchLimit: number;
346
}
347

348
/**
349
 * Type alias for a dictionary-like structure
350
 */
351
export type Dictionary<T> = { [key: string]: T };
352

353
/**
354
 * A 2d coordinate (renamed to Coordinate2D from Coordinate in 0.13)
355
 */
356
export type Coordinate2D = [number, number];
357

358
/**
359
 * A size quantity
360
 * @since 0.13
361
 */
362
export type Size2 = [number, number];
363

364
/**
365
 * A bounding box array
366
 */
367
export type Bounds = [number, number, number, number];
368

369
/**
370
 * An active map viewer tool
371
 *
372
 * @enum {number}
373
 */
374
export enum ActiveMapTool {
1✔
375
    /**
376
     * Zoom tool
377
     */
378
    Zoom,
1✔
379
    /**
380
     * Selection tool
381
     */
382
    Select,
1✔
383
    /**
384
     * Pan tool
385
     */
386
    Pan,
1✔
387
    /**
388
     * None
389
     */
390
    None
1✔
391
}
392

393
/**
394
 * Describes an external base layer
395
 * 
396
 * @interface IExternalBaseLayer
397
 */
398
export interface IExternalBaseLayer {
399
    /**
400
     * The name of the external base layer
401
     *
402
     * @type {string}
403
     *
404
     */
405
    name: string;
406
    /**
407
     * The kind of external base layer
408
     *
409
     * @type {string}
410
     *
411
     */
412
    kind: string;
413
    /**
414
     * Indicates if this external base layer is visible
415
     *
416
     * @type {boolean}
417
     *
418
     */
419
    visible?: boolean;
420
    /**
421
     * Additional options for initializing the external base layer
422
     *
423
     * @type {*}
424
     *
425
     */
426
    options?: any;
427
}
428

429

430
/**
431
 * Describes a menu entry on the Map Menu component
432
 * 
433
 * @interface IMapMenuEntry
434
 */
435
export interface IMapMenuEntry {
436
    /**
437
     * The runtime map name
438
     *
439
     * @type {string}
440
     *
441
     */
442
    mapName: string;
443
    /**
444
     * The menu entry label
445
     *
446
     * @type {string}
447
     *
448
     */
449
    label: string;
450
}
451

452
/**
453
 * A bit mask indicating how a map viewer should refresh
454
 *
455
 * @enum {number}
456
 */
457
export enum RefreshMode {
1✔
458
    /**
459
     * Refresh only the layers
460
     */
461
    LayersOnly = 1,
1✔
462
    /**
463
     * Refresh only the selection
464
     */
465
    SelectionOnly = 2
1✔
466
}
467

468
/**
469
 * The spatial operator to use for selection operations
470
 */
471
export type SelectionVariant = "INTERSECTS" | "TOUCHES" | "WITHIN" | "ENVELOPEINTERSECTS";
472

473
/**
474
 * MapGuide-specific viewer functionality
475
 *
476
 * @interface IMapGuideViewerSupport
477
 * @since 0.14
478
 */
479
export interface IMapGuideViewerSupport {
480
    /**
481
     * Sets the selection XML
482
     *
483
     * @param {string} xml
484
     * @param {IQueryMapFeaturesOptions} [queryOpts]
485
     * @param {(res: QueryMapFeaturesResponse) => void} [success]
486
     * @param {(err: Error) => void} [failure]
487
     *
488
     *er
489
     */
490
    setSelectionXml(xml: string, queryOpts?: Partial<IQueryMapFeaturesOptions>, success?: (res: QueryMapFeaturesResponse) => void, failure?: (err: Error) => void): void;
491
    /**
492
     * Clears the map selection
493
     *
494
     *
495
     *er
496
     */
497
    clearSelection(): void;
498
    /**
499
     * Performs a map selection by the given geometry
500
     *
501
     * @param {olGeometry} geom The geometry to select with
502
     * @param {SelectionVariant} selectionMethod The selection method
503
     *er
504
     */
505
    selectByGeometry(geom: olGeometry, selectionMethod?: SelectionVariant): void;
506
    /**
507
     * Performs a map selection by the given query options
508
     *
509
     * @param {IQueryMapFeaturesOptions} options
510
     * @param {(res: QueryMapFeaturesResponse) => void} [success]
511
     * @param {(err: Error) => void} [failure]
512
     *
513
     *er
514
     */
515
    queryMapFeatures(options: IQueryMapFeaturesOptions, success?: (res: QueryMapFeaturesResponse) => void, failure?: (err: Error) => void): void;
516
    /**
517
     * Gets the current selection model
518
     *
519
     * @returns {QueryMapFeaturesResponse}
520
     *
521
     *er
522
     */
523
    getSelection(): QueryMapFeaturesResponse | null;
524
    /**
525
     * Gets the current selection model as a selection XML string
526
     *
527
     * @param {FeatureSet} selection
528
     * @param {string[]} [layerIds]
529
     * @returns {string}
530
     *
531
     *er
532
     */
533
    getSelectionXml(selection: FeatureSet, layerIds?: string[]): string;
534
    /**
535
     * Gets the current session id
536
     * 
537
     * @returns {string}
538
     *er
539
     */
540
    getSessionId(): string;
541
    /**
542
     * Gets whether feature tooltips are enabled
543
     *
544
     * @returns {boolean}
545
     *
546
     *er
547
     */
548
    isFeatureTooltipEnabled(): boolean;
549
    /**
550
     * Enables/disables feature tooltips
551
     *
552
     * @param {boolean} enabled
553
     *
554
     *er
555
     */
556
    setFeatureTooltipEnabled(enabled: boolean): void;
557
}
558

559
/**
560
 * Map image export options
561
 *
562
 * @interface IMapImageExportOptions
563
 * @since 0.14
564
 */
565
export interface IMapImageExportOptions {
566
    /**
567
     * The size of the image to export. If not specified, it will use the map's current size
568
     *
569
     * @type {Size2}
570
     *
571
     */
572
    size?: Size2;
573
    /**
574
     * The type to export the mime type as. If not specified, it will default to PNG (image/png)
575
     *
576
     * @type {string}
577
     *
578
     */
579
    exportMimeType?: string;
580
    /**
581
     * The callback that will receive the content of the exported map image
582
     *
583
     *
584
     */
585
    callback: (imageBase64: string) => void;
586
}
587

588
/**
589
 * Describes the API for interacting with the map viewer
590
 *
591
 * @interface IMapViewer
592
 */
593
export interface IMapViewer {
594
    /**
595
     * Gets MapGuide-specific viewer functionality. If this viewer was not set up with MapGuide support, this is undefined
596
     *
597
     * @returns {(IMapGuideViewerSupport | undefined)}
598
     *er
599
     * @since 0.14
600
     */
601
    mapguideSupport(): IMapGuideViewerSupport | undefined;
602
    /**
603
     * Gets the projection of the map
604
     *
605
     * @returns {ol.ProjectionLike}
606
     *
607
     *er
608
     */
609
    getProjection(): ProjectionLike;
610
    /**
611
     * Gets the view for the given extent
612
     *
613
     * @param {Bounds} extent
614
     * @returns {IMapView}
615
     *
616
     *er
617
     * @since 0.14 If given an extent with zero-width or zero-height, the view will be computed off of an "inflated" version of this extent. If inflation is required, it will be inflated by 30 meters
618
     */
619
    getViewForExtent(extent: Bounds): IMapView;
620
    /**
621
     * Gets the current extent
622
     *
623
     * @returns {Bounds}
624
     *
625
     *er
626
     */
627
    getCurrentExtent(): Bounds;
628
    /**
629
     * Gets the current map view
630
     *
631
     * @returns {IMapView}
632
     *
633
     *er
634
     */
635
    getCurrentView(): IMapView;
636
    /**
637
     * Gets the current physical size of the map
638
     *
639
     * @returns {[number, number]}
640
     *
641
     *er
642
     */
643
    getSize(): [number, number];
644
    /**
645
     * Zooms to the specified map view
646
     *
647
     * @param {number} x
648
     * @param {number} y
649
     * @param {number} scale
650
     *
651
     *er
652
     */
653
    zoomToView(x: number, y: number, scale: number): void;
654
    /**
655
     * Refreshes the map
656
     *
657
     * @param {RefreshMode} [mode]
658
     *
659
     *er
660
     */
661
    refreshMap(mode?: RefreshMode): void;
662
    /**
663
     * Gets the meters per unit value
664
     *
665
     * @returns {number}
666
     *
667
     *er
668
     */
669
    getMetersPerUnit(): number;
670
    /**
671
     * Sets the active tool
672
     *
673
     * @param {ActiveMapTool} tool
674
     *
675
     *er
676
     */
677
    setActiveTool(tool: ActiveMapTool): void;
678
    /**
679
     * Gets the active tool
680
     *
681
     * @returns {ActiveMapTool}
682
     *
683
     *er
684
     */
685
    getActiveTool(): ActiveMapTool;
686
    /**
687
     * Sets the initial map view
688
     *
689
     *
690
     *er
691
     */
692
    initialView(): void;
693
    /**
694
     * Zooms in or out by the specified delta
695
     *
696
     * @param {number} delta
697
     *
698
     *er
699
     */
700
    zoomDelta(delta: number): void;
701
    /**
702
     * Gets whether the viewer is currently in the state of digitizing
703
     *
704
     * @returns {boolean}
705
     *
706
     *er
707
     */
708
    isDigitizing(): boolean;
709
    /**
710
     * Cancels active digitization
711
     *
712
     *er
713
     */
714
    cancelDigitization(): void;
715
    /**
716
     * Starts the digitization process for a point
717
     *
718
     * @param {DigitizerCallback<olPoint>} handler
719
     * @param {string} [prompt]
720
     *
721
     *er
722
     */
723
    digitizePoint(handler: DigitizerCallback<olPoint>, prompt?: string): void;
724
    /**
725
     * Starts the digitization process for a line
726
     *
727
     * @param {DigitizerCallback<olLineString>} handler
728
     * @param {string} [prompt]
729
     *
730
     *er
731
     */
732
    digitizeLine(handler: DigitizerCallback<olLineString>, prompt?: string): void;
733
    /**
734
     * Starts the digitization process for a line string
735
     *
736
     * @param {DigitizerCallback<olLineString>} handler
737
     * @param {string} [prompt]
738
     *
739
     *er
740
     */
741
    digitizeLineString(handler: DigitizerCallback<olLineString>, prompt?: string): void;
742
    /**
743
     * Starts the digitization process for a circle
744
     *
745
     * @param {DigitizerCallback<olCircle>} handler
746
     * @param {string} [prompt]
747
     *
748
     *er
749
     */
750
    digitizeCircle(handler: DigitizerCallback<olCircle>, prompt?: string): void;
751
    /**
752
     * Starts the digitization process for a rectangle
753
     *
754
     * @param {DigitizerCallback<olPolygon>} handler
755
     * @param {string} [prompt]
756
     *
757
     *er
758
     */
759
    digitizeRectangle(handler: DigitizerCallback<olPolygon>, prompt?: string): void;
760
    /**
761
     * Starts the digitization process for a polygon
762
     *
763
     * @param {DigitizerCallback<olPolygon>} handler
764
     * @param {string} [prompt]
765
     *
766
     *er
767
     */
768
    digitizePolygon(handler: DigitizerCallback<olPolygon>, prompt?: string): void;
769
    /**
770
     * Zooms to the specified extent
771
     *
772
     * @param {Bounds} extent
773
     *
774
     *er
775
     */
776
    zoomToExtent(extent: Bounds): void;
777
    /**
778
     * Gets the layer manager for the given map. If map name is not specifed
779
     * it will get the layer manager for the currently active map.
780
     *
781
     * @param {string} [mapName]
782
     * @returns {ILayerManager}
783
     *er
784
     * @since 0.12
785
     */
786
    getLayerManager(mapName?: string): ILayerManager;
787
    /**
788
     * Adds an OpenLayers interaction
789
     *
790
     * @template T
791
     * @param {T} interaction
792
     * @returns {T}
793
     *
794
     *er
795
     */
796
    addInteraction<T extends olInteraction>(interaction: T): T;
797
    /**
798
     * Removes the given OpenLayers interaction
799
     *
800
     * @template T
801
     * @param {T} interaction
802
     *
803
     *er
804
     */
805
    removeInteraction<T extends olInteraction>(interaction: T): void;
806
    /**
807
     * Adds an OpenLayers overlay
808
     *
809
     * @param {olOverlay} overlay
810
     *
811
     *er
812
     */
813
    addOverlay(overlay: olOverlay): void;
814
    /**
815
     * Removes the given OpenLayers overlay
816
     *
817
     * @param {olOverlay} overlay
818
     *
819
     *er
820
     */
821
    removeOverlay(overlay: olOverlay): void;
822
    /**
823
     * Adds an event handler for the specified event
824
     *
825
     * @param {string} eventName
826
     * @param {Function} handler
827
     *
828
     *er
829
     */
830
    addHandler(eventName: string, handler: Function): void;
831
    /**
832
     * Removes an event handler for the specified event
833
     *
834
     * @param {string} eventName
835
     * @param {Function} handler
836
     *
837
     *er
838
     */
839
    removeHandler(eventName: string, handler: Function): void;
840
    /**
841
     * Gets the OL object factory
842
     */
843
    getOLFactory(): IOLFactory;
844
    /**
845
     * Gets the view resolution
846
     *
847
     * @returns {number}
848
     *
849
     *er
850
     */
851
    getResolution(): number | undefined;
852
    /**
853
     * Gets the resolution for the given scale
854
     *
855
     * @returns {number}
856
     *
857
     *er
858
     */
859
    scaleToResolution(scale: number): number;
860
    /**
861
     * Gets the name of the current runtime map
862
     * 
863
     * @returns {string} 
864
     *er
865
     */
866
    getMapName(): string;
867
    /**
868
     * Sets the current view rotation
869
     * 
870
     * @param {number} rotation 
871
     *er
872
     */
873
    setViewRotation(rotation: number): void;
874
    /**
875
     * Gets the current view rotation
876
     * 
877
     * @returns {number} 
878
     *er
879
     */
880
    getViewRotation(): number;
881
    /**
882
     * Gets whether view rotation is enabled
883
     * 
884
     * @returns {boolean} 
885
     *er
886
     */
887
    isViewRotationEnabled(): boolean;
888
    /**
889
     * Sets whether view rotation is enabled or not
890
     * 
891
     * @param {boolean} enabled 
892
     *er
893
     */
894
    setViewRotationEnabled(enabled: boolean): void;
895
    /**
896
     * 
897
     * @since 0.11
898
     * @param {number} x 
899
     * @param {number} y 
900
     * @returns {[number, number]} 
901
     *er
902
     */
903
    screenToMapUnits(x: number, y: number): [number, number];
904

905
    toastSuccess(icon: string, message: string | JSX.Element): string | undefined;
906
    toastWarning(icon: string, message: string | JSX.Element): string | undefined;
907
    toastError(icon: string, message: string | JSX.Element): string | undefined;
908
    toastPrimary(icon: string, message: string | JSX.Element): string | undefined;
909
    dismissToast(key: string): void;
910
    updateSize(): void;
911

912
    /**
913
     * Returns the collection of selected client-side vector features. This collection
914
     * is observable, so you may hold onto a reference to this collection and subscribe
915
     * to events on this collection for when new features are added or removed from this collection
916
     * 
917
     * @returns {Collection<Feature>}
918
     *er
919
     * @since 0.13
920
     * @since 0.14 - The return value may be undefined if called when the map viewer is detached/disposed/destroyed
921
     */
922
    getSelectedFeatures(): Collection<Feature<Geometry>> | undefined;
923

924
    /**
925
     * INTERNAL API. Not for public use
926
     * @hidden
927
     */
928
    addImageLoading(): void;
929
    /**
930
     * INTERNAL API. Not for public use
931
     * @hidden
932
     */
933
    addImageLoaded(): void;
934
    /**
935
     * EXPERIMENTAL:
936
     * Adds the given application state subscribers
937
     * 
938
     * NOTE: Calling this method will trigger a re-render of the component. Due to this quirk, 
939
     * calling this method again while a re-render is taking place may cause the subscriber to
940
     * not actually be registered. Calling this method multiple times in succession is therefore
941
     * not advised. If you need to add multiple subscribers, pass an array of the subscribers to
942
     * register in a single method call.
943
     * 
944
     * @param props 
945
     * @since 0.13
946
     */
947
    addSubscribers(props: ISubscriberProps[]): string[];
948
    /**
949
     * EXPERIMENTAL:
950
     * Removes application state subscribers of the given names
951
     * 
952
     * @param names
953
     * @since 0.13
954
     */
955
    removeSubscribers(names: string[]): boolean;
956
    /**
957
     * EXPERIMENTAL:
958
     * Gets all application state subscriber names
959
     * 
960
     * @since 0.13
961
     */
962
    getSubscribers(): string[];
963
    /**
964
     * Dispatches the given action
965
     * 
966
     * @remarks Usage outside of the react component context (eg. Plain HTML Task Pane content) should be used sparingly. In particular
967
     * you should avoid trying to call this method multiple times in succession. You should call this method once in response to a DOM element
968
     * event (eg. A button click)
969
     * @alpha
970
     * @since 0.13
971
     */
972
    dispatch(action: any): void;
973

974
    /**
975
     * Gets the default point circle style
976
     * @since 0.13
977
     */
978
    getDefaultPointCircleStyle(): IBasicPointCircleStyle;
979

980
    /**
981
     * Gets the default point icon style
982
     * @since 0.13
983
     */
984
    getDefaultPointIconStyle(): IPointIconStyle;
985

986
    /**
987
     * Gets the default line style
988
     * @since 0.13
989
     */
990
    getDefaultLineStyle(): IBasicVectorLineStyle;
991

992
    /**
993
     * Gets the default polygon style
994
     * @since 0.13
995
     */
996
    getDefaultPolygonStyle(): IBasicVectorPolygonStyle;
997

998
    /**
999
     * Exports an image of the current map view
1000
     *
1001
     * @param {IMapImageExportOptions} options
1002
     *er
1003
     * @since 0.14
1004
     */
1005
    exportImage(options: IMapImageExportOptions): void;
1006
}
1007

1008
/**
1009
 * WMS layer extension data
1010
 * 
1011
 * @since 0.13
1012
 */
1013
export interface IWmsLayerExtensions {
1014
    type: "WMS";
1015
    getLegendUrl?: (resolution?: number) => string;
1016
}
1017

1018
/**
1019
 * Layer extension data
1020
 * 
1021
 * @since 0.13
1022
 */
1023
export type LayerExtensions = IWmsLayerExtensions;
1024

1025
export interface ILayerInfo {
1026
    /**
1027
     * The name of the layer
1028
     * 
1029
     * @type {string}
1030
     *
1031
    * */
1032
    name: string;
1033
    /**
1034
     * The display name of this layer
1035
     *
1036
     * @type {string}
1037
     *
1038
     * @since 0.14
1039
     */
1040
    displayName: string;
1041
    /**
1042
     * The type of layer
1043
     * 
1044
     * @type {string}
1045
     *
1046
     */
1047
    type: string;
1048
    /**
1049
     * An optional description for the layer
1050
     *
1051
     * @type {string}
1052
     *
1053
     * @since 0.14
1054
     */
1055
    description?: string;
1056
    /**
1057
     * Indicates if this layer is an external layer
1058
     * 
1059
     * @since 0.13
1060
     */
1061
    isExternal: boolean;
1062
    /** 
1063
     * Indicates if this layer is visible
1064
     * 
1065
     * @since 0.13
1066
     */
1067
    visible: boolean;
1068
    /**
1069
     * Indicates if this layer is selectable by the select tool
1070
     * 
1071
     * @since 0.13
1072
     */
1073
    selectable: boolean;
1074
    /**
1075
     * The opacity of this layer
1076
     * 
1077
     * @since 0.13
1078
     * @type {number}
1079
     *
1080
     */
1081
    opacity: number;
1082
    /**
1083
     * Extension data for this layer
1084
     * 
1085
     * @since 0.13
1086
     */
1087
    extensions?: LayerExtensions;
1088
    /**
1089
     * The vector style for this layer. Not applicable for raster layers.
1090
     * 
1091
     * @since 0.13
1092
     * @since 0.14 Changed to IVectorLayerStyle
1093
     */
1094
    vectorStyle?: IVectorLayerStyle;
1095
    /**
1096
     * Cluster style settings
1097
     * @since 0.14
1098
     */
1099
    cluster?: IClusterSettings;
1100
    /**
1101
     * Heatmap settings
1102
     * @since 0.14
1103
     */
1104
    heatmap?: IHeatmapSettings;
1105
    /**
1106
     * The busy worker count of this layer. If greater than 0, the layer
1107
     * is considered to be in the process of loading
1108
     * 
1109
     * @since 0.13
1110
     */
1111
    busyWorkerCount: number;
1112
    /**
1113
     * Metadata attached to the layer
1114
     * 
1115
     * @since 0.14
1116
     *
1117
     */
1118
    metadata?: any;
1119
}
1120

1121
/**
1122
 * Point layer clustering options
1123
 * 
1124
 * @since 0.14
1125
 */
1126
export interface AddVectorLayerClusteringOptions {
1127
    kind: "Cluster";
1128
    /**
1129
     * The distance to use for clustering. Setting this value will create a clustered layer.
1130
     * 
1131
     *  * If {@link clusterDistance} is set, but {@link clusterStyle} is not set, the {@link IAddLayerFromParsedFeaturesOptions.defaultStyle} will be used if set, otherwise the default vector style will be used
1132
     */
1133
    clusterDistance: number;
1134
    /**
1135
     * The style to use for this clustered layer. 
1136
     * 
1137
     *  * If {@link clusterDistance} is not set, this has no effect
1138
     *  * If {@link clusterDistance} is set but this is not set, the {@link IAddLayerFromParsedFeaturesOptions.defaultStyle} will be used if set, otherwise the default vector style will be used
1139
     */
1140
    clusterStyle?: IVectorLayerStyle;
1141
    /**
1142
     * The action to perform when the cluster is clicked
1143
     */
1144
    onClusterClickAction?: ClusterClickAction;
1145
}
1146

1147
/**
1148
 * Theming options
1149
 * @since 0.14
1150
 */
1151
export interface AddVectorLayerThemeOptions {
1152
    kind: "Theme";
1153
    /**
1154
     * Generate a thematic ramp based on the given property
1155
     */
1156
    themeOnProperty: string;
1157
    /**
1158
     * The colorbrewer theme to apply
1159
     */
1160
    colorBrewerTheme: string;
1161
}
1162

1163
/**
1164
 * Heatmap options
1165
 * @since 0.14
1166
 */
1167
export interface AddVectorLayerHeatmapOptions {
1168
    kind: "Heatmap",
1169
    /**
1170
     * The weight property
1171
     */
1172
    weightProperty?: string;
1173
}
1174

1175
export type AddVectorLayerExtraOptions = AddVectorLayerClusteringOptions | AddVectorLayerThemeOptions | AddVectorLayerHeatmapOptions;
1176

1177
/**
1178
 * Options to add a new layer from parsed features
1179
 *
1180
 * @interface IAddLayerFromParsedFeaturesOptions
1181
 * @since 0.13
1182
 */
1183
export interface IAddLayerFromParsedFeaturesOptions {
1184
    /**
1185
     * The projection to assign for this layer. If not specified, the map's projection
1186
     * is assumed
1187
     */
1188
    projection?: ProjectionLike;
1189
    /**
1190
     * The parsed features to add the layer with
1191
     */
1192
    features: IParsedFeatures;
1193
    /**
1194
     * The style to use for this layer. If not specified, a default style will be assigned
1195
     * to this layer
1196
     * 
1197
     * @since 0.13
1198
     * @since 0.14 changed to IVectorLayerStyle
1199
     */
1200
    defaultStyle?: IVectorLayerStyle;
1201
    /**
1202
     * Extra options for the layer to be added
1203
     * @since 0.14
1204
     */
1205
    extraOptions?: AddVectorLayerExtraOptions;
1206
    /**
1207
     * The property to use for labeling
1208
     * @since 0.14
1209
     */
1210
    labelOnProperty?: string;
1211
    /**
1212
     * The popup template to use when features are selected on this layer
1213
     * @since 0.14
1214
     */
1215
    selectedPopupTemplate?: ISelectedFeaturePopupTemplateConfiguration;
1216
    /**
1217
     * Metadata for this layer
1218
     * @since 0.14
1219
     */
1220
    metadata?: any;
1221
    /**
1222
     * A definition to attach to this layer. This definition is application-defined and is primarily to
1223
     * assist the application in implementing persistence/restoration of this layer on an application-defined
1224
     * basis 
1225
     * @since 0.14.3
1226
     */
1227
    defn?: any;
1228
}
1229

1230
/**
1231
 * Options for parsing features from a file
1232
 *
1233
 * @interface IParseFeaturesFromFileOptions
1234
 * @since 0.13
1235
 */
1236
export interface IParseFeaturesFromFileOptions {
1237
    file: File;
1238
    name: string;
1239
    locale: string;
1240
}
1241

1242
/**
1243
 * Manages custom layers for a map
1244
 *
1245
 * @interface ILayerManager
1246
 */
1247
export interface ILayerManager {
1248
    /**
1249
     * Get the active subject layer if present on the current map. In a MapGuide-specific context, subject layers do not exist
1250
     * and this method will always return undefined in such cases
1251
     *
1252
     * @returns {olLayerBase}
1253
     *
1254
     * @since 0.14
1255
     */
1256
    tryGetSubjectLayer(): olLayerBase | undefined;
1257
    /**
1258
     * Gets all custom layers on this map, sorted by draw order (First item is top-most layer. Last item is bottom-most layer.)
1259
     * 
1260
     * @returns {ILayerInfo[]} 
1261
     *
1262
    * */
1263
    getLayers(): ILayerInfo[];
1264
    /**
1265
     * Gets whether the specified custom layer exists on the map
1266
     */
1267
    hasLayer(name: string): boolean;
1268
    /**
1269
     * Adds a layer to the map
1270
     * 
1271
     * @template T 
1272
     * @param {string} name The name of the layer
1273
     * @param {T} layer The layer object
1274
     * @param {boolean} [allowReplace] If false or not set, this method will throw an error if a layer of the specified name already exists. Otherwise that layer will be replaced with the given layer
1275
     * @returns {T} The added layer
1276
     *
1277
     */
1278
    addLayer<T extends olLayerBase>(name: string, layer: T, allowReplace?: boolean): ILayerInfo;
1279
    /**
1280
     * Removes a layer by the given name
1281
     *
1282
     * @param {string} name
1283
     * @returns {(olLayerBase | undefined)}
1284
     *
1285
     *er
1286
     */
1287
    removeLayer(name: string): olLayerBase | undefined;
1288
    /**
1289
     * Gets a layer by the given name
1290
     *
1291
     * @template T
1292
     * @param {string} name
1293
     * @returns {T}
1294
     *
1295
     *er
1296
     */
1297
    getLayer<T extends olLayerBase>(name: string): T | undefined;
1298

1299
    /**
1300
     * Attempts to parse features for the given input file. A failed attempt is when
1301
     * calling hasFeatures() on the returned parsed features returns false.
1302
     * 
1303
     * @param {IParseFeaturesFromFileOptions} options
1304
     * @returns {Promise<IParsedFeatures>}
1305
     *
1306
     * @since 0.13
1307
     */
1308
    parseFeaturesFromFile(options: IParseFeaturesFromFileOptions): Promise<IParsedFeatures>;
1309

1310
    /**
1311
     * Adds the given parsed features as a new external layer
1312
     * 
1313
     * @param {IAddLayerFromParsedFeaturesOptions} options
1314
     * @returns {Promise<ILayerInfo>}
1315
     *
1316
     * @since 0.13
1317
     * @since 0.14 Styles for geometry types not found in the parsed features will be deleted
1318
     */
1319
    addLayerFromParsedFeatures(options: IAddLayerFromParsedFeaturesOptions): Promise<ILayerInfo>;
1320

1321
    /**
1322
     * Applies draw order/opacity/visibility
1323
     * @hidden
1324
     */
1325
    apply(layers: ILayerInfo[]): void;
1326
}
1327

1328
/**
1329
 * Function signature for a digitization callback
1330
 */
1331
export type DigitizerCallback<T extends olGeometry> = (geom: T) => void;
1332

1333
/**
1334
 * Valid image formats
1335
 */
1336
export type ImageFormat = "PNG" | "PNG8" | "JPG" | "GIF";
1337

1338
/**
1339
 * The type of client
1340
 */
1341
export type ClientKind = "mapagent" | "mapguide-rest";
1342

1343
export interface IModalParameters {
1344
    title: string;
1345
    backdrop: boolean;
1346
    /**
1347
     * @since 0.14.8 Now optional
1348
     */
1349
    size?: [number, number];
1350
    overflowYScroll?: boolean;
1351
    /**
1352
     * @since 0.14.8
1353
     */
1354
    position?: [number, number];
1355
}
1356

1357
/**
1358
 * The default modal dialog size
1359
 */
1360
export const DEFAULT_MODAL_SIZE: [number, number] = [350, 500];
1✔
1361

1362
/**
1363
 * The default modal dialog position
1364
 * @since 0.14.8
1365
 */
1366
export const DEFAULT_MODAL_POSITION: [number, number] = [500, 80];
1✔
1367

1368
/**
1369
 * Base modal display options
1370
 *
1371
 * @interface IModalDisplayOptionsBase
1372
 */
1373
export interface IModalDisplayOptionsBase {
1374
    modal: IModalParameters;
1375
    name: string;
1376
}
1377

1378
/**
1379
 * Modal display options for URL content
1380
 *
1381
 * @interface IModalDisplayOptions
1382
 * @extends {IModalDisplayOptionsBase}
1383
 */
1384
export interface IModalDisplayOptions extends IModalDisplayOptionsBase {
1385
    /**
1386
     * The URL of the content to load in the modal dialog
1387
     *
1388
     * @type {string}
1389
     */
1390
    url: string;
1391
}
1392

1393
export interface IModalComponentDisplayOptions extends IModalDisplayOptionsBase {
1394
    /**
1395
     * The id of the component to display
1396
     *
1397
     * @type {string}
1398
     *
1399
     */
1400
    component: string;
1401
    /**
1402
     * Component properties
1403
     *
1404
     * @type {*}
1405
     *
1406
     */
1407
    componentProps?: any;
1408
}
1409

1410
export interface IToolbarReducerState {
1411
    toolbars: any;
1412
    flyouts: any;
1413
}
1414

1415
/**
1416
 * Describes the reducer state branch for Task Pane component
1417
 *
1418
 *
1419
 * @interface ITaskPaneReducerState
1420
 */
1421
export interface ITaskPaneReducerState {
1422
    /**
1423
     * The current navigation index
1424
     *
1425
     * @type {number}
1426
     *
1427
     */
1428
    navIndex: number;
1429
    /**
1430
     * The current navigation history stack
1431
     *
1432
     * @type {string[]}
1433
     *
1434
     */
1435
    navigation: string[];
1436
    /**
1437
     * The initial URL
1438
     *
1439
     * @type {(string | undefined)}
1440
     *
1441
     */
1442
    initialUrl: string | undefined;
1443
    /**
1444
     * The last pushed URL
1445
     *
1446
     * @type {boolean}
1447
     *
1448
     */
1449
    lastUrlPushed: boolean;
1450
}
1451

1452
export type IModalReducerState = {
1453
    /**
1454
     * Gets the modal parameters for the given key
1455
     * 
1456
     * @since 0.14.8 all modal sub-properties now optional
1457
     */
1458
    [key: string]: Omit<IModalDisplayOptions | IModalComponentDisplayOptions, "modal"> & {
1459
        modal: Partial<IModalParameters>;
1460
    }
1461
};
1462

1463
/*
1464
export interface IModalReducerState {
1465

1466
}
1467
*/
1468

1469
/**
1470
 * A set of layer transpareny values by layer name
1471
 */
1472
export type LayerTransparencySet = { [layerName: string]: number };
1473

1474
/**
1475
 * Selection key of an active selected feature
1476
 */
1477
export interface ActiveSelectedFeature {
1478
    /**
1479
     * The selected layer id
1480
     * 
1481
     * @type {string}
1482
     */
1483
    layerId: string;
1484
    /**
1485
     * The selection key of the feature
1486
     * 
1487
     * @type {string}
1488
     */
1489
    selectionKey: string;
1490
}
1491

1492
/**
1493
 * Generic layer sub-state
1494
 *
1495
 *
1496
 * @interface IGenericLayerSubState
1497
 * @since 0.14
1498
 */
1499
export interface IGenericLayerSubState {
1500
    /**
1501
     * The subject layer
1502
     *
1503
     * @type {IGenericSubjectMapLayer}
1504
     */
1505
    subject: IGenericSubjectMapLayer;
1506
}
1507

1508
/**
1509
 * MapGuide-specific map sub-state
1510
 *
1511
 *
1512
 * @interface IMapGuideSubState
1513
 * @since 0.14
1514
 */
1515
export interface IMapGuideSubState {
1516
    /**
1517
     * The runtime map state
1518
     *
1519
     * @type {(RuntimeMap | undefined)}
1520
     *
1521
     */
1522
    runtimeMap: RuntimeMap | undefined;
1523
    /**
1524
     * Indicates if this map is based on an arbitrary coordinate system
1525
     * @since 0.14.3
1526
     */
1527
    isArbitraryCs: boolean;
1528
    /**
1529
     * A set of selectable layer ids
1530
     *
1531
     * @type {*}
1532
     *
1533
     */
1534
    selectableLayers: any;
1535
    /**
1536
     * A set of expanded group ids
1537
     *
1538
     * @type {*}
1539
     *
1540
     */
1541
    expandedGroups: any;
1542
    /**
1543
     * The current MapGuide selection state
1544
     *
1545
     * @type {(QueryMapFeaturesResponse | undefined)}
1546
     *
1547
     */
1548
    selectionSet: QueryMapFeaturesResponse | undefined;
1549
    /**
1550
     * The array of ids of layers to show
1551
     *
1552
     * @type {string[]}
1553
     *
1554
     */
1555
    showLayers: string[];
1556
    /**
1557
     * The array of ids of groups to show
1558
     *
1559
     * @type {string[]}
1560
     *
1561
     */
1562
    showGroups: string[];
1563
    /**
1564
     * The array of ids of layers to hide
1565
     *
1566
     * @type {string[]}
1567
     *
1568
     */
1569
    hideLayers: string[];
1570
    /**
1571
     * The array of ids of groups to hide
1572
     *
1573
     * @type {string[]}
1574
     *
1575
     */
1576
    hideGroups: string[];
1577
    /**
1578
     * Layer transparency settings
1579
     * 
1580
     * @type {{ [layerName: string]: number }}
1581
     *
1582
     */
1583
    layerTransparency: LayerTransparencySet;
1584
    /**
1585
     * The active selected feature to highlight
1586
     * 
1587
     * @type {(ActiveSelectedFeature | undefined)}
1588
     *
1589
     */
1590
    activeSelectedFeature: ActiveSelectedFeature | undefined;
1591
}
1592

1593
/**
1594
 * Describes the reducer state branch for a particular map group
1595
 *
1596
 *
1597
 * @interface IBranchedMapSubState
1598
 */
1599
export interface IBranchedMapSubState {
1600
    /**
1601
     * The external base layers for the map group
1602
     *
1603
     * @type {IExternalBaseLayer[]}
1604
     *
1605
     */
1606
    externalBaseLayers: IExternalBaseLayer[];
1607
    /**
1608
     * Initial external layers. This does not reflect the current state of external layers added. This merely instructs what external layers
1609
     * to pre-load on viewer startup.
1610
     *
1611
     * @type {IInitialExternalLayer[]}
1612
     *
1613
     * @since 0.14
1614
     */
1615
    initialExternalLayers: IInitialExternalLayer[];
1616
    /**
1617
     * The layers in this viewer. First item is top-most layer. Last item is bottom-most layer.
1618
     * @since 0.13
1619
     */
1620
    layers: ILayerInfo[] | undefined;
1621
    /**
1622
     * The current map view
1623
     *
1624
     * @type {(IMapView | undefined)}
1625
     *
1626
     */
1627
    currentView: IMapView | undefined;
1628
    /**
1629
     * The initial map view
1630
     *
1631
     * @type {(IMapView | undefined)}
1632
     *
1633
     */
1634
    initialView: IMapView | undefined;
1635
    /**
1636
     * The view navigation history stack
1637
     *
1638
     * @type {IMapView[]}
1639
     *
1640
     */
1641
    history: IMapView[];
1642
    /**
1643
     * The current position in the view navigation history stack
1644
     *
1645
     * @type {number}
1646
     *
1647
     */
1648
    historyIndex: number;
1649
    /**
1650
     * MapGuide-specific sub-state
1651
     *
1652
     * @type {IMapGuideSubState}
1653
     *
1654
     * @since 0.14
1655
     */
1656
    mapguide: IMapGuideSubState | undefined;
1657
    /**
1658
     * The current client-side selection state
1659
     * 
1660
     * @since 0.14
1661
     */
1662
    clientSelection: ClientSelectionSet | undefined;
1663
    /**
1664
     * Generic layer sub-state
1665
     *
1666
     * @type {(IGenericLayerSubState | undefined)}
1667
     *
1668
     * @since 0.14
1669
     */
1670
    generic: IGenericLayerSubState | undefined;
1671
}
1672

1673
/**
1674
 * The reducer state branch for runtime map state. Map-specific state is keyed on
1675
 * their respective runtime map name as sub-branches on this branch
1676
 *
1677
 *
1678
 * @interface IBranchedMapState
1679
 */
1680
export interface IBranchedMapState {
1681
    [mapName: string]: IBranchedMapSubState;
1682
}
1683

1684
/**
1685
 * Coordinate display configuration
1686
 *
1687
 *
1688
 * @interface ICoordinateConfiguration
1689
 */
1690
export interface ICoordinateConfiguration {
1691
    /**
1692
     * The number of decimal places to show
1693
     *
1694
     * @type {number}
1695
     *
1696
     */
1697
    decimals: number;
1698
    /**
1699
     * The display projection for these coordinates
1700
     * 
1701
     * @type {string}
1702
     *
1703
     */
1704
    projection: string;
1705
    /**
1706
     * Display format string
1707
     * 
1708
     * @type {string}
1709
     *
1710
     */
1711
    format?: string;
1712
}
1713

1714
/**
1715
 * Describes the capabilities of the current view
1716
 *
1717
 *
1718
 * @interface IViewerCapabilities
1719
 */
1720
export interface IViewerCapabilities {
1721
    /**
1722
     * Indicates if this viewer as a Task Pane component mounted
1723
     *
1724
     * @type {boolean}
1725
     *
1726
     */
1727
    hasTaskPane: boolean;
1728
    /**
1729
     * Indicates if the Task Pane on this viewer has a Task Bar
1730
     *
1731
     * @type {boolean}
1732
     *
1733
     */
1734
    hasTaskBar: boolean;
1735
    /**
1736
     * Indicates if this viewer has a status bar
1737
     *
1738
     * @type {boolean}
1739
     *
1740
     */
1741
    hasStatusBar: boolean;
1742
    /**
1743
     * Indicates if this viewer has a zoom slider
1744
     *
1745
     * @type {boolean}
1746
     *
1747
     */
1748
    hasNavigator: boolean;
1749
    /**
1750
     * Indicates if this viewer has a selection panel component mounted
1751
     *
1752
     * @type {boolean}
1753
     *
1754
     */
1755
    hasSelectionPanel: boolean;
1756
    /**
1757
     * Indicates if this viewer has a legend component mounted
1758
     *
1759
     * @type {boolean}
1760
     *
1761
     */
1762
    hasLegend: boolean;
1763
    /**
1764
     * Indicates if this viewer has a primary toolbar mounted
1765
     *
1766
     * @type {boolean}
1767
     *
1768
     */
1769
    hasToolbar: boolean;
1770
    /**
1771
     * Indicates if this viewer has the view size mounted
1772
     * 
1773
     * @type {boolean}
1774
     *
1775
     */
1776
    hasViewSize: boolean;
1777
}
1778

1779
/**
1780
 * Describes a name/value pair
1781
 *
1782
 *
1783
 * @interface INameValuePair
1784
 */
1785
export interface INameValuePair {
1786
    /**
1787
     * The name
1788
     *
1789
     * @type {string}
1790
     *
1791
     */
1792
    name: string;
1793
    /**
1794
     * The value
1795
     *
1796
     * @type {string}
1797
     *
1798
     */
1799
    value: string;
1800
}
1801

1802
/**
1803
 * Describes a redux reducer function
1804
 */
1805
export type ReducerFunction<TState> = (state: TState, action: ViewerAction) => TState;
1806

1807
/**
1808
 * Describes the reducer state branch for the current viewer template
1809
 *
1810
 *
1811
 * @interface ITemplateReducerState
1812
 */
1813
export interface ITemplateReducerState {
1814
    /**
1815
     * The initial width of the information pane. Only certain templates will recognise this setting
1816
     * 
1817
     * @type {number}
1818
     *
1819
     */
1820
    initialInfoPaneWidth: number;
1821
    /**
1822
     * The initial width of the task pane. Only certain templates will recognise this setting
1823
     * 
1824
     * @type {number}
1825
     *
1826
     */
1827
    initialTaskPaneWidth: number;
1828
    /**
1829
     * Indicates if the task pane is visible
1830
     *
1831
     * @type {boolean}
1832
     *
1833
     */
1834
    taskPaneVisible: boolean;
1835
    /**
1836
     * Indicates if the legend is visible
1837
     *
1838
     * @type {boolean}
1839
     *
1840
     */
1841
    legendVisible: boolean;
1842
    /**
1843
     * Indicates if the selection panel is visible
1844
     *
1845
     * @type {boolean}
1846
     *
1847
     */
1848
    selectionPanelVisible: boolean;
1849
    /**
1850
     * If true, the selection panel will auto-display when a selection is made
1851
     * and there are results to show
1852
     * 
1853
     * @since 0.13
1854
     */
1855
    autoDisplaySelectionPanelOnSelection: boolean;
1856

1857
    /**
1858
     * Template-specific data
1859
     * @since 0.14.8
1860
     */
1861
    templateData: Dictionary<any>;
1862
}
1863

1864
/**
1865
 * Signature for a template state reducer function
1866
 * 
1867
 * @since 0.13
1868
 */
1869
export type TemplateReducerFunction = (origState: ITemplateReducerState, currentState: ITemplateReducerState, action: ViewerAction) => ITemplateReducerState;
1870

1871
/**
1872
 * Keyboard code for ESCAPE
1873
 */
1874
export const KC_ESCAPE = 27;
1✔
1875

1876
/**
1877
 * Keyboard code for the letter U
1878
 */
1879
export const KC_U = 85;
1✔
1880

1881
/**
1882
 * The positioning of the map load indicator
1883
 */
1884
export type MapLoadIndicatorPositioning = "top" | "bottom";
1885

1886
/**
1887
 * Describes a swipe pair of maps. When swipe mode is active, the primary map is
1888
 * shown on the left (or covered area) and the secondary map is shown on the right
1889
 * (or uncovered area) based on the swipe position.
1890
 *
1891
 * @interface IMapSwipePair
1892
 * @since 0.15
1893
 */
1894
export interface IMapSwipePair {
1895
    /**
1896
     * The name of the primary map in the swipe pair. This is the map shown
1897
     * in non-swipe mode.
1898
     *
1899
     * @type {string}
1900
     */
1901
    primaryMapName: string;
1902
    /**
1903
     * The name of the secondary map in the swipe pair.
1904
     *
1905
     * @type {string}
1906
     */
1907
    secondaryMapName: string;
1908
}
1909

1910
/**
1911
 * Describes the reducer state branch for various configuration properties
1912
 *
1913
 *
1914
 * @interface IConfigurationReducerState
1915
 */
1916
export interface IConfigurationReducerState {
1917
    /**
1918
     * The agent URI
1919
     *
1920
     * @type {(string | undefined)}
1921
     *
1922
     */
1923
    agentUri: string | undefined;
1924
    /**
1925
     * The type of agent
1926
     *
1927
     * @type {ClientKind}
1928
     *
1929
     */
1930
    agentKind: ClientKind;
1931
    /**
1932
     * The current locale
1933
     *
1934
     * @type {string}
1935
     *
1936
     */
1937
    locale: string;
1938
    /**
1939
     * The current active map name
1940
     *
1941
     * @type {(string | undefined)}
1942
     *
1943
     */
1944
    activeMapName: string | undefined;
1945
    /**
1946
     * The array of available runtime maps
1947
     *
1948
     * @type {(INameValuePair[] | undefined)}
1949
     *
1950
     */
1951
    availableMaps: INameValuePair[] | undefined;
1952
    /**
1953
     * Coordinate display configuration
1954
     *
1955
     * @type {ICoordinateConfiguration}
1956
     *
1957
     */
1958
    coordinates: ICoordinateConfiguration;
1959
    /**
1960
     * Viewer capabilities
1961
     *
1962
     * @type {IViewerCapabilities}
1963
     *
1964
     */
1965
    capabilities: IViewerCapabilities;
1966
    /**
1967
     * A dictionary of arbitrary app settings
1968
     * 
1969
     * @since 0.14
1970
     */
1971
    appSettings?: Dictionary<string>;
1972
    /**
1973
     * Viewer configuration
1974
     * 
1975
     *
1976
     */
1977
    viewer: {
1978
        /**
1979
         * Whether this viewer will use stateless MapGuide rendering operations
1980
         * 
1981
         * @since 0.14
1982
         */
1983
        isStateless: boolean;
1984
        /**
1985
         * The current image format
1986
         *
1987
         * @type {ImageFormat}
1988
         */
1989
        imageFormat: ImageFormat;
1990
        /**
1991
         * The current selection image format
1992
         *
1993
         * @type {ImageFormat}
1994
         */
1995
        selectionImageFormat: ImageFormat;
1996
        /**
1997
         * The current selection color
1998
         *
1999
         * @type {string}
2000
         */
2001
        selectionColor: string;
2002
        /**
2003
         * The color to use for highlighting active selected features
2004
         * 
2005
         * @type {string}
2006
         */
2007
        activeSelectedFeatureColor: string;
2008
        /**
2009
         * The current point selection pixel tolerance
2010
         *
2011
         * @type {number}
2012
         */
2013
        pointSelectionBuffer: number;
2014
        /**
2015
         * The position of the map loading indicator
2016
         * 
2017
         * @type {MapLoadIndicatorPositioning}
2018
         */
2019
        loadIndicatorPositioning: MapLoadIndicatorPositioning;
2020
        /**
2021
         * The color of the map loading indicator. This is an valid CSS color expression
2022
         * 
2023
         * @type {string}
2024
         */
2025
        loadIndicatorColor: string;
2026
    },
2027
    /**
2028
     * Indicates if view rotation is enabled
2029
     * 
2030
     * @type {boolean}
2031
     *
2032
     */
2033
    viewRotationEnabled: boolean;
2034
    /**
2035
     * The current view rotation
2036
     * 
2037
     * @type {number}
2038
     *
2039
     */
2040
    viewRotation: number;
2041
    /**
2042
     * The unit to display view size in
2043
     * 
2044
     * @type {UnitOfMeasure}
2045
     *
2046
     */
2047
    viewSizeUnits: UnitOfMeasure;
2048
    /**
2049
     * @since 0.14.2
2050
     */
2051
    selectCanDragPan: boolean;
2052
    /**
2053
     * If specified and true and the MapTip component is active, then feature tooltips are activated
2054
     * by mouse click instead of idle mouse cursor at a given point on the map for a certain period of time. 
2055
     * 
2056
     * An active MapTip component with this setting enabled will override normal click-based selection.
2057
     * 
2058
     * @type {boolean}
2059
     *
2060
     */
2061
    manualFeatureTooltips: boolean;
2062
    /**
2063
     * The key code to listen for cancelling an active digitization
2064
     * 
2065
     * @type {number}
2066
     *
2067
     */
2068
    cancelDigitizationKey: number;
2069
    /**
2070
     * The key code to listen for undoing the last drawn point of an active digitization
2071
     * 
2072
     * @type {number}
2073
     *
2074
     */
2075
    undoLastPointKey: number;
2076
    /**
2077
     * The map swipe pairs declared in the application definition. When set, the
2078
     * viewer supports a side-by-side swipe comparison between two maps.
2079
     *
2080
     * @type {IMapSwipePair[]}
2081
     * @since 0.15
2082
     */
2083
    mapSwipePairs?: IMapSwipePair[];
2084
    /**
2085
     * Indicates if map swipe mode is currently active.
2086
     *
2087
     * @type {boolean}
2088
     * @since 0.15
2089
     */
2090
    swipeActive?: boolean;
2091
    /**
2092
     * The current swipe position as a percentage (0-100). 
2093
     * 50 means the slider is in the center.
2094
     *
2095
     * @type {number}
2096
     * @since 0.15
2097
     */
2098
    swipePosition?: number;
2099
}
2100

2101
/**
2102
 * Describes an error thrown during initialization
2103
 *
2104
 *
2105
 * @interface InitError
2106
 */
2107
export interface InitError {
2108
    /**
2109
     * The error message
2110
     *
2111
     * @type {string}
2112
     *
2113
     */
2114
    message: string;
2115
    /**
2116
     * The error stack trace
2117
     *
2118
     * @type {string[]}
2119
     *
2120
     */
2121
    stack: string[];
2122
}
2123

2124
/**
2125
 * Describes the reducer state branch for initialization errors
2126
 *
2127
 *
2128
 * @interface IInitErrorReducerState
2129
 */
2130
export interface IInitErrorReducerState {
2131
    /**
2132
     * The caught initialization error
2133
     *
2134
     * @type {(InitError | undefined)}
2135
     *
2136
     */
2137
    error: InitError | undefined;
2138
    /**
2139
     * The initialization options
2140
     *
2141
     * @type {*}
2142
     *
2143
     */
2144
    options: any;
2145
    /**
2146
     * Indicates if the stack trace should be shown
2147
     *
2148
     * @type {boolean}
2149
     *
2150
     */
2151
    includeStack: boolean;
2152
    /**
2153
     * Any warnings that were encountered during initialization
2154
     * 
2155
     * @type {string[]}
2156
     *
2157
     */
2158
    warnings: string[];
2159
}
2160

2161
/**
2162
 * Describes the reducer state branch for viewer state
2163
 *
2164
 *
2165
 * @interface IViewerReducerState
2166
 */
2167
export interface IViewerReducerState {
2168
    /**
2169
     * The current size of the map viewport (in pixels)
2170
     * 
2171
     * @type {([number, number] | undefined)}
2172
     *
2173
     */
2174
    size: [number, number] | undefined;
2175
    /**
2176
     * The number of active busy actions. Zero indicates no busy activity. One or more
2177
     * indicates busy activity.
2178
     *
2179
     * @type {number}
2180
     *
2181
     */
2182
    busyCount: number;
2183
    /**
2184
     * The active map tool
2185
     *
2186
     * @type {ActiveMapTool}
2187
     *
2188
     */
2189
    tool: ActiveMapTool;
2190
    /**
2191
     * Indicates if feature tooltips are enabled
2192
     *
2193
     * @type {boolean}
2194
     *
2195
     */
2196
    featureTooltipsEnabled: boolean;
2197
}
2198

2199
/**
2200
 * Describes the reducer state branch for tracked mouse coordinates
2201
 *
2202
 *
2203
 * @interface IMouseReducerState
2204
 */
2205
export interface IMouseReducerState {
2206
    /**
2207
     * The last tracked mouse coordinate
2208
     *
2209
     * @type {(Coordinate2D | undefined)}
2210
     */
2211
    coords: Coordinate2D | undefined;
2212
}
2213

2214
/**
2215
 * Describes the full application state tree. Redux-aware components can connect and subscribe to
2216
 * various properties and branches of this tree and be automatically notified of any changes and
2217
 * update and re-render themselves accordingly
2218
 *
2219
 *
2220
 * @interface IApplicationState
2221
 */
2222
export interface IApplicationState {
2223
    /**
2224
     * Initialization errors
2225
     *
2226
     * @type {Readonly<IInitErrorReducerState>}
2227
     *
2228
     */
2229
    initError: Readonly<IInitErrorReducerState>;
2230
    /**
2231
     * Viewer configuration
2232
     *
2233
     * @type {Readonly<IConfigurationReducerState>}
2234
     *
2235
     */
2236
    config: Readonly<IConfigurationReducerState>;
2237
    /**
2238
     * Current template state
2239
     *
2240
     * @type {Readonly<ITemplateReducerState>}
2241
     *
2242
     */
2243
    template: Readonly<ITemplateReducerState>;
2244
    /**
2245
     * Viewer state
2246
     *
2247
     * @type {Readonly<IViewerReducerState>}
2248
     *
2249
     */
2250
    viewer: Readonly<IViewerReducerState>;
2251
    /**
2252
     * Runtime map state
2253
     *
2254
     * @type {Readonly<IBranchedMapState>}
2255
     *
2256
     */
2257
    mapState: Readonly<IBranchedMapState>;
2258
    /**
2259
     * Toolbar state
2260
     *
2261
     * @type {Readonly<IToolbarReducerState>}
2262
     *
2263
     */
2264
    toolbar: Readonly<IToolbarReducerState>;
2265
    /**
2266
     * Task Pane component state
2267
     *
2268
     * @type {Readonly<ITaskPaneReducerState>}
2269
     *
2270
     */
2271
    taskpane: Readonly<ITaskPaneReducerState>;
2272
    /**
2273
     * Modal dialog state
2274
     *
2275
     * @type {Readonly<IModalReducerState>}
2276
     *
2277
     */
2278
    modal: Readonly<IModalReducerState>;
2279
    /**
2280
     * Tracked mouse coordinate state
2281
     *
2282
     * @type {Readonly<IMouseReducerState>}
2283
     *
2284
     */
2285
    mouse: Readonly<IMouseReducerState>;
2286
    /**
2287
     * Tracks the last dispatched action
2288
     *
2289
     * @type {*}
2290
     *
2291
     */
2292
    lastaction: any;
2293
}
2294

2295
// Redux typedefs to tighten up our redux code
2296

2297
/**
2298
 * Describes the redux store
2299
 *
2300
 *
2301
 * @interface ReduxStore
2302
 */
2303
export interface ReduxStore {
2304
    /**
2305
     * Gets the application state
2306
     *
2307
     * @returns {Readonly<IApplicationState>}
2308
     */
2309
    getState(): Readonly<IApplicationState>;
2310
}
2311

2312
/**
2313
 * Describes a thunked redux action. Thunked redux actions are generally used for actions that push state
2314
 * asynchronously (eg. In response to an AJAX request)
2315
 */
2316
export type ReduxThunkedAction = (dispatch: ReduxDispatch, getState: () => Readonly<IApplicationState>) => any;
2317

2318
/**
2319
 * Describes a redux dispatcher function. A redux dispatch pushes new state to the redux store
2320
 */
2321
export type ReduxDispatch = (action: ViewerAction | ReduxThunkedAction) => void;
2322

2323
/**
2324
 * A function that does nothing
2325
 *
2326
 *
2327
 */
2328
export function NOOP() { }
1✔
2329

2330
/**
2331
 * A function that always returns false
2332
 *
2333
 *
2334
 * @returns false
2335
 */
2336
export function ALWAYS_FALSE() { return false; }
1✔
2337

2338
/**
2339
 * A function that always returns true
2340
 *
2341
 *
2342
 * @returns true
2343
 */
2344
export function ALWAYS_TRUE() { return true; }
1✔
2345

2346
/**
2347
 * Describe the size/dimensions of a DOM element in a toolbar or flyout menu
2348
 *
2349
 *
2350
 * @interface IDOMElementMetrics
2351
 */
2352
export interface IDOMElementMetrics {
2353
    /**
2354
     * The X position of this element
2355
     *
2356
     * @type {number}
2357
     *
2358
     */
2359
    posX: number;
2360
    /**
2361
     * The Y position of this element
2362
     *
2363
     * @type {number}
2364
     *
2365
     */
2366
    posY: number;
2367
    /**
2368
     * The width of this element
2369
     *
2370
     * @type {number}
2371
     *
2372
     */
2373
    width: number;
2374
    /**
2375
     * The height of this element
2376
     *
2377
     * @type {number}
2378
     *
2379
     */
2380
    height: number;
2381
    /**
2382
     * Indicates of this toolbar is vertically-oriented
2383
     *
2384
     * @type {boolean}
2385
     *
2386
     */
2387
    vertical?: boolean;
2388
}
2389

2390
/**
2391
 * Helper function to get the initial map view from the application state
2392
 *
2393
 *
2394
 * @param {Readonly<IApplicationState>} state
2395
 * @returns {(IMapView | undefined)}
2396
 */
2397
export function getInitialView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
UNCOV
2398
    if (state.config.activeMapName) {
×
UNCOV
2399
        return state.mapState[state.config.activeMapName].initialView;
×
UNCOV
2400
    }
×
UNCOV
2401
    return undefined;
×
UNCOV
2402
}
×
2403

2404
/**
2405
 * Helper function to get the mapguide-specific sub state of the current map group
2406
 *
2407
 *
2408
 * @param {Readonly<IApplicationState>} state
2409
 * @returns {(IMapGuideSubState | undefined)}
2410
 * @since 0.14
2411
 */
2412
export function getMapGuideSubState(state: Readonly<IApplicationState>): IMapGuideSubState | undefined {
1✔
2413
    if (state.config.activeMapName) {
24✔
2414
        return state.mapState[state.config.activeMapName].mapguide;
10✔
2415
    }
10✔
2416
    return undefined;
14✔
2417
}
14✔
2418

2419
/**
2420
 * Helper function to get the current selection set from the application state
2421
 *
2422
 *
2423
 * @param {Readonly<IApplicationState>} state
2424
 * @returns {(QueryMapFeaturesResponse | undefined)}
2425
 */
2426
export function getSelectionSet(state: Readonly<IApplicationState>): QueryMapFeaturesResponse | undefined {
1✔
2427
    return getMapGuideSubState(state)?.selectionSet;
23✔
2428
}
23✔
2429

2430
/**
2431
 * Helper function to get the current runtime map state from the application state
2432
 *
2433
 *
2434
 * @param {Readonly<IApplicationState>} state
2435
 * @returns {(RuntimeMap | undefined)}
2436
 */
2437
export function getRuntimeMap(state: Readonly<IApplicationState>): RuntimeMap | undefined {
1✔
2438
    return getMapGuideSubState(state)?.runtimeMap;
1!
2439
}
1✔
2440

2441
/**
2442
 * Helper function to get the current view from the application state
2443
 *
2444
 *
2445
 * @param {Readonly<IApplicationState>} state
2446
 * @returns {(IMapView | undefined)}
2447
 */
2448
export function getCurrentView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
2449
    if (state.config.activeMapName) {
1!
UNCOV
2450
        return state.mapState[state.config.activeMapName].currentView;
×
UNCOV
2451
    }
×
2452
    return undefined;
1✔
2453
}
1✔
2454

2455
/**
2456
 * Determines if the given external base layer is one with a visual representation
2457
 * 
2458
 * @param layer 
2459
 * @returns 
2460
 * @since 0.14.9
2461
 */
2462
export function isVisualBaseLayer(layer: IExternalBaseLayer) {
1✔
2463
    return layer.kind != "UTFGrid";
4✔
2464
}
4✔
2465

2466
/**
2467
 * Helper function to get the current set of available external base layers from the application state
2468
 *
2469
 * @remarks This does not include "non-visual" base layers such as UTFGrid tilesets
2470
 * 
2471
 *
2472
 * @param {Readonly<IApplicationState>} state
2473
 * @returns {(IExternalBaseLayer[] | undefined)}
2474
 * 
2475
 * @since 0.14.9 Removed includeNonVisual parameter
2476
 */
2477
export function getExternalBaseLayers(state: Readonly<IApplicationState>): IExternalBaseLayer[] | undefined {
1✔
2478
    if (state.config.activeMapName) {
1!
UNCOV
2479
        return state.mapState[state.config.activeMapName].externalBaseLayers;
×
UNCOV
2480
    }
×
2481
    return undefined;
1✔
2482
}
1✔
2483

2484
/**
2485
 * Defines the visibility of flyout menus
2486
 */
2487
export type FlyoutVisibilitySet = { [flyoutId: string]: boolean | undefined };
2488

2489
/**
2490
 * Defines the capabilities of a WMS service
2491
 * 
2492
 * @since 0.11
2493
 */
2494
export interface WmsCapabilitiesDocument {
2495
    /**
2496
     * WMS service version
2497
     * 
2498
     * @type {string}
2499
     *
2500
     */
2501
    version: string;
2502
    Service: WMSServiceDescription;
2503
    Capability: WMSServiceCapabilities;
2504
}
2505

2506
/**
2507
 * @since 0.11
2508
 */
2509
export interface WMSServiceCapabilities {
2510
    Request: any;
2511
    Exception: string[];
2512
    Layer: WMSRootPublishedLayer;
2513
}
2514

2515
/**
2516
 * @since 0.12
2517
 */
2518
export interface WMSLayerBoundingBox {
2519
    crs: string;
2520
    extent: [number, number, number, number],
2521
    res: [any, any]
2522
}
2523

2524
/**
2525
 * @since 0.11
2526
 */
2527
export interface WMSPublishedLayer {
2528
    Name: string;
2529
    Title: string;
2530
    Abstract: string;
2531
    KeywordList: string;
2532
    CRS: string[];
2533
    EX_GeographicBoundingBox: [number, number, number, number];
2534
    BoundingBox: WMSLayerBoundingBox[];
2535
    Style: WMSLayerStyle[];
2536
    queryable: boolean;
2537
    opaque: boolean;
2538
    noSubsets: boolean;
2539
}
2540

2541
/**
2542
 * @since 0.11
2543
 */
2544
export interface WMSRootPublishedLayer extends WMSPublishedLayer {
2545
    Layer: WMSPublishedLayer[];
2546
}
2547

2548
/**
2549
 * @since 0.12
2550
 */
2551
export interface WMSLegendURLDefinition {
2552
    Format: string;
2553
    OnlineResource: string;
2554
    size: [number, number];
2555
}
2556

2557
/**
2558
 * @since 0.11
2559
 */
2560
export interface WMSLayerStyle {
2561
    Name: string;
2562
    Title: string;
2563
    Abstract: string;
2564
    LegendURL: WMSLegendURLDefinition[];
2565
}
2566

2567
/**
2568
 * @since 0.12
2569
 */
2570
export interface WMSContactAddress {
2571
    AddressType: string,
2572
    Address: string,
2573
    City: string,
2574
    StateOrProvince: string,
2575
    PostCode: string,
2576
    Country: string
2577
}
2578

2579
/**
2580
 * @since 0.12
2581
 */
2582
export interface WMSContact {
2583
    ContactPerson: string;
2584
    ContactOrganization: string;
2585
}
2586

2587
/**
2588
 * @since 0.12
2589
 */
2590
export interface WMSContactInformation {
2591
    ContactPersonPrimary: WMSContact,
2592
    ContactPosition: string,
2593
    ContactAddress: WMSContactAddress,
2594
    ContactVoiceTelephone: string,
2595
    ContactFacsimileTelephone: string,
2596
    ContactElectronicMailAddress: string
2597
}
2598

2599
/**
2600
 * @since 0.11
2601
 */
2602
export interface WMSServiceDescription {
2603
    Name: string;
2604
    Title: string;
2605
    Abstract: string;
2606
    KeywordList: string[];
2607
    OnlineResource: string;
2608
    ContactInformation: WMSContactInformation,
2609
    Fees: string;
2610
    AccessConstraints: string;
2611
}
2612

2613
export interface IMapGuideImageSource {
2614
    on(event: string, handler: Function): void;
2615
    updateParams(params: any): void;
2616
}
2617

2618
/**
2619
 * Custom properties that can be attached to OpenLayers layer instances
2620
 * 
2621
 * @since 0.13
2622
 */
2623
export enum LayerProperty {
1✔
2624
    LAYER_TYPE = "layer_type",
1✔
2625
    LAYER_NAME = "name",
1✔
2626
    /**
2627
     * @since 0.14
2628
     */
2629
    LAYER_DISPLAY_NAME = "display_name",
1✔
2630
    IS_GROUP = "is_group",
1✔
2631
    IS_EXTERNAL = "is_external",
1✔
2632
    IS_SELECTABLE = "is_selectable",
1✔
2633
    /**
2634
     * @since 0.14.5
2635
     */
2636
    DISABLE_HOVER = "disable_hover",
1✔
2637
    IS_SCRATCH = "is_scratch",
1✔
2638
    HAS_WMS_LEGEND = "has_wms_legend",
1✔
2639
    VECTOR_STYLE = "vector_style",
1✔
2640
    WGS84_BBOX = "wgs84_bbox",
1✔
2641
    BUSY_WORKER_COUNT = "busy_worker_count",
1✔
2642
    /**
2643
     * @since 0.14
2644
     */
2645
    SELECTED_POPUP_CONFIGURATION = "popup_config",
1✔
2646
    /**
2647
     * @since 0.14
2648
     */
2649
    LAYER_DESCRIPTION = "layer_description",
1✔
2650
    /**
2651
     * @since 0.14
2652
     */
2653
    LAYER_METADATA = "layer_metadata",
1✔
2654
    /**
2655
     * @since 0.14
2656
     */
2657
    IS_HOVER_HIGHLIGHT = "is_hover_highlight",
1✔
2658
    /**
2659
     * @since 0.14
2660
     */
2661
    IS_MEASURE = "is_measure",
1✔
2662
    /**
2663
     * @since 0.14
2664
     */
2665
    IS_WMS_SELECTION_OVERLAY = "is_wms_selection_overlay",
1✔
2666
    /**
2667
     * @since 0.14
2668
     */
2669
    IS_HEATMAP = "is_heatmap",
1✔
2670
    /**
2671
     * A source definition to attach to the layer. This is to assist in persistence of this layer for easy
2672
     * restoration on an application-defined basis
2673
     * 
2674
     * @since 0.14.3
2675
     */
2676
    LAYER_DEFN = "layer_defn"
1✔
2677
}
2678

2679
/**
2680
 * Custom properties that can be attached to OpenLayers image source instances
2681
 * 
2682
 * @since 0.13
2683
 */
2684
export enum SourceProperty {
1✔
2685
    SUPPRESS_LOAD_EVENTS = "suppress_load_events"
1✔
2686
}
2687

2688
/**
2689
 * MapGuide layer types
2690
 * 
2691
 * @since 0.13
2692
 */
2693
export enum MgLayerType {
1✔
2694
    Untiled = "MapGuide_Untiled",
1✔
2695
    Tiled = "MapGuide_Tiled"
1✔
2696
}
2697

2698
/**
2699
 * The type name for a MapGuide layer
2700
 * 
2701
 * @since 0.13
2702
 */
2703
export const MG_LAYER_TYPE_NAME = "MapGuide";
1✔
2704

2705
/**
2706
 * The default group name for MapGuide tiled layers. This value
2707
 * is not meant for localized display
2708
 * 
2709
 * @since 0.13
2710
 */
2711
export const MG_BASE_LAYER_GROUP_NAME = "Base Tile Layers";
1✔
2712

2713
/**
2714
 * Default names for MapGuide built-in layer types. These value
2715
 * are not meant for localized display
2716
 * 
2717
 * @since 0.13
2718
 */
2719
export enum MgBuiltInLayers {
1✔
2720
    Overlay = "MapGuide Dynamic Overlay",
1✔
2721
    SelectionOverlay = "MapGuide Selection Overlay",
1✔
2722
    ActiveFeatureSelectionOverlay = "MapGuide Active Feature Selection Overlay"
1✔
2723
}
2724

2725
/**
2726
 * A layer of a {@link ICompositeSelection}
2727
 * 
2728
 * @since 0.14
2729
 */
2730
export interface ICompositeSelectionLayer {
2731
    /**
2732
     * The id of this selection layer
2733
     */
2734
    getLayerId(): string | undefined;
2735
    /**
2736
     * The name of this layer
2737
     */
2738
    getName(): string;
2739
    /**
2740
     * The metadata of this layer
2741
     */
2742
    getLayerMetadata(): LayerMetadata | undefined;
2743
    /**
2744
     * Gets the feature at the given index
2745
     */
2746
    getFeatureAt(featureIndex: number): SelectedFeature;
2747
    /**
2748
     * Gets the total number of features in this layer
2749
     */
2750
    getFeatureCount(): number;
2751
}
2752

2753
/**
2754
 * A composition of a MapGuide selection set and a client-side vector feature selection
2755
 * 
2756
 * @since 0.14
2757
 */
2758
export interface ICompositeSelection {
2759
    /**
2760
     * Gets the number of layers in this selection set
2761
     */
2762
    getLayerCount(): number;
2763
    /**
2764
     * Gets the array of layers in this selection set
2765
     */
2766
    getLayers(): ICompositeSelectionLayer[];
2767
    /**
2768
     * Gets the layer at the specified index
2769
     * 
2770
     * @param layerIndex The selection layer index
2771
     */
2772
    getLayerAt(layerIndex: number): ICompositeSelectionLayer | undefined;
2773
    /**
2774
     * Gets the feature for the given layer at the specified indices
2775
     * 
2776
     * @param layerIndex The selection layer index
2777
     * @param featureIndex The feature index
2778
     */
2779
    getFeatureAt(layerIndex: number, featureIndex: number): SelectedFeature | undefined;
2780
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc