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

jumpinjackie / mapguide-react-layout / 15165370206

21 May 2025 02:48PM UTC coverage: 22.447%. Remained the same
15165370206

push

github

jumpinjackie
#1555: More internalization of things that shouldn't be in the API documentation.

Also dd merge-modules plugin for typedoc which flattens our public symbol list, which makes better sense as our node module usage story is to import from a flat barrel "mapguide-react-layout" module.

878 of 1206 branches covered (72.8%)

4975 of 22163 relevant lines covered (22.45%)

6.95 hits per line

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

82.29
/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
export type DispatcherFunc = (dispatch: ReduxDispatch, getState: () => Readonly<IApplicationState>, viewer?: IMapViewer, parameters?: any) => any;
159

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

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

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

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

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

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

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

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

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

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

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

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

427

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1119
/**
1120
 * Point layer clustering options
1121
 * 
1122
 * @since 0.14
1123
 */
1124
export interface AddVectorLayerClusteringOptions {
1125
    kind: "Cluster";
1126
    /**
1127
     * The distance to use for clustering. Setting this value will create a clustered layer.
1128
     * 
1129
     *  * 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
1130
     */
1131
    clusterDistance: number;
1132
    /**
1133
     * The style to use for this clustered layer. 
1134
     * 
1135
     *  * If {@link clusterDistance} is not set, this has no effect
1136
     *  * 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
1137
     */
1138
    clusterStyle?: IVectorLayerStyle;
1139
    /**
1140
     * The action to perform when the cluster is clicked
1141
     */
1142
    onClusterClickAction?: ClusterClickAction;
1143
}
1144

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

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

1173
export type AddVectorLayerExtraOptions = AddVectorLayerClusteringOptions | AddVectorLayerThemeOptions | AddVectorLayerHeatmapOptions;
1174

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1408
export interface IToolbarReducerState {
1409
    toolbars: any;
1410
    flyouts: any;
1411
}
1412

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

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

1461
/*
1462
export interface IModalReducerState {
1463

1464
}
1465
*/
1466

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2246
// Redux typedefs to tighten up our redux code
2247

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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