@opengeoweb/webmap 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +11 -0
  2. package/index.d.ts +1 -0
  3. package/lib/components/WMAnimate.d.ts +14 -0
  4. package/lib/components/WMBBOX.d.ts +31 -0
  5. package/lib/components/WMBBOX.spec.d.ts +1 -0
  6. package/lib/components/WMCanvasBuffer.d.ts +116 -0
  7. package/lib/components/WMCanvasBuffer.spec.d.ts +1 -0
  8. package/lib/components/WMConstants.d.ts +28 -0
  9. package/lib/components/WMDrawMarker.d.ts +2 -0
  10. package/lib/components/WMDrawMarker.spec.d.ts +1 -0
  11. package/lib/components/WMFlyToBBox.d.ts +22 -0
  12. package/lib/components/WMFlyToBBox.spec.d.ts +1 -0
  13. package/lib/components/WMGetServiceFromStore.d.ts +3 -0
  14. package/lib/components/WMGlobals.d.ts +7 -0
  15. package/lib/components/WMImage.d.ts +72 -0
  16. package/lib/components/WMImage.spec.d.ts +1 -0
  17. package/lib/components/WMImageStore.d.ts +45 -0
  18. package/lib/components/WMImageStore.spec.d.ts +1 -0
  19. package/lib/components/WMJSDimension.d.ts +89 -0
  20. package/lib/components/WMJSDimension.spec.d.ts +1 -0
  21. package/lib/components/WMJSExternalDependencies.d.ts +3 -0
  22. package/lib/components/WMJSMap.d.ts +310 -0
  23. package/lib/components/WMJSMap.spec.d.ts +1 -0
  24. package/lib/components/WMJSMap.stories.d.ts +6 -0
  25. package/lib/components/WMJSMapHelpers.d.ts +7 -0
  26. package/lib/components/WMJSMapHelpers.spec.d.ts +1 -0
  27. package/lib/components/WMJSService.d.ts +77 -0
  28. package/lib/components/WMJSService.spec.d.ts +1 -0
  29. package/lib/components/WMJSTools.d.ts +60 -0
  30. package/lib/components/WMJSTools.spec.d.ts +1 -0
  31. package/lib/components/WMLayer.d.ts +200 -0
  32. package/lib/components/WMLayer.spec.d.ts +1 -0
  33. package/lib/components/WMLegend.d.ts +6 -0
  34. package/lib/components/WMLegend.spec.d.ts +1 -0
  35. package/lib/components/WMListener.d.ts +14 -0
  36. package/lib/components/WMMapPin.d.ts +24 -0
  37. package/lib/components/WMProjection.d.ts +10 -0
  38. package/lib/components/WMTileRenderer.d.ts +7 -0
  39. package/lib/components/WMTileRenderer.spec.d.ts +1 -0
  40. package/lib/components/WMTime.d.ts +41 -0
  41. package/lib/components/WMTime.spec.d.ts +1 -0
  42. package/lib/components/WMTimeTypes.d.ts +19 -0
  43. package/lib/components/WMTimer.d.ts +11 -0
  44. package/lib/components/WMTimer.spec.d.ts +1 -0
  45. package/lib/components/WMXMLParser.d.ts +9 -0
  46. package/lib/components/WMXMLParser.spec.d.ts +1 -0
  47. package/lib/components/index.d.ts +18 -0
  48. package/lib/components/types.d.ts +37 -0
  49. package/lib/utils/I18n/lang.en.d.ts +387 -0
  50. package/lib/utils/I18n/lang.nl.d.ts +387 -0
  51. package/lib/utils/specs/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +2 -0
  52. package/lib/utils/specs/WMS130GetCapabilitiesHarmN25.d.ts +2 -0
  53. package/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts +2 -0
  54. package/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritLayerprops.d.ts +2 -0
  55. package/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithoutInheritLayerprops.d.ts +2 -0
  56. package/lib/utils/specs/WMSSmartMet.d.ts +2 -0
  57. package/lib/utils/testUtils.d.ts +35 -0
  58. package/lib/utils/tilesettings.d.ts +335 -0
  59. package/package.json +21 -0
  60. package/webmap.esm.js +9017 -0
  61. package/webmap.umd.js +9014 -0
@@ -0,0 +1,310 @@
1
+ import WMBBOX from './WMBBOX';
2
+ import WMListener from './WMListener';
3
+ import WMJSDimension from './WMJSDimension';
4
+ import MapPin from './WMMapPin';
5
+ import WMLayer from './WMLayer';
6
+ import { LinkedInfo } from './types';
7
+ export declare const detectLeftButton: (evt: MouseEvent) => boolean;
8
+ export declare const detectRightButton: (evt: MouseEvent) => boolean;
9
+ export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
10
+ /**
11
+ /**
12
+ * WMJSMap class
13
+ */
14
+ export default class WMJSMap {
15
+ mapPin: MapPin;
16
+ mapdimensions: WMJSDimension[];
17
+ stopAnimating: () => void;
18
+ isAnimating: boolean;
19
+ animationDelay: number;
20
+ animationList: any;
21
+ _animationList: any;
22
+ currentAnimationStep: number;
23
+ setAnimationDelay: (delay: any) => void;
24
+ isAnimatingLoopRunning: boolean;
25
+ checkAnimation: () => void;
26
+ animateBusy: boolean;
27
+ animationTimer: any;
28
+ mouseHoverAnimationBox: boolean;
29
+ loadingDiv: HTMLElement;
30
+ baseDiv: HTMLElement;
31
+ mapZooming: 0 | 1;
32
+ mouseX: number;
33
+ mouseDownX: number;
34
+ mouseY: number;
35
+ mouseDownY: number;
36
+ private WebMapJSMapVersion;
37
+ private mainElement;
38
+ private srs;
39
+ private resizeBBOX;
40
+ private defaultBBOX;
41
+ private width;
42
+ private height;
43
+ private layers;
44
+ private baseLayers;
45
+ private numBaseLayers;
46
+ private _map;
47
+ private renderer;
48
+ private layersBusy;
49
+ private mapBusy;
50
+ private hasGeneratedId;
51
+ private divZoomBox;
52
+ private divBoundingBox;
53
+ private divDimInfo;
54
+ private _displayLegendInMap;
55
+ private bbox;
56
+ updateBBOX: WMBBOX;
57
+ private loadedBBOX;
58
+ drawnBBOX: WMBBOX;
59
+ private divBuffer;
60
+ private isDestroyed;
61
+ private mapHeader;
62
+ private currentCursor;
63
+ private mapIsActivated;
64
+ private isMapHeaderEnabled;
65
+ private showScaleBarInMap;
66
+ private callBack;
67
+ private initialized;
68
+ private suspendDrawing;
69
+ private activeLayer;
70
+ private MaxUndos;
71
+ private NrOfUndos;
72
+ private UndoPointer;
73
+ private DoUndo;
74
+ private DoRedo;
75
+ private WMProjectionUndo;
76
+ private WMProjectionTempUndo;
77
+ private gfiDialogList;
78
+ private setTimeOffsetValue;
79
+ private setMessageValue;
80
+ private canvasErrors;
81
+ private resizeWidth;
82
+ private resizeHeight;
83
+ private _resizeTimerBusy;
84
+ private _resizeTimer;
85
+ private wmAnimate;
86
+ private wmTileRenderer;
87
+ private loadingDivTimer;
88
+ private mouseWheelBusy;
89
+ private wMFlyToBBox;
90
+ private mouseWheelEventBBOXCurrent;
91
+ private mouseWheelEventBBOXNew;
92
+ private mouseUpX;
93
+ private mouseUpY;
94
+ private mouseDragging;
95
+ private controlsBusy;
96
+ private mouseDownPressed;
97
+ private mapMode;
98
+ private numGetFeatureInfoRequests;
99
+ private getFeatureInfoResult;
100
+ private oldMapMode;
101
+ private InValidMouseAction;
102
+ private resizingBBOXCursor;
103
+ private resizingBBOXEnabled;
104
+ private mouseGeoCoordXY;
105
+ private mouseUpdateCoordinates;
106
+ private mapPanning;
107
+ private mapPanStartGeoCoords;
108
+ private proj4;
109
+ private previousMouseButtonState;
110
+ private longlat;
111
+ xml2jsonrequest: string;
112
+ private tileRenderSettings;
113
+ private drawPending;
114
+ private needsRedraw;
115
+ private buildLayerDimsBusy;
116
+ constructor(_element: HTMLElement);
117
+ setXML2JSONURL(_xml2jsonrequest: string): void;
118
+ setWMTileRendererTileSettings(_WMTileRendererTileSettings: unknown): void;
119
+ /**
120
+ * Function which make a component ID which is unique over several WebMapJS instances
121
+ * @param the desired id
122
+ * @return the unique id
123
+ */
124
+ makeComponentId(id: string): string;
125
+ setMessage(message: string): void;
126
+ setTimeOffset(message: string): void;
127
+ _adagucBeforeDraw(ctx: CanvasRenderingContext2D): void;
128
+ _adagucBeforeCanvasDisplay(ctx: CanvasRenderingContext2D): void;
129
+ init(): void;
130
+ rebuildMapDimensions(): void;
131
+ getLayerByServiceAndName(layerService: string, layerName: string): WMLayer;
132
+ getLayers(): WMLayer[];
133
+ setLayer(layer: WMLayer): Promise<unknown>;
134
+ setActive(active: boolean): void;
135
+ setActiveLayer(layer: WMLayer): void;
136
+ calculateNumBaseLayers(): void;
137
+ enableLayer(layer: WMLayer): void;
138
+ disableLayer(layer: WMLayer): void;
139
+ toggleLayer(layer: WMLayer): void;
140
+ displayLayer(layer: WMLayer, enabled: boolean): void;
141
+ _getLayerIndex(layer: WMLayer): number;
142
+ removeAllLayers(): void;
143
+ deleteLayer(layerToDelete: WMLayer): void;
144
+ moveLayerDown(layerToMove: WMLayer): void;
145
+ swapLayers(_layerA: WMLayer, _layerB: WMLayer): void;
146
+ moveLayerUp(layerToMove: WMLayer): void;
147
+ configureMapDimensions(layer: WMLayer): void;
148
+ /**
149
+ * @param layer of type WMLayer
150
+ */
151
+ addLayer(layer: WMLayer): Promise<unknown>;
152
+ getActiveLayer(): WMLayer;
153
+ /**
154
+ * setProjection
155
+ * Set the projection of the current webmap object
156
+ *_srs also accepts a projectionProperty object
157
+ */
158
+ setProjection(_srs: string | {
159
+ srs: string;
160
+ bbox: WMBBOX;
161
+ }, _bbox?: WMBBOX): void;
162
+ getBBOX(): WMBBOX;
163
+ getProjection(): {
164
+ srs: string;
165
+ bbox: WMBBOX;
166
+ };
167
+ getSize(): {
168
+ width: number;
169
+ height: number;
170
+ };
171
+ getWidth(): number;
172
+ getHeight(): number;
173
+ getMapPin(): MapPin;
174
+ repositionLegendGraphic(): void;
175
+ setSize(w: number, h: number): void;
176
+ _setSize(w: number, h: number): void;
177
+ abort(): void;
178
+ isBusy(): boolean;
179
+ _makeInfoHTML(): void;
180
+ showScaleBar(): void;
181
+ hideScaleBar(): void;
182
+ displayScaleBarInMap(display: boolean): void;
183
+ display(): void;
184
+ _animFrameRedraw(): void;
185
+ draw(animationList?: {}): void;
186
+ /**
187
+ * API Function called to draw the layers, fires getmap request and shows the layers on the screen
188
+ */
189
+ _draw(animationList: string | any[]): void;
190
+ _drawReady(): void;
191
+ _drawAndLoad(animationList: string | any[]): void;
192
+ _onLayersReadyCallbackFunction(): void;
193
+ _onMapReadyCallbackFunction(): void;
194
+ _onResumeSuspendCallbackFunction(): void;
195
+ getWMSRequests(): {
196
+ url: string;
197
+ headers: Headers[];
198
+ }[];
199
+ _pdraw(): void;
200
+ _updateBoundingBox(_mapbbox: WMBBOX, triggerEvent?: boolean): void;
201
+ redrawBuffer(): void;
202
+ addBaseLayers(layer: WMLayer): void;
203
+ setBaseLayers(layer: WMLayer[]): void;
204
+ getBaseLayers(): WMLayer[];
205
+ getNumLayers(): number;
206
+ getBaseElement(): HTMLElement;
207
+ mouseWheelEvent(event: WheelEvent): void;
208
+ destroy(): void;
209
+ detachEvents(): void;
210
+ attachEvents(): void;
211
+ onContextMenu: () => boolean;
212
+ _buildLayerDims(): void;
213
+ getMapMode(): string;
214
+ getWMSGetFeatureInfoRequestURL(layer: WMLayer, x: string, y: string, format?: string): string;
215
+ setMapModeGetInfo(): void;
216
+ setMapModeZoomBoxIn(): void;
217
+ setMapModeZoomOut(): void;
218
+ setMapModePan(): void;
219
+ setMapModePoint(): void;
220
+ setMapModeNone(): void;
221
+ getMouseCoordinatesForDocument(e: MouseEvent | TouchEvent): {
222
+ x: number;
223
+ y: number;
224
+ };
225
+ setMouseCoordinates: (x: number, y: number) => void;
226
+ getMouseCoordinatesForElement(e: MouseEvent | TouchEvent): {
227
+ x: number;
228
+ y: number;
229
+ };
230
+ mouseDown(mouseCoordX: number, mouseCoordY: number, event: MouseEvent): void;
231
+ _checkInvalidMouseAction(MX: number, MY: number): -1 | 0;
232
+ updateMouseCursorCoordinates(coordinates: {
233
+ x: number;
234
+ y: number;
235
+ }): void;
236
+ mouseDownEvent(e: MouseEvent): void;
237
+ mouseMoveEvent(e: MouseEvent): void;
238
+ mouseUpEvent(e: MouseEvent): void;
239
+ mouseMove(mouseCoordX: number, mouseCoordY: number, event: MouseEvent): void;
240
+ mouseUp(mouseCoordX: number, mouseCoordY: number, e: MouseEvent): void;
241
+ _mouseDragStart(x: number, y: number): void;
242
+ mouseDrag(x: number, y: number): void;
243
+ mouseDragEnd(x: number, y: number): void;
244
+ _mapPanStart(x: number, y: number): void;
245
+ _mapPan(x: number, y: number): void;
246
+ _mapPanEnd(x: number, y: number): void;
247
+ _mapZoomStart(): void;
248
+ _mapZoom(): void;
249
+ _mapZoomEnd(): void;
250
+ setCursor(cursor?: string): void;
251
+ getId(): string;
252
+ zoomTo(_newbbox: WMBBOX): void;
253
+ pixelCoordinatesToXY(coordinates: {
254
+ x: number;
255
+ y: number;
256
+ }): {
257
+ x: number;
258
+ y: number;
259
+ };
260
+ getGeoCoordFromPixelCoord(coordinates: {
261
+ x: number;
262
+ y: number;
263
+ }, _bbox?: WMBBOX): {
264
+ x: number;
265
+ y: number;
266
+ };
267
+ getProj4(): {
268
+ lonlat: string;
269
+ crs: string;
270
+ proj4: any;
271
+ };
272
+ getPixelCoordFromLatLong(coordinates: {
273
+ x: any;
274
+ y: any;
275
+ }): {
276
+ x: any;
277
+ y: any;
278
+ };
279
+ calculateBoundingBoxAndZoom(lat: number, lng: number): void;
280
+ getLatLongFromPixelCoord(coordinates: {
281
+ x: number;
282
+ y: number;
283
+ }): {
284
+ x: number;
285
+ y: number;
286
+ };
287
+ getPixelCoordFromGeoCoord(coordinates: {
288
+ x: number;
289
+ y: number;
290
+ }, _bbox?: WMBBOX, _width?: number, _height?: number): {
291
+ x: number;
292
+ y: number;
293
+ };
294
+ addListener(name: string, f: (param?: any) => void, keep?: boolean): boolean;
295
+ removeListener(name: string, f: (param?: any) => void): void;
296
+ getListener(): WMListener;
297
+ suspendEvent(name: string): void;
298
+ resumeEvent(name: string): void;
299
+ getDimensionList(): WMJSDimension[];
300
+ getDimension(name: string): WMJSDimension;
301
+ setDimension(name: string, value: string, triggerEvent?: boolean, adjustLayerDims?: boolean): void;
302
+ zoomToLayer(_layer: WMLayer): void;
303
+ setBBOX(left: number | WMBBOX, bottom?: number, right?: number, top?: number): boolean;
304
+ zoomOut(): void;
305
+ zoomIn(ratio: number): void;
306
+ displayLegendInMap(_displayLegendInMap: boolean): void;
307
+ showBoundingBox(_bbox?: WMBBOX, _mapbbox?: WMBBOX): void;
308
+ hideBoundingBox(): void;
309
+ getDrawBBOX(): WMBBOX;
310
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const WMJSMapRadarDisplay: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import type WMJSMap from './WMJSMap';
2
+ import WMLayer from './WMLayer';
3
+ export declare const getBBOXandProjString: (map: WMJSMap, layer: WMLayer) => string;
4
+ export declare const buildWMSGetMapRequest: (map: WMJSMap, layer: WMLayer) => {
5
+ url: string;
6
+ headers: Headers[];
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,77 @@
1
+ export interface GetCapabilitiesJson {
2
+ WMS_Capabilities?: any;
3
+ WMT_MS_Capabilities?: any;
4
+ ServiceExceptionReport?: any;
5
+ }
6
+ export interface Capability {
7
+ Layer: any;
8
+ Request: any;
9
+ Exception?: any;
10
+ }
11
+ export declare const loadGetCapabilitiesViaProxy: (url: string, succes: (param: string) => void, fail: (param: string) => void, xml2jsonrequestURL: string) => void;
12
+ export declare const getWMSUrl: (service?: string, additionalParams?: {}) => string;
13
+ /**
14
+ * Global getcapabilities function
15
+ */
16
+ export declare const WMJSGetCapabilities: (service: string, succes: (param: any) => void, fail: (param: string) => void, xml2jsonrequestURL: string, options: {
17
+ headers?: any;
18
+ }, disableCache?: boolean) => void;
19
+ interface NodeObject {
20
+ text: string;
21
+ leaf: boolean;
22
+ name?: string;
23
+ path?: string;
24
+ children?: [];
25
+ }
26
+ export declare const sortByKey: (array: NodeObject[], key: string) => NodeObject[];
27
+ export declare const recursivelyFindLayer: (layers: any[], rootNode: any[], path: string) => void;
28
+ /**
29
+ * WMJSService Class
30
+ *
31
+ * options:
32
+ * service
33
+ * xml2jsonrequestURL
34
+ * title (optional)
35
+ */
36
+ export declare class WMJSService {
37
+ service: string;
38
+ title: string;
39
+ onlineresource: string;
40
+ abstract: string;
41
+ version: string;
42
+ getcapabilitiesDoc: GetCapabilitiesJson;
43
+ busy: boolean;
44
+ _flatLayerObject: any[];
45
+ xml2jsonrequestURL: string;
46
+ functionCallbackList: any[];
47
+ _options: any;
48
+ nodeCache: any;
49
+ constructor(options: {
50
+ service: string;
51
+ xml2jsonrequestURL: string;
52
+ title?: string;
53
+ });
54
+ checkVersion111(jsonData: GetCapabilitiesJson): void;
55
+ checkVersion130(jsonData: GetCapabilitiesJson): void;
56
+ getCapabilityElement(jsonData: GetCapabilitiesJson): Capability;
57
+ checkVersion(jsonData: GetCapabilitiesJson): string;
58
+ /**
59
+ * Does getcapabilities for a service.
60
+ * When multple getCapabilities for the same service are made,
61
+ * this method makes one get request and fires all callbacks with the same result.
62
+ * @param succescallback Function called upon succes, cannot be left blank
63
+ * @param failcallback Function called upon failure, cannot be left blank
64
+ */
65
+ getCapabilities(succescallback: (param: GetCapabilitiesJson) => void, failcallback: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL: string, options: unknown): void;
66
+ checkException(jsonData: GetCapabilitiesJson): string | undefined;
67
+ /**
68
+ * Calls succes with a hierarchical node structure
69
+ * Calls failure with a string when someting goes wrong
70
+ */
71
+ getNodes(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL?: string, options?: unknown): void;
72
+ /** Calls succes with an array of all layerobjects
73
+ * Calls failure when something goes wrong
74
+ */
75
+ getLayerObjectsFlat(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL?: string, options?: any): void;
76
+ }
77
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ import type WMLayer from './WMLayer';
2
+ export declare const enableConsoleDebugging = false;
3
+ export declare enum DebugType {
4
+ Log = 0,
5
+ Warning = 1,
6
+ Error = 2
7
+ }
8
+ export declare const debug: (type: DebugType, message: string, ...optionalParam: unknown[]) => void;
9
+ /**
10
+ * Checks if variable is defined or not
11
+ * @param variable The variable to check
12
+ * @returns true if variable is indeed defined, otherwise false.
13
+ */
14
+ export declare const isDefined: (variable: any) => boolean;
15
+ /**
16
+ * Checks if a variable is null or not
17
+ * @param variable The variable to check
18
+ * @returns true if variable is indeed null, otherwise false.
19
+ */
20
+ export declare const isNull: (variable: any) => boolean;
21
+ /**
22
+ * Converts a variable to an array. If the variable is not an array it will be pushed as the first entry in a new array. If the variable is already an array, nothing will be done.
23
+ * @param array The variable to convert
24
+ * @returns Always an array
25
+ */
26
+ export declare const toArray: (array: unknown | unknown[]) => any[];
27
+ /**
28
+ * Function which checks wether URL contains a ? token. If not, it is assumed that this token was not provided by the user,
29
+ * manually add the token later.
30
+ * @param url The URL to check
31
+ * @return the fixed URL
32
+ */
33
+ export declare const WMJScheckURL: (url: string) => string;
34
+ export declare const preventdefaultEvent: (e: Event) => void;
35
+ export declare const getMouseXCoordinate: (event: MouseEvent) => number;
36
+ export declare const getMouseYCoordinate: (event: MouseEvent) => number;
37
+ export declare const URLDecode: (encodedURL: string) => string;
38
+ export declare const URLEncode: (plaintext: string) => string;
39
+ export declare const getCorrectWMSDimName: (origDimName: string) => string;
40
+ export declare const getMapDimURL: (layer: WMLayer) => string;
41
+ /**
42
+ * Parses url and then it it allows for setting / changing key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
43
+ * @param baseUrl
44
+ * @param params
45
+ * @returns
46
+ */
47
+ export declare const getUriWithParam: (baseUrl: string, params: Record<string, any>) => string;
48
+ /**
49
+ * Parses url and then it it allows for setting additional key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
50
+ * @param baseUrl
51
+ * @param params
52
+ * @returns
53
+ */
54
+ export declare const getUriAddParam: (baseUrl: string, params: Record<string, any>) => string;
55
+ /**
56
+ * Converts a JS date to a ISO8601 string
57
+ * @param date
58
+ * @returns ISO8601 string
59
+ */
60
+ export declare const dateToISO8601: (date: Date) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,200 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="node" />
3
+ import type WMJSMap from './WMJSMap';
4
+ import WMJSDimension from './WMJSDimension';
5
+ import WMProjection from './WMProjection';
6
+ import WMImage from './WMImage';
7
+ import { GetCapabilitiesJson, WMJSService } from './WMJSService';
8
+ import { Style, Dimension } from './types';
9
+ export declare enum LayerType {
10
+ mapLayer = "mapLayer",
11
+ baseLayer = "baseLayer",
12
+ overLayer = "overLayer"
13
+ }
14
+ export interface LayerOptions {
15
+ id: string;
16
+ name?: string;
17
+ layerType: LayerType;
18
+ service: string;
19
+ active?: boolean;
20
+ format?: string;
21
+ getgraphinfoURL?: string;
22
+ style?: string;
23
+ currentStyle?: string;
24
+ sldURL?: string;
25
+ opacity?: number;
26
+ title?: string;
27
+ enabled?: boolean;
28
+ keepOnTop?: boolean;
29
+ transparent?: boolean;
30
+ onReady?: (param: any) => void;
31
+ type?: string;
32
+ parentMaps?: WMJSMap[];
33
+ dimensions?: Dimension[];
34
+ headers?: Headers[];
35
+ failure?: (layer: WMLayer, message: string) => void;
36
+ ReactWMJSLayerId?: string;
37
+ }
38
+ /**
39
+ * This interface is for reading from the WMS GetCapabilties document, which can have different structures for V1.1.1 and V1.3.0
40
+ */
41
+ interface WMSLayerFromGetCapabilities {
42
+ Dimension: unknown;
43
+ Style: unknown;
44
+ Extent: unknown;
45
+ }
46
+ /**
47
+ * Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilties document
48
+ * @param layerStyles The layer styles object from the WMS GetCapabilities
49
+ * @param layer The WMLayer to configure
50
+ */
51
+ export declare const addStylesForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities, layer: WMLayer) => void;
52
+ /**
53
+ * Helper function to figure out the dimensions from the WMS layer object (From WMS GetCapabilities). Parses both WMS 1.1.1 and WMS 1.3.0.
54
+ * @param layerObjectFromWMS The corresponding layer object from the WMS GetCapabilities.
55
+ * @param layer THe WMLayer to configure
56
+ * @param layerDimNamesToRemove A set of dimensions names which are flagged for removal, this function removes the dimension from the set if found in the layer.
57
+ */
58
+ export declare const addDimsForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities, layer: WMLayer, layerDimNamesToRemove: Set<string>) => void;
59
+ /**
60
+ * Helper function to configure the WMS Styles from the WMS GetCapabilities document.
61
+ * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
62
+ * @param wmLayer The WMLayer object to configure
63
+ */
64
+ export declare const configureStyles: (nestedLayerPath: WMSLayerFromGetCapabilities[], wmLayer: WMLayer) => void;
65
+ /**
66
+ * Helper function to configure the dimensions for this layer from the WMS GetCapabilities document.
67
+ * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
68
+ * @param wmLayer The WMLayer object to configure
69
+ */
70
+ export declare const configureDimensions: (nestedLayerPath: WMSLayerFromGetCapabilities[], wmLayer: WMLayer) => void;
71
+ export default class WMLayer {
72
+ id: string;
73
+ name?: string;
74
+ ReactWMJSLayerId?: string;
75
+ reactWebMapJSLayer?: React.ReactElement;
76
+ hasError?: boolean;
77
+ enabled?: boolean;
78
+ lastError?: string;
79
+ legendGraphic?: string;
80
+ title?: string;
81
+ opacity?: number;
82
+ service: string;
83
+ layerType: LayerType;
84
+ currentStyle?: string;
85
+ image?: WMImage;
86
+ linkedInfo: {
87
+ layer: string;
88
+ message: string;
89
+ };
90
+ headers: Headers[];
91
+ autoupdate: boolean;
92
+ timer: NodeJS.Timeout;
93
+ WMJSService: WMJSService;
94
+ getmapURL: string;
95
+ getfeatureinfoURL: string;
96
+ getlegendgraphicURL: string;
97
+ keepOnTop: boolean;
98
+ transparent: boolean;
99
+ legendIsDimensionDependent: boolean;
100
+ wms130bboxcompatibilitymode: boolean;
101
+ version: string;
102
+ path: string;
103
+ type: string;
104
+ abstract: string;
105
+ dimensions: WMJSDimension[];
106
+ projectionProperties: WMProjection[];
107
+ queryable: boolean;
108
+ styles: Style[];
109
+ getCapabilitiesDoc: GetCapabilitiesJson;
110
+ serviceTitle: string;
111
+ parentMaps: WMJSMap[];
112
+ sldURL: string;
113
+ active: boolean;
114
+ getgraphinfoURL: string;
115
+ format: string;
116
+ _options: LayerOptions;
117
+ onReady: (param: any) => void;
118
+ optimalFormat: string;
119
+ wmsextensions: {
120
+ url: string;
121
+ colorscalerange: Record<string, unknown>[];
122
+ };
123
+ jsonlayer: this;
124
+ isConfigured: boolean;
125
+ init(): void;
126
+ constructor(options?: LayerOptions);
127
+ getLayerName(): string;
128
+ toggleAutoUpdate(): void;
129
+ setAutoUpdate(val: boolean, interval?: number, callback?: () => void): void;
130
+ setOpacity(opacityValue: string): void;
131
+ getOpacity(): number;
132
+ remove(): void;
133
+ moveUp(): void;
134
+ moveDown(): void;
135
+ zoomToLayer(): void;
136
+ draw(e: string): void;
137
+ handleReferenceTime(name: string, value: string, updateMapDimensions?: boolean): void;
138
+ getDimensions(): WMJSDimension[];
139
+ setDimension(name: string, value: string, updateMapDimensions?: boolean): void;
140
+ __parseGetCapForLayer(layer: WMLayer, getcapabilitiesjson: GetCapabilitiesJson, layerDoneCallback: (layer: WMLayer) => void, fail: (layer: WMLayer, message: string) => void): void;
141
+ /**
142
+ * Calls success with a configured layer object
143
+ * Calls options.failure with error message.
144
+ * Throws string exceptions when someting goes wrong
145
+ */
146
+ parseLayer(_layerDoneCallback: (layer: WMLayer) => void, forceReload: boolean, xml2jsonrequest?: string): void;
147
+ /**
148
+ * A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
149
+ * @param forceReload Do not use the cache of the WMS GetCapabilties document, but instead fetch new data from the server
150
+ * @returns WMLayer object
151
+ */
152
+ parseLayerPromise(forceReload?: boolean): Promise<WMLayer>;
153
+ cloneLayer(): WMLayer;
154
+ /**
155
+ * Set or change the name of this layer. This involves re-parsing the WMS GetCapabilities document and updating the affected layer properties. When done, it resolves the WMLayer
156
+ * @param name The name of the layer
157
+ * @returns Promise resolving to a WMLayer object
158
+ */
159
+ setName(name: string): Promise<WMLayer>;
160
+ getLayerRelative(success: (layer: WMLayer, index: number, length: number) => void, failure: (param: string) => void, prevNext: number): void;
161
+ autoSelectLayer(success: (layer: WMLayer) => void, failure: (param: string) => void): void;
162
+ getNextLayer(success: (layer: WMLayer, index: number, length: number) => void, failure: (param: string) => void): void;
163
+ getPreviousLayer(success: (layer: WMLayer, index: number, length: number) => void, failure: (param: string) => void): void;
164
+ /**
165
+ * Sets the style by its name
166
+ * @param style: The name of the style (not the object)
167
+ */
168
+ setStyle(styleName: string): void;
169
+ getStyles(): Style[];
170
+ /**
171
+ * Get the styleobject by name
172
+ * @param styleName The name of the style
173
+ * @param nextPrev, can be -1 or +1 to get the next or previous style object in circular manner.
174
+ */
175
+ getStyleObject(styleName: string, nextPrev: number): Style;
176
+ getStyle(): string;
177
+ getDimension(name: string): WMJSDimension;
178
+ /**
179
+ * Returns the Coordinate Reference Systems for this layer
180
+ * @returns List of WMProjection objects
181
+ */
182
+ getCRS(): WMProjection[];
183
+ /**
184
+ * Get Coordinate reference system by name
185
+ *
186
+ * @param srsName Name of the coordinate reference system to get
187
+ * @returns A WMProjection object if found, otherwise undefined.
188
+ */
189
+ getCRSByName(srsName: string): WMProjection;
190
+ /**
191
+ * Get Coordinate reference system by name. Note 2021-05-17: It is more inline with other function names to use the getCRSByName function instead.
192
+ *
193
+ * @param srsName Name of the coordinate reference system to get
194
+ * @returns A WMProjection object if found, otherwise undefined.
195
+ */
196
+ getProjection(srsName: string): WMProjection;
197
+ setSLDURL(url: string): void;
198
+ display(displayornot: boolean): void;
199
+ }
200
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import WMImageStore from './WMImageStore';
2
+ import WMLayer from './WMLayer';
3
+ export declare const legendImageStore: WMImageStore;
4
+ export declare const getLegendGraphicURLForLayer: (layer: WMLayer, width?: number, height?: number) => string;
5
+ export declare const getLegendImageStore: () => WMImageStore;
6
+ export declare const drawLegend: (canvasContext: CanvasRenderingContext2D, width: number, height: number, layers: WMLayer[]) => void;
@@ -0,0 +1 @@
1
+ export {};