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

jumpinjackie / mapguide-react-layout / 22956927411

11 Mar 2026 02:13PM UTC coverage: 36.937%. Remained the same
22956927411

Pull #1598

github

web-flow
Merge 8d4eabd1a into c63bb6b0e
Pull Request #1598: [WIP] Fix mouse coordinates format for multi-map awareness

1604 of 2093 branches covered (76.64%)

3 of 27 new or added lines in 3 files covered. (11.11%)

95 existing lines in 4 files now uncovered.

8826 of 23895 relevant lines covered (36.94%)

8.54 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 the reducer state branch for various configuration properties
1888
 *
1889
 *
1890
 * @interface IConfigurationReducerState
1891
 */
1892
export interface IConfigurationReducerState {
1893
    /**
1894
     * The agent URI
1895
     *
1896
     * @type {(string | undefined)}
1897
     *
1898
     */
1899
    agentUri: string | undefined;
1900
    /**
1901
     * The type of agent
1902
     *
1903
     * @type {ClientKind}
1904
     *
1905
     */
1906
    agentKind: ClientKind;
1907
    /**
1908
     * The current locale
1909
     *
1910
     * @type {string}
1911
     *
1912
     */
1913
    locale: string;
1914
    /**
1915
     * The current active map name
1916
     *
1917
     * @type {(string | undefined)}
1918
     *
1919
     */
1920
    activeMapName: string | undefined;
1921
    /**
1922
     * The array of available runtime maps
1923
     *
1924
     * @type {(INameValuePair[] | undefined)}
1925
     *
1926
     */
1927
    availableMaps: INameValuePair[] | undefined;
1928
    /**
1929
     * Coordinate display configuration
1930
     *
1931
     * @type {ICoordinateConfiguration}
1932
     *
1933
     */
1934
    coordinates: ICoordinateConfiguration;
1935
    /**
1936
     * Viewer capabilities
1937
     *
1938
     * @type {IViewerCapabilities}
1939
     *
1940
     */
1941
    capabilities: IViewerCapabilities;
1942
    /**
1943
     * A dictionary of arbitrary app settings
1944
     * 
1945
     * @since 0.14
1946
     */
1947
    appSettings?: Dictionary<string>;
1948
    /**
1949
     * Viewer configuration
1950
     * 
1951
     *
1952
     */
1953
    viewer: {
1954
        /**
1955
         * Whether this viewer will use stateless MapGuide rendering operations
1956
         * 
1957
         * @since 0.14
1958
         */
1959
        isStateless: boolean;
1960
        /**
1961
         * The current image format
1962
         *
1963
         * @type {ImageFormat}
1964
         */
1965
        imageFormat: ImageFormat;
1966
        /**
1967
         * The current selection image format
1968
         *
1969
         * @type {ImageFormat}
1970
         */
1971
        selectionImageFormat: ImageFormat;
1972
        /**
1973
         * The current selection color
1974
         *
1975
         * @type {string}
1976
         */
1977
        selectionColor: string;
1978
        /**
1979
         * The color to use for highlighting active selected features
1980
         * 
1981
         * @type {string}
1982
         */
1983
        activeSelectedFeatureColor: string;
1984
        /**
1985
         * The current point selection pixel tolerance
1986
         *
1987
         * @type {number}
1988
         */
1989
        pointSelectionBuffer: number;
1990
        /**
1991
         * The position of the map loading indicator
1992
         * 
1993
         * @type {MapLoadIndicatorPositioning}
1994
         */
1995
        loadIndicatorPositioning: MapLoadIndicatorPositioning;
1996
        /**
1997
         * The color of the map loading indicator. This is an valid CSS color expression
1998
         * 
1999
         * @type {string}
2000
         */
2001
        loadIndicatorColor: string;
2002
    },
2003
    /**
2004
     * Indicates if view rotation is enabled
2005
     * 
2006
     * @type {boolean}
2007
     *
2008
     */
2009
    viewRotationEnabled: boolean;
2010
    /**
2011
     * The current view rotation
2012
     * 
2013
     * @type {number}
2014
     *
2015
     */
2016
    viewRotation: number;
2017
    /**
2018
     * The unit to display view size in
2019
     * 
2020
     * @type {UnitOfMeasure}
2021
     *
2022
     */
2023
    viewSizeUnits: UnitOfMeasure;
2024
    /**
2025
     * @since 0.14.2
2026
     */
2027
    selectCanDragPan: boolean;
2028
    /**
2029
     * If specified and true and the MapTip component is active, then feature tooltips are activated
2030
     * by mouse click instead of idle mouse cursor at a given point on the map for a certain period of time. 
2031
     * 
2032
     * An active MapTip component with this setting enabled will override normal click-based selection.
2033
     * 
2034
     * @type {boolean}
2035
     *
2036
     */
2037
    manualFeatureTooltips: boolean;
2038
    /**
2039
     * The key code to listen for cancelling an active digitization
2040
     * 
2041
     * @type {number}
2042
     *
2043
     */
2044
    cancelDigitizationKey: number;
2045
    /**
2046
     * The key code to listen for undoing the last drawn point of an active digitization
2047
     * 
2048
     * @type {number}
2049
     *
2050
     */
2051
    undoLastPointKey: number;
2052
}
2053

2054
/**
2055
 * Describes an error thrown during initialization
2056
 *
2057
 *
2058
 * @interface InitError
2059
 */
2060
export interface InitError {
2061
    /**
2062
     * The error message
2063
     *
2064
     * @type {string}
2065
     *
2066
     */
2067
    message: string;
2068
    /**
2069
     * The error stack trace
2070
     *
2071
     * @type {string[]}
2072
     *
2073
     */
2074
    stack: string[];
2075
}
2076

2077
/**
2078
 * Describes the reducer state branch for initialization errors
2079
 *
2080
 *
2081
 * @interface IInitErrorReducerState
2082
 */
2083
export interface IInitErrorReducerState {
2084
    /**
2085
     * The caught initialization error
2086
     *
2087
     * @type {(InitError | undefined)}
2088
     *
2089
     */
2090
    error: InitError | undefined;
2091
    /**
2092
     * The initialization options
2093
     *
2094
     * @type {*}
2095
     *
2096
     */
2097
    options: any;
2098
    /**
2099
     * Indicates if the stack trace should be shown
2100
     *
2101
     * @type {boolean}
2102
     *
2103
     */
2104
    includeStack: boolean;
2105
    /**
2106
     * Any warnings that were encountered during initialization
2107
     * 
2108
     * @type {string[]}
2109
     *
2110
     */
2111
    warnings: string[];
2112
}
2113

2114
/**
2115
 * Describes the reducer state branch for viewer state
2116
 *
2117
 *
2118
 * @interface IViewerReducerState
2119
 */
2120
export interface IViewerReducerState {
2121
    /**
2122
     * The current size of the map viewport (in pixels)
2123
     * 
2124
     * @type {([number, number] | undefined)}
2125
     *
2126
     */
2127
    size: [number, number] | undefined;
2128
    /**
2129
     * The number of active busy actions. Zero indicates no busy activity. One or more
2130
     * indicates busy activity.
2131
     *
2132
     * @type {number}
2133
     *
2134
     */
2135
    busyCount: number;
2136
    /**
2137
     * The active map tool
2138
     *
2139
     * @type {ActiveMapTool}
2140
     *
2141
     */
2142
    tool: ActiveMapTool;
2143
    /**
2144
     * Indicates if feature tooltips are enabled
2145
     *
2146
     * @type {boolean}
2147
     *
2148
     */
2149
    featureTooltipsEnabled: boolean;
2150
}
2151

2152
/**
2153
 * Describes the reducer state branch for tracked mouse coordinates
2154
 *
2155
 *
2156
 * @interface IMouseReducerState
2157
 */
2158
export interface IMouseReducerState {
2159
    /**
2160
     * The last tracked mouse coordinate
2161
     *
2162
     * @type {(Coordinate2D | undefined)}
2163
     */
2164
    coords: Coordinate2D | undefined;
2165
}
2166

2167
/**
2168
 * Describes the full application state tree. Redux-aware components can connect and subscribe to
2169
 * various properties and branches of this tree and be automatically notified of any changes and
2170
 * update and re-render themselves accordingly
2171
 *
2172
 *
2173
 * @interface IApplicationState
2174
 */
2175
export interface IApplicationState {
2176
    /**
2177
     * Initialization errors
2178
     *
2179
     * @type {Readonly<IInitErrorReducerState>}
2180
     *
2181
     */
2182
    initError: Readonly<IInitErrorReducerState>;
2183
    /**
2184
     * Viewer configuration
2185
     *
2186
     * @type {Readonly<IConfigurationReducerState>}
2187
     *
2188
     */
2189
    config: Readonly<IConfigurationReducerState>;
2190
    /**
2191
     * Current template state
2192
     *
2193
     * @type {Readonly<ITemplateReducerState>}
2194
     *
2195
     */
2196
    template: Readonly<ITemplateReducerState>;
2197
    /**
2198
     * Viewer state
2199
     *
2200
     * @type {Readonly<IViewerReducerState>}
2201
     *
2202
     */
2203
    viewer: Readonly<IViewerReducerState>;
2204
    /**
2205
     * Runtime map state
2206
     *
2207
     * @type {Readonly<IBranchedMapState>}
2208
     *
2209
     */
2210
    mapState: Readonly<IBranchedMapState>;
2211
    /**
2212
     * Toolbar state
2213
     *
2214
     * @type {Readonly<IToolbarReducerState>}
2215
     *
2216
     */
2217
    toolbar: Readonly<IToolbarReducerState>;
2218
    /**
2219
     * Task Pane component state
2220
     *
2221
     * @type {Readonly<ITaskPaneReducerState>}
2222
     *
2223
     */
2224
    taskpane: Readonly<ITaskPaneReducerState>;
2225
    /**
2226
     * Modal dialog state
2227
     *
2228
     * @type {Readonly<IModalReducerState>}
2229
     *
2230
     */
2231
    modal: Readonly<IModalReducerState>;
2232
    /**
2233
     * Tracked mouse coordinate state
2234
     *
2235
     * @type {Readonly<IMouseReducerState>}
2236
     *
2237
     */
2238
    mouse: Readonly<IMouseReducerState>;
2239
    /**
2240
     * Tracks the last dispatched action
2241
     *
2242
     * @type {*}
2243
     *
2244
     */
2245
    lastaction: any;
2246
}
2247

2248
// Redux typedefs to tighten up our redux code
2249

2250
/**
2251
 * Describes the redux store
2252
 *
2253
 *
2254
 * @interface ReduxStore
2255
 */
2256
export interface ReduxStore {
2257
    /**
2258
     * Gets the application state
2259
     *
2260
     * @returns {Readonly<IApplicationState>}
2261
     */
2262
    getState(): Readonly<IApplicationState>;
2263
}
2264

2265
/**
2266
 * Describes a thunked redux action. Thunked redux actions are generally used for actions that push state
2267
 * asynchronously (eg. In response to an AJAX request)
2268
 */
2269
export type ReduxThunkedAction = (dispatch: ReduxDispatch, getState: () => Readonly<IApplicationState>) => any;
2270

2271
/**
2272
 * Describes a redux dispatcher function. A redux dispatch pushes new state to the redux store
2273
 */
2274
export type ReduxDispatch = (action: ViewerAction | ReduxThunkedAction) => void;
2275

2276
/**
2277
 * A function that does nothing
2278
 *
2279
 *
2280
 */
2281
export function NOOP() { }
1✔
2282

2283
/**
2284
 * A function that always returns false
2285
 *
2286
 *
2287
 * @returns false
2288
 */
2289
export function ALWAYS_FALSE() { return false; }
1✔
2290

2291
/**
2292
 * A function that always returns true
2293
 *
2294
 *
2295
 * @returns true
2296
 */
2297
export function ALWAYS_TRUE() { return true; }
1✔
2298

2299
/**
2300
 * Describe the size/dimensions of a DOM element in a toolbar or flyout menu
2301
 *
2302
 *
2303
 * @interface IDOMElementMetrics
2304
 */
2305
export interface IDOMElementMetrics {
2306
    /**
2307
     * The X position of this element
2308
     *
2309
     * @type {number}
2310
     *
2311
     */
2312
    posX: number;
2313
    /**
2314
     * The Y position of this element
2315
     *
2316
     * @type {number}
2317
     *
2318
     */
2319
    posY: number;
2320
    /**
2321
     * The width of this element
2322
     *
2323
     * @type {number}
2324
     *
2325
     */
2326
    width: number;
2327
    /**
2328
     * The height of this element
2329
     *
2330
     * @type {number}
2331
     *
2332
     */
2333
    height: number;
2334
    /**
2335
     * Indicates of this toolbar is vertically-oriented
2336
     *
2337
     * @type {boolean}
2338
     *
2339
     */
2340
    vertical?: boolean;
2341
}
2342

2343
/**
2344
 * Helper function to get the initial map view from the application state
2345
 *
2346
 *
2347
 * @param {Readonly<IApplicationState>} state
2348
 * @returns {(IMapView | undefined)}
2349
 */
2350
export function getInitialView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
UNCOV
2351
    if (state.config.activeMapName) {
×
UNCOV
2352
        return state.mapState[state.config.activeMapName].initialView;
×
UNCOV
2353
    }
×
UNCOV
2354
    return undefined;
×
UNCOV
2355
}
×
2356

2357
/**
2358
 * Helper function to get the mapguide-specific sub state of the current map group
2359
 *
2360
 *
2361
 * @param {Readonly<IApplicationState>} state
2362
 * @returns {(IMapGuideSubState | undefined)}
2363
 * @since 0.14
2364
 */
2365
export function getMapGuideSubState(state: Readonly<IApplicationState>): IMapGuideSubState | undefined {
1✔
2366
    if (state.config.activeMapName) {
24✔
2367
        return state.mapState[state.config.activeMapName].mapguide;
10✔
2368
    }
10✔
2369
    return undefined;
14✔
2370
}
14✔
2371

2372
/**
2373
 * Helper function to get the current selection set from the application state
2374
 *
2375
 *
2376
 * @param {Readonly<IApplicationState>} state
2377
 * @returns {(QueryMapFeaturesResponse | undefined)}
2378
 */
2379
export function getSelectionSet(state: Readonly<IApplicationState>): QueryMapFeaturesResponse | undefined {
1✔
2380
    return getMapGuideSubState(state)?.selectionSet;
23✔
2381
}
23✔
2382

2383
/**
2384
 * Helper function to get the current runtime map state from the application state
2385
 *
2386
 *
2387
 * @param {Readonly<IApplicationState>} state
2388
 * @returns {(RuntimeMap | undefined)}
2389
 */
2390
export function getRuntimeMap(state: Readonly<IApplicationState>): RuntimeMap | undefined {
1✔
2391
    return getMapGuideSubState(state)?.runtimeMap;
1!
2392
}
1✔
2393

2394
/**
2395
 * Helper function to get the current view from the application state
2396
 *
2397
 *
2398
 * @param {Readonly<IApplicationState>} state
2399
 * @returns {(IMapView | undefined)}
2400
 */
2401
export function getCurrentView(state: Readonly<IApplicationState>): IMapView | undefined {
1✔
2402
    if (state.config.activeMapName) {
1!
UNCOV
2403
        return state.mapState[state.config.activeMapName].currentView;
×
UNCOV
2404
    }
×
2405
    return undefined;
1✔
2406
}
1✔
2407

2408
/**
2409
 * Determines if the given external base layer is one with a visual representation
2410
 * 
2411
 * @param layer 
2412
 * @returns 
2413
 * @since 0.14.9
2414
 */
2415
export function isVisualBaseLayer(layer: IExternalBaseLayer) {
1✔
2416
    return layer.kind != "UTFGrid";
4✔
2417
}
4✔
2418

2419
/**
2420
 * Helper function to get the current set of available external base layers from the application state
2421
 *
2422
 * @remarks This does not include "non-visual" base layers such as UTFGrid tilesets
2423
 * 
2424
 *
2425
 * @param {Readonly<IApplicationState>} state
2426
 * @returns {(IExternalBaseLayer[] | undefined)}
2427
 * 
2428
 * @since 0.14.9 Removed includeNonVisual parameter
2429
 */
2430
export function getExternalBaseLayers(state: Readonly<IApplicationState>): IExternalBaseLayer[] | undefined {
1✔
2431
    if (state.config.activeMapName) {
1!
UNCOV
2432
        return state.mapState[state.config.activeMapName].externalBaseLayers;
×
UNCOV
2433
    }
×
2434
    return undefined;
1✔
2435
}
1✔
2436

2437
/**
2438
 * Defines the visibility of flyout menus
2439
 */
2440
export type FlyoutVisibilitySet = { [flyoutId: string]: boolean | undefined };
2441

2442
/**
2443
 * Defines the capabilities of a WMS service
2444
 * 
2445
 * @since 0.11
2446
 */
2447
export interface WmsCapabilitiesDocument {
2448
    /**
2449
     * WMS service version
2450
     * 
2451
     * @type {string}
2452
     *
2453
     */
2454
    version: string;
2455
    Service: WMSServiceDescription;
2456
    Capability: WMSServiceCapabilities;
2457
}
2458

2459
/**
2460
 * @since 0.11
2461
 */
2462
export interface WMSServiceCapabilities {
2463
    Request: any;
2464
    Exception: string[];
2465
    Layer: WMSRootPublishedLayer;
2466
}
2467

2468
/**
2469
 * @since 0.12
2470
 */
2471
export interface WMSLayerBoundingBox {
2472
    crs: string;
2473
    extent: [number, number, number, number],
2474
    res: [any, any]
2475
}
2476

2477
/**
2478
 * @since 0.11
2479
 */
2480
export interface WMSPublishedLayer {
2481
    Name: string;
2482
    Title: string;
2483
    Abstract: string;
2484
    KeywordList: string;
2485
    CRS: string[];
2486
    EX_GeographicBoundingBox: [number, number, number, number];
2487
    BoundingBox: WMSLayerBoundingBox[];
2488
    Style: WMSLayerStyle[];
2489
    queryable: boolean;
2490
    opaque: boolean;
2491
    noSubsets: boolean;
2492
}
2493

2494
/**
2495
 * @since 0.11
2496
 */
2497
export interface WMSRootPublishedLayer extends WMSPublishedLayer {
2498
    Layer: WMSPublishedLayer[];
2499
}
2500

2501
/**
2502
 * @since 0.12
2503
 */
2504
export interface WMSLegendURLDefinition {
2505
    Format: string;
2506
    OnlineResource: string;
2507
    size: [number, number];
2508
}
2509

2510
/**
2511
 * @since 0.11
2512
 */
2513
export interface WMSLayerStyle {
2514
    Name: string;
2515
    Title: string;
2516
    Abstract: string;
2517
    LegendURL: WMSLegendURLDefinition[];
2518
}
2519

2520
/**
2521
 * @since 0.12
2522
 */
2523
export interface WMSContactAddress {
2524
    AddressType: string,
2525
    Address: string,
2526
    City: string,
2527
    StateOrProvince: string,
2528
    PostCode: string,
2529
    Country: string
2530
}
2531

2532
/**
2533
 * @since 0.12
2534
 */
2535
export interface WMSContact {
2536
    ContactPerson: string;
2537
    ContactOrganization: string;
2538
}
2539

2540
/**
2541
 * @since 0.12
2542
 */
2543
export interface WMSContactInformation {
2544
    ContactPersonPrimary: WMSContact,
2545
    ContactPosition: string,
2546
    ContactAddress: WMSContactAddress,
2547
    ContactVoiceTelephone: string,
2548
    ContactFacsimileTelephone: string,
2549
    ContactElectronicMailAddress: string
2550
}
2551

2552
/**
2553
 * @since 0.11
2554
 */
2555
export interface WMSServiceDescription {
2556
    Name: string;
2557
    Title: string;
2558
    Abstract: string;
2559
    KeywordList: string[];
2560
    OnlineResource: string;
2561
    ContactInformation: WMSContactInformation,
2562
    Fees: string;
2563
    AccessConstraints: string;
2564
}
2565

2566
export interface IMapGuideImageSource {
2567
    on(event: string, handler: Function): void;
2568
    updateParams(params: any): void;
2569
}
2570

2571
/**
2572
 * Custom properties that can be attached to OpenLayers layer instances
2573
 * 
2574
 * @since 0.13
2575
 */
2576
export enum LayerProperty {
1✔
2577
    LAYER_TYPE = "layer_type",
1✔
2578
    LAYER_NAME = "name",
1✔
2579
    /**
2580
     * @since 0.14
2581
     */
2582
    LAYER_DISPLAY_NAME = "display_name",
1✔
2583
    IS_GROUP = "is_group",
1✔
2584
    IS_EXTERNAL = "is_external",
1✔
2585
    IS_SELECTABLE = "is_selectable",
1✔
2586
    /**
2587
     * @since 0.14.5
2588
     */
2589
    DISABLE_HOVER = "disable_hover",
1✔
2590
    IS_SCRATCH = "is_scratch",
1✔
2591
    HAS_WMS_LEGEND = "has_wms_legend",
1✔
2592
    VECTOR_STYLE = "vector_style",
1✔
2593
    WGS84_BBOX = "wgs84_bbox",
1✔
2594
    BUSY_WORKER_COUNT = "busy_worker_count",
1✔
2595
    /**
2596
     * @since 0.14
2597
     */
2598
    SELECTED_POPUP_CONFIGURATION = "popup_config",
1✔
2599
    /**
2600
     * @since 0.14
2601
     */
2602
    LAYER_DESCRIPTION = "layer_description",
1✔
2603
    /**
2604
     * @since 0.14
2605
     */
2606
    LAYER_METADATA = "layer_metadata",
1✔
2607
    /**
2608
     * @since 0.14
2609
     */
2610
    IS_HOVER_HIGHLIGHT = "is_hover_highlight",
1✔
2611
    /**
2612
     * @since 0.14
2613
     */
2614
    IS_MEASURE = "is_measure",
1✔
2615
    /**
2616
     * @since 0.14
2617
     */
2618
    IS_WMS_SELECTION_OVERLAY = "is_wms_selection_overlay",
1✔
2619
    /**
2620
     * @since 0.14
2621
     */
2622
    IS_HEATMAP = "is_heatmap",
1✔
2623
    /**
2624
     * A source definition to attach to the layer. This is to assist in persistence of this layer for easy
2625
     * restoration on an application-defined basis
2626
     * 
2627
     * @since 0.14.3
2628
     */
2629
    LAYER_DEFN = "layer_defn"
1✔
2630
}
2631

2632
/**
2633
 * Custom properties that can be attached to OpenLayers image source instances
2634
 * 
2635
 * @since 0.13
2636
 */
2637
export enum SourceProperty {
1✔
2638
    SUPPRESS_LOAD_EVENTS = "suppress_load_events"
1✔
2639
}
2640

2641
/**
2642
 * MapGuide layer types
2643
 * 
2644
 * @since 0.13
2645
 */
2646
export enum MgLayerType {
1✔
2647
    Untiled = "MapGuide_Untiled",
1✔
2648
    Tiled = "MapGuide_Tiled"
1✔
2649
}
2650

2651
/**
2652
 * The type name for a MapGuide layer
2653
 * 
2654
 * @since 0.13
2655
 */
2656
export const MG_LAYER_TYPE_NAME = "MapGuide";
1✔
2657

2658
/**
2659
 * The default group name for MapGuide tiled layers. This value
2660
 * is not meant for localized display
2661
 * 
2662
 * @since 0.13
2663
 */
2664
export const MG_BASE_LAYER_GROUP_NAME = "Base Tile Layers";
1✔
2665

2666
/**
2667
 * Default names for MapGuide built-in layer types. These value
2668
 * are not meant for localized display
2669
 * 
2670
 * @since 0.13
2671
 */
2672
export enum MgBuiltInLayers {
1✔
2673
    Overlay = "MapGuide Dynamic Overlay",
1✔
2674
    SelectionOverlay = "MapGuide Selection Overlay",
1✔
2675
    ActiveFeatureSelectionOverlay = "MapGuide Active Feature Selection Overlay"
1✔
2676
}
2677

2678
/**
2679
 * A layer of a {@link ICompositeSelection}
2680
 * 
2681
 * @since 0.14
2682
 */
2683
export interface ICompositeSelectionLayer {
2684
    /**
2685
     * The id of this selection layer
2686
     */
2687
    getLayerId(): string | undefined;
2688
    /**
2689
     * The name of this layer
2690
     */
2691
    getName(): string;
2692
    /**
2693
     * The metadata of this layer
2694
     */
2695
    getLayerMetadata(): LayerMetadata | undefined;
2696
    /**
2697
     * Gets the feature at the given index
2698
     */
2699
    getFeatureAt(featureIndex: number): SelectedFeature;
2700
    /**
2701
     * Gets the total number of features in this layer
2702
     */
2703
    getFeatureCount(): number;
2704
}
2705

2706
/**
2707
 * A composition of a MapGuide selection set and a client-side vector feature selection
2708
 * 
2709
 * @since 0.14
2710
 */
2711
export interface ICompositeSelection {
2712
    /**
2713
     * Gets the number of layers in this selection set
2714
     */
2715
    getLayerCount(): number;
2716
    /**
2717
     * Gets the array of layers in this selection set
2718
     */
2719
    getLayers(): ICompositeSelectionLayer[];
2720
    /**
2721
     * Gets the layer at the specified index
2722
     * 
2723
     * @param layerIndex The selection layer index
2724
     */
2725
    getLayerAt(layerIndex: number): ICompositeSelectionLayer | undefined;
2726
    /**
2727
     * Gets the feature for the given layer at the specified indices
2728
     * 
2729
     * @param layerIndex The selection layer index
2730
     * @param featureIndex The feature index
2731
     */
2732
    getFeatureAt(layerIndex: number, featureIndex: number): SelectedFeature | undefined;
2733
}
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