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

jumpinjackie / mapguide-react-layout / 23978816404

04 Apr 2026 12:23PM UTC coverage: 40.912% (-0.02%) from 40.934%
23978816404

Pull #1598

github

web-flow
Merge a7bb589a0 into a72c84739
Pull Request #1598: Mouse coordinates format is now multi-map aware

1901 of 2432 branches covered (78.17%)

4 of 24 new or added lines in 4 files covered. (16.67%)

112 existing lines in 5 files now uncovered.

10187 of 24900 relevant lines covered (40.91%)

10.03 hits per line

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

92.71
/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
     * An optional coordinate display format override for this map. When set, the mouse
1673
     * coordinates component will use this format instead of the global coordinate display
1674
     * format when this map is the active map and no display projection override is configured.
1675
     *
1676
     * @since 0.15
1677
     */
1678
    coordinateFormat?: string;
1679
}
1680

1681
/**
1682
 * The reducer state branch for runtime map state. Map-specific state is keyed on
1683
 * their respective runtime map name as sub-branches on this branch
1684
 *
1685
 *
1686
 * @interface IBranchedMapState
1687
 */
1688
export interface IBranchedMapState {
1689
    [mapName: string]: IBranchedMapSubState;
1690
}
1691

1692
/**
1693
 * Coordinate display configuration
1694
 *
1695
 *
1696
 * @interface ICoordinateConfiguration
1697
 */
1698
export interface ICoordinateConfiguration {
1699
    /**
1700
     * The number of decimal places to show
1701
     *
1702
     * @type {number}
1703
     *
1704
     */
1705
    decimals: number;
1706
    /**
1707
     * The display projection for these coordinates
1708
     * 
1709
     * @type {string}
1710
     *
1711
     */
1712
    projection: string;
1713
    /**
1714
     * Display format string
1715
     * 
1716
     * @type {string}
1717
     *
1718
     */
1719
    format?: string;
1720
}
1721

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

1787
/**
1788
 * Describes a name/value pair
1789
 *
1790
 *
1791
 * @interface INameValuePair
1792
 */
1793
export interface INameValuePair {
1794
    /**
1795
     * The name
1796
     *
1797
     * @type {string}
1798
     *
1799
     */
1800
    name: string;
1801
    /**
1802
     * The value
1803
     *
1804
     * @type {string}
1805
     *
1806
     */
1807
    value: string;
1808
}
1809

1810
/**
1811
 * Describes a redux reducer function
1812
 */
1813
export type ReducerFunction<TState> = (state: TState, action: ViewerAction) => TState;
1814

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

1865
    /**
1866
     * Template-specific data
1867
     * @since 0.14.8
1868
     */
1869
    templateData: Dictionary<any>;
1870
}
1871

1872
/**
1873
 * Signature for a template state reducer function
1874
 * 
1875
 * @since 0.13
1876
 */
1877
export type TemplateReducerFunction = (origState: ITemplateReducerState, currentState: ITemplateReducerState, action: ViewerAction) => ITemplateReducerState;
1878

1879
/**
1880
 * Keyboard code for ESCAPE
1881
 */
1882
export const KC_ESCAPE = 27;
1✔
1883

1884
/**
1885
 * Keyboard code for the letter U
1886
 */
1887
export const KC_U = 85;
1✔
1888

1889
/**
1890
 * The positioning of the map load indicator
1891
 */
1892
export type MapLoadIndicatorPositioning = "top" | "bottom";
1893

1894
/**
1895
 * Describes a swipe pair of maps. When swipe mode is active, the primary map is
1896
 * shown on the left (or covered area) and the secondary map is shown on the right
1897
 * (or uncovered area) based on the swipe position.
1898
 *
1899
 * @interface IMapSwipePair
1900
 * @since 0.15
1901
 */
1902
export interface IMapSwipePair {
1903
    /**
1904
     * The name of the primary map in the swipe pair. This is the map shown
1905
     * in non-swipe mode.
1906
     *
1907
     * @type {string}
1908
     */
1909
    primaryMapName: string;
1910
    /**
1911
     * The name of the secondary map in the swipe pair.
1912
     *
1913
     * @type {string}
1914
     */
1915
    secondaryMapName: string;
1916
    /**
1917
     * Optional display label for the primary (left) side of the swipe. Defaults
1918
     * to the "MAP_SWIPE_PRIMARY_LABEL" i18n string ("Primary") when not set.
1919
     *
1920
     * @type {string | undefined}
1921
     * @since 0.15
1922
     */
1923
    primaryLabel?: string;
1924
    /**
1925
     * Optional display label for the secondary (right) side of the swipe. Defaults
1926
     * to the "MAP_SWIPE_SECONDARY_LABEL" i18n string ("Secondary") when not set.
1927
     *
1928
     * @type {string | undefined}
1929
     * @since 0.15
1930
     */
1931
    secondaryLabel?: string;
1932
}
1933

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

2133
/**
2134
 * Describes an error thrown during initialization
2135
 *
2136
 *
2137
 * @interface InitError
2138
 */
2139
export interface InitError {
2140
    /**
2141
     * The error message
2142
     *
2143
     * @type {string}
2144
     *
2145
     */
2146
    message: string;
2147
    /**
2148
     * The error stack trace
2149
     *
2150
     * @type {string[]}
2151
     *
2152
     */
2153
    stack: string[];
2154
}
2155

2156
/**
2157
 * Describes the reducer state branch for initialization errors
2158
 *
2159
 *
2160
 * @interface IInitErrorReducerState
2161
 */
2162
export interface IInitErrorReducerState {
2163
    /**
2164
     * The caught initialization error
2165
     *
2166
     * @type {(InitError | undefined)}
2167
     *
2168
     */
2169
    error: InitError | undefined;
2170
    /**
2171
     * The initialization options
2172
     *
2173
     * @type {*}
2174
     *
2175
     */
2176
    options: any;
2177
    /**
2178
     * Indicates if the stack trace should be shown
2179
     *
2180
     * @type {boolean}
2181
     *
2182
     */
2183
    includeStack: boolean;
2184
    /**
2185
     * Any warnings that were encountered during initialization
2186
     * 
2187
     * @type {string[]}
2188
     *
2189
     */
2190
    warnings: string[];
2191
}
2192

2193
/**
2194
 * Describes the reducer state branch for viewer state
2195
 *
2196
 *
2197
 * @interface IViewerReducerState
2198
 */
2199
export interface IViewerReducerState {
2200
    /**
2201
     * The current size of the map viewport (in pixels)
2202
     * 
2203
     * @type {([number, number] | undefined)}
2204
     *
2205
     */
2206
    size: [number, number] | undefined;
2207
    /**
2208
     * The number of active busy actions. Zero indicates no busy activity. One or more
2209
     * indicates busy activity.
2210
     *
2211
     * @type {number}
2212
     *
2213
     */
2214
    busyCount: number;
2215
    /**
2216
     * The active map tool
2217
     *
2218
     * @type {ActiveMapTool}
2219
     *
2220
     */
2221
    tool: ActiveMapTool;
2222
    /**
2223
     * Indicates if feature tooltips are enabled
2224
     *
2225
     * @type {boolean}
2226
     *
2227
     */
2228
    featureTooltipsEnabled: boolean;
2229
}
2230

2231
/**
2232
 * Describes the reducer state branch for tracked mouse coordinates
2233
 *
2234
 *
2235
 * @interface IMouseReducerState
2236
 */
2237
export interface IMouseReducerState {
2238
    /**
2239
     * The last tracked mouse coordinate
2240
     *
2241
     * @type {(Coordinate2D | undefined)}
2242
     */
2243
    coords: Coordinate2D | undefined;
2244
}
2245

2246
/**
2247
 * Describes the full application state tree. Redux-aware components can connect and subscribe to
2248
 * various properties and branches of this tree and be automatically notified of any changes and
2249
 * update and re-render themselves accordingly
2250
 *
2251
 *
2252
 * @interface IApplicationState
2253
 */
2254
export interface IApplicationState {
2255
    /**
2256
     * Initialization errors
2257
     *
2258
     * @type {Readonly<IInitErrorReducerState>}
2259
     *
2260
     */
2261
    initError: Readonly<IInitErrorReducerState>;
2262
    /**
2263
     * Viewer configuration
2264
     *
2265
     * @type {Readonly<IConfigurationReducerState>}
2266
     *
2267
     */
2268
    config: Readonly<IConfigurationReducerState>;
2269
    /**
2270
     * Current template state
2271
     *
2272
     * @type {Readonly<ITemplateReducerState>}
2273
     *
2274
     */
2275
    template: Readonly<ITemplateReducerState>;
2276
    /**
2277
     * Viewer state
2278
     *
2279
     * @type {Readonly<IViewerReducerState>}
2280
     *
2281
     */
2282
    viewer: Readonly<IViewerReducerState>;
2283
    /**
2284
     * Runtime map state
2285
     *
2286
     * @type {Readonly<IBranchedMapState>}
2287
     *
2288
     */
2289
    mapState: Readonly<IBranchedMapState>;
2290
    /**
2291
     * Toolbar state
2292
     *
2293
     * @type {Readonly<IToolbarReducerState>}
2294
     *
2295
     */
2296
    toolbar: Readonly<IToolbarReducerState>;
2297
    /**
2298
     * Task Pane component state
2299
     *
2300
     * @type {Readonly<ITaskPaneReducerState>}
2301
     *
2302
     */
2303
    taskpane: Readonly<ITaskPaneReducerState>;
2304
    /**
2305
     * Modal dialog state
2306
     *
2307
     * @type {Readonly<IModalReducerState>}
2308
     *
2309
     */
2310
    modal: Readonly<IModalReducerState>;
2311
    /**
2312
     * Tracked mouse coordinate state
2313
     *
2314
     * @type {Readonly<IMouseReducerState>}
2315
     *
2316
     */
2317
    mouse: Readonly<IMouseReducerState>;
2318
    /**
2319
     * Tracks the last dispatched action
2320
     *
2321
     * @type {*}
2322
     *
2323
     */
2324
    lastaction: any;
2325
}
2326

2327
// Redux typedefs to tighten up our redux code
2328

2329
/**
2330
 * Describes the redux store
2331
 *
2332
 *
2333
 * @interface ReduxStore
2334
 */
2335
export interface ReduxStore {
2336
    /**
2337
     * Gets the application state
2338
     *
2339
     * @returns {Readonly<IApplicationState>}
2340
     */
2341
    getState(): Readonly<IApplicationState>;
2342
}
2343

2344
/**
2345
 * Describes a thunked redux action. Thunked redux actions are generally used for actions that push state
2346
 * asynchronously (eg. In response to an AJAX request)
2347
 */
2348
export type ReduxThunkedAction = (dispatch: ReduxDispatch, getState: () => Readonly<IApplicationState>) => any;
2349

2350
/**
2351
 * Describes a redux dispatcher function. A redux dispatch pushes new state to the redux store
2352
 */
2353
export type ReduxDispatch = (action: ViewerAction | ReduxThunkedAction) => void;
2354

2355
/**
2356
 * A function that does nothing
2357
 *
2358
 *
2359
 */
2360
export function NOOP() { }
1✔
2361

2362
/**
2363
 * A function that always returns false
2364
 *
2365
 *
2366
 * @returns false
2367
 */
2368
export function ALWAYS_FALSE() { return false; }
1✔
2369

2370
/**
2371
 * A function that always returns true
2372
 *
2373
 *
2374
 * @returns true
2375
 */
2376
export function ALWAYS_TRUE() { return true; }
1✔
2377

2378
/**
2379
 * Describe the size/dimensions of a DOM element in a toolbar or flyout menu
2380
 *
2381
 *
2382
 * @interface IDOMElementMetrics
2383
 */
2384
export interface IDOMElementMetrics {
2385
    /**
2386
     * The X position of this element
2387
     *
2388
     * @type {number}
2389
     *
2390
     */
2391
    posX: number;
2392
    /**
2393
     * The Y position of this element
2394
     *
2395
     * @type {number}
2396
     *
2397
     */
2398
    posY: number;
2399
    /**
2400
     * The width of this element
2401
     *
2402
     * @type {number}
2403
     *
2404
     */
2405
    width: number;
2406
    /**
2407
     * The height of this element
2408
     *
2409
     * @type {number}
2410
     *
2411
     */
2412
    height: number;
2413
    /**
2414
     * Indicates of this toolbar is vertically-oriented
2415
     *
2416
     * @type {boolean}
2417
     *
2418
     */
2419
    vertical?: boolean;
2420
}
2421

2422
/**
2423
 * Helper function to get the initial map view from the application state
2424
 *
2425
 *
2426
 * @param {Readonly<IApplicationState>} state
2427
 * @returns {(IMapView | undefined)}
2428
 */
2429
export function getInitialView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
2430
    if (state.config.activeMapName) {
×
2431
        return state.mapState[state.config.activeMapName].initialView;
×
2432
    }
×
UNCOV
2433
    return undefined;
×
UNCOV
2434
}
×
2435

2436
/**
2437
 * Helper function to get the mapguide-specific sub state of the current map group
2438
 *
2439
 *
2440
 * @param {Readonly<IApplicationState>} state
2441
 * @returns {(IMapGuideSubState | undefined)}
2442
 * @since 0.14
2443
 */
2444
export function getMapGuideSubState(state: Readonly<IApplicationState>): IMapGuideSubState | undefined {
1✔
2445
    if (state.config.activeMapName) {
30✔
2446
        return state.mapState[state.config.activeMapName].mapguide;
10✔
2447
    }
10✔
2448
    return undefined;
20✔
2449
}
20✔
2450

2451
/**
2452
 * Helper function to get the current selection set from the application state
2453
 *
2454
 *
2455
 * @param {Readonly<IApplicationState>} state
2456
 * @returns {(QueryMapFeaturesResponse | undefined)}
2457
 */
2458
export function getSelectionSet(state: Readonly<IApplicationState>): QueryMapFeaturesResponse | undefined {
1✔
2459
    return getMapGuideSubState(state)?.selectionSet;
26✔
2460
}
26✔
2461

2462
/**
2463
 * Helper function to get the current runtime map state from the application state
2464
 *
2465
 *
2466
 * @param {Readonly<IApplicationState>} state
2467
 * @returns {(RuntimeMap | undefined)}
2468
 */
2469
export function getRuntimeMap(state: Readonly<IApplicationState>): RuntimeMap | undefined {
1✔
2470
    return getMapGuideSubState(state)?.runtimeMap;
4!
2471
}
4✔
2472

2473
/**
2474
 * Helper function to get the current view from the application state
2475
 *
2476
 *
2477
 * @param {Readonly<IApplicationState>} state
2478
 * @returns {(IMapView | undefined)}
2479
 */
2480
export function getCurrentView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
2481
    if (state.config.activeMapName) {
4✔
2482
        return state.mapState[state.config.activeMapName].currentView;
3✔
2483
    }
3✔
2484
    return undefined;
1✔
2485
}
1✔
2486

2487
/**
2488
 * Determines if the given external base layer is one with a visual representation
2489
 * 
2490
 * @param layer 
2491
 * @returns 
2492
 * @since 0.14.9
2493
 */
2494
export function isVisualBaseLayer(layer: IExternalBaseLayer) {
1✔
2495
    return layer.kind != "UTFGrid";
4✔
2496
}
4✔
2497

2498
/**
2499
 * Helper function to get the current set of available external base layers from the application state
2500
 *
2501
 * @remarks This does not include "non-visual" base layers such as UTFGrid tilesets
2502
 * 
2503
 *
2504
 * @param {Readonly<IApplicationState>} state
2505
 * @returns {(IExternalBaseLayer[] | undefined)}
2506
 * 
2507
 * @since 0.14.9 Removed includeNonVisual parameter
2508
 */
2509
export function getExternalBaseLayers(state: Readonly<IApplicationState>): IExternalBaseLayer[] | undefined {
1✔
2510
    if (state.config.activeMapName) {
1!
UNCOV
2511
        return state.mapState[state.config.activeMapName].externalBaseLayers;
×
UNCOV
2512
    }
×
2513
    return undefined;
1✔
2514
}
1✔
2515

2516
/**
2517
 * Defines the visibility of flyout menus
2518
 */
2519
export type FlyoutVisibilitySet = { [flyoutId: string]: boolean | undefined };
2520

2521
/**
2522
 * Defines the capabilities of a WMS service
2523
 * 
2524
 * @since 0.11
2525
 */
2526
export interface WmsCapabilitiesDocument {
2527
    /**
2528
     * WMS service version
2529
     * 
2530
     * @type {string}
2531
     *
2532
     */
2533
    version: string;
2534
    Service: WMSServiceDescription;
2535
    Capability: WMSServiceCapabilities;
2536
}
2537

2538
/**
2539
 * @since 0.11
2540
 */
2541
export interface WMSServiceCapabilities {
2542
    Request: any;
2543
    Exception: string[];
2544
    Layer: WMSRootPublishedLayer;
2545
}
2546

2547
/**
2548
 * @since 0.12
2549
 */
2550
export interface WMSLayerBoundingBox {
2551
    crs: string;
2552
    extent: [number, number, number, number],
2553
    res: [any, any]
2554
}
2555

2556
/**
2557
 * @since 0.11
2558
 */
2559
export interface WMSPublishedLayer {
2560
    Name: string;
2561
    Title: string;
2562
    Abstract: string;
2563
    KeywordList: string;
2564
    CRS: string[];
2565
    EX_GeographicBoundingBox: [number, number, number, number];
2566
    BoundingBox: WMSLayerBoundingBox[];
2567
    Style: WMSLayerStyle[];
2568
    queryable: boolean;
2569
    opaque: boolean;
2570
    noSubsets: boolean;
2571
}
2572

2573
/**
2574
 * @since 0.11
2575
 */
2576
export interface WMSRootPublishedLayer extends WMSPublishedLayer {
2577
    Layer: WMSPublishedLayer[];
2578
}
2579

2580
/**
2581
 * @since 0.12
2582
 */
2583
export interface WMSLegendURLDefinition {
2584
    Format: string;
2585
    OnlineResource: string;
2586
    size: [number, number];
2587
}
2588

2589
/**
2590
 * @since 0.11
2591
 */
2592
export interface WMSLayerStyle {
2593
    Name: string;
2594
    Title: string;
2595
    Abstract: string;
2596
    LegendURL: WMSLegendURLDefinition[];
2597
}
2598

2599
/**
2600
 * @since 0.12
2601
 */
2602
export interface WMSContactAddress {
2603
    AddressType: string,
2604
    Address: string,
2605
    City: string,
2606
    StateOrProvince: string,
2607
    PostCode: string,
2608
    Country: string
2609
}
2610

2611
/**
2612
 * @since 0.12
2613
 */
2614
export interface WMSContact {
2615
    ContactPerson: string;
2616
    ContactOrganization: string;
2617
}
2618

2619
/**
2620
 * @since 0.12
2621
 */
2622
export interface WMSContactInformation {
2623
    ContactPersonPrimary: WMSContact,
2624
    ContactPosition: string,
2625
    ContactAddress: WMSContactAddress,
2626
    ContactVoiceTelephone: string,
2627
    ContactFacsimileTelephone: string,
2628
    ContactElectronicMailAddress: string
2629
}
2630

2631
/**
2632
 * @since 0.11
2633
 */
2634
export interface WMSServiceDescription {
2635
    Name: string;
2636
    Title: string;
2637
    Abstract: string;
2638
    KeywordList: string[];
2639
    OnlineResource: string;
2640
    ContactInformation: WMSContactInformation,
2641
    Fees: string;
2642
    AccessConstraints: string;
2643
}
2644

2645
export interface IMapGuideImageSource {
2646
    on(event: string, handler: Function): void;
2647
    updateParams(params: any): void;
2648
}
2649

2650
/**
2651
 * Custom properties that can be attached to OpenLayers layer instances
2652
 * 
2653
 * @since 0.13
2654
 */
2655
export enum LayerProperty {
1✔
2656
    LAYER_TYPE = "layer_type",
1✔
2657
    LAYER_NAME = "name",
1✔
2658
    /**
2659
     * @since 0.14
2660
     */
2661
    LAYER_DISPLAY_NAME = "display_name",
1✔
2662
    IS_GROUP = "is_group",
1✔
2663
    IS_EXTERNAL = "is_external",
1✔
2664
    IS_SELECTABLE = "is_selectable",
1✔
2665
    /**
2666
     * @since 0.14.5
2667
     */
2668
    DISABLE_HOVER = "disable_hover",
1✔
2669
    IS_SCRATCH = "is_scratch",
1✔
2670
    HAS_WMS_LEGEND = "has_wms_legend",
1✔
2671
    VECTOR_STYLE = "vector_style",
1✔
2672
    WGS84_BBOX = "wgs84_bbox",
1✔
2673
    BUSY_WORKER_COUNT = "busy_worker_count",
1✔
2674
    /**
2675
     * @since 0.14
2676
     */
2677
    SELECTED_POPUP_CONFIGURATION = "popup_config",
1✔
2678
    /**
2679
     * @since 0.14
2680
     */
2681
    LAYER_DESCRIPTION = "layer_description",
1✔
2682
    /**
2683
     * @since 0.14
2684
     */
2685
    LAYER_METADATA = "layer_metadata",
1✔
2686
    /**
2687
     * @since 0.14
2688
     */
2689
    IS_HOVER_HIGHLIGHT = "is_hover_highlight",
1✔
2690
    /**
2691
     * @since 0.14
2692
     */
2693
    IS_MEASURE = "is_measure",
1✔
2694
    /**
2695
     * @since 0.14
2696
     */
2697
    IS_WMS_SELECTION_OVERLAY = "is_wms_selection_overlay",
1✔
2698
    /**
2699
     * @since 0.14
2700
     */
2701
    IS_HEATMAP = "is_heatmap",
1✔
2702
    /**
2703
     * A source definition to attach to the layer. This is to assist in persistence of this layer for easy
2704
     * restoration on an application-defined basis
2705
     * 
2706
     * @since 0.14.3
2707
     */
2708
    LAYER_DEFN = "layer_defn"
1✔
2709
}
2710

2711
/**
2712
 * Custom properties that can be attached to OpenLayers image source instances
2713
 * 
2714
 * @since 0.13
2715
 */
2716
export enum SourceProperty {
1✔
2717
    SUPPRESS_LOAD_EVENTS = "suppress_load_events"
1✔
2718
}
2719

2720
/**
2721
 * MapGuide layer types
2722
 * 
2723
 * @since 0.13
2724
 */
2725
export enum MgLayerType {
1✔
2726
    Untiled = "MapGuide_Untiled",
1✔
2727
    Tiled = "MapGuide_Tiled"
1✔
2728
}
2729

2730
/**
2731
 * The type name for a MapGuide layer
2732
 * 
2733
 * @since 0.13
2734
 */
2735
export const MG_LAYER_TYPE_NAME = "MapGuide";
1✔
2736

2737
/**
2738
 * The default group name for MapGuide tiled layers. This value
2739
 * is not meant for localized display
2740
 * 
2741
 * @since 0.13
2742
 */
2743
export const MG_BASE_LAYER_GROUP_NAME = "Base Tile Layers";
1✔
2744

2745
/**
2746
 * Default names for MapGuide built-in layer types. These value
2747
 * are not meant for localized display
2748
 * 
2749
 * @since 0.13
2750
 */
2751
export enum MgBuiltInLayers {
1✔
2752
    Overlay = "MapGuide Dynamic Overlay",
1✔
2753
    SelectionOverlay = "MapGuide Selection Overlay",
1✔
2754
    ActiveFeatureSelectionOverlay = "MapGuide Active Feature Selection Overlay"
1✔
2755
}
2756

2757
/**
2758
 * A layer of a {@link ICompositeSelection}
2759
 * 
2760
 * @since 0.14
2761
 */
2762
export interface ICompositeSelectionLayer {
2763
    /**
2764
     * The id of this selection layer
2765
     */
2766
    getLayerId(): string | undefined;
2767
    /**
2768
     * The name of this layer
2769
     */
2770
    getName(): string;
2771
    /**
2772
     * The metadata of this layer
2773
     */
2774
    getLayerMetadata(): LayerMetadata | undefined;
2775
    /**
2776
     * Gets the feature at the given index
2777
     */
2778
    getFeatureAt(featureIndex: number): SelectedFeature;
2779
    /**
2780
     * Gets the total number of features in this layer
2781
     */
2782
    getFeatureCount(): number;
2783
}
2784

2785
/**
2786
 * A composition of a MapGuide selection set and a client-side vector feature selection
2787
 * 
2788
 * @since 0.14
2789
 */
2790
export interface ICompositeSelection {
2791
    /**
2792
     * Gets the number of layers in this selection set
2793
     */
2794
    getLayerCount(): number;
2795
    /**
2796
     * Gets the array of layers in this selection set
2797
     */
2798
    getLayers(): ICompositeSelectionLayer[];
2799
    /**
2800
     * Gets the layer at the specified index
2801
     * 
2802
     * @param layerIndex The selection layer index
2803
     */
2804
    getLayerAt(layerIndex: number): ICompositeSelectionLayer | undefined;
2805
    /**
2806
     * Gets the feature for the given layer at the specified indices
2807
     * 
2808
     * @param layerIndex The selection layer index
2809
     * @param featureIndex The feature index
2810
     */
2811
    getFeatureAt(layerIndex: number, featureIndex: number): SelectedFeature | undefined;
2812
}
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