@opengeoweb/webmap 9.21.0 → 9.22.0
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.
- package/index.esm.js +12659 -12899
- package/package.json +1 -1
- package/src/lib/components/IWMJSMap.d.ts +315 -0
- package/src/lib/components/WMBBOX.d.ts +2 -2
- package/src/lib/components/WMCanvasBuffer.d.ts +2 -2
- package/src/lib/components/WMCanvasDrawFunctions.d.ts +11 -0
- package/src/lib/components/WMConstants.d.ts +3 -0
- package/src/lib/components/WMJSMap.d.ts +123 -244
- package/src/lib/components/WMJSMapHelpers.d.ts +53 -4
- package/src/lib/components/WMLayer.d.ts +5 -7
- package/src/lib/components/WMMapPin.d.ts +4 -4
- package/src/lib/components/WMPrefetch.d.ts +4 -4
- package/src/lib/components/WMProjection.d.ts +7 -1
- package/src/lib/components/index.d.ts +7 -2
- package/src/lib/components/types.d.ts +13 -2
- package/src/lib/utils/utils.d.ts +5 -5
|
@@ -1,89 +1,47 @@
|
|
|
1
1
|
import WMImageStore from './WMImageStore';
|
|
2
|
-
import WMBBOX from './WMBBOX';
|
|
2
|
+
import WMBBOX, { Bbox } from './WMBBOX';
|
|
3
|
+
import { WMProjectionWH } from './WMProjection';
|
|
3
4
|
import WMListener from './WMListener';
|
|
4
5
|
import { CanvasBBOX, CanvasGeoLayer } from './WMCanvasBuffer';
|
|
5
|
-
import { proj4 } from './WMJSExternalDependencies';
|
|
6
6
|
import WMJSDimension from './WMJSDimension';
|
|
7
7
|
import MapPin from './WMMapPin';
|
|
8
8
|
import WMLayer from './WMLayer';
|
|
9
|
-
import { AnimationStep,
|
|
9
|
+
import { AnimationStep, IWMProj4, IWMJSMapMouseCoordinates } from './types';
|
|
10
10
|
import { WMMemo } from './WMMemo';
|
|
11
11
|
import type { TileServerDefinition, TileServerSettings } from '../utils';
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
|
|
12
|
+
import type IWMJSMap from './IWMJSMap';
|
|
13
|
+
export declare const bgMapImageStore: WMImageStore;
|
|
15
14
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
mouseHoverAnimationBox: boolean;
|
|
36
|
-
loadingDiv: HTMLElement;
|
|
37
|
-
baseDiv: HTMLElement;
|
|
38
|
-
mapZooming: 0 | 1;
|
|
39
|
-
mouseX: number;
|
|
40
|
-
mouseDownX: number;
|
|
41
|
-
mouseY: number;
|
|
42
|
-
mouseDownY: number;
|
|
43
|
-
private WebMapJSMapVersion;
|
|
44
|
-
private mainElement;
|
|
45
|
-
private srs;
|
|
46
|
-
private resizeBBOX;
|
|
47
|
-
private defaultBBOX;
|
|
48
|
-
private width;
|
|
49
|
-
private height;
|
|
50
|
-
private layers;
|
|
51
|
-
private baseLayers;
|
|
52
|
-
private numBaseLayers;
|
|
53
|
-
private _map?;
|
|
54
|
-
private renderer?;
|
|
55
|
-
private layersBusy?;
|
|
56
|
-
private mapBusy?;
|
|
57
|
-
private hasGeneratedId?;
|
|
58
|
-
private divZoomBox;
|
|
59
|
-
private divBoundingBox;
|
|
60
|
-
private divDimInfo;
|
|
15
|
+
* WMJSMap class
|
|
16
|
+
*/
|
|
17
|
+
export default class WMJSMap implements IWMJSMap {
|
|
18
|
+
private _mouseX;
|
|
19
|
+
private _mouseDownX;
|
|
20
|
+
private _mouseY;
|
|
21
|
+
private _mouseDownY;
|
|
22
|
+
private _enableAutoPrefetching;
|
|
23
|
+
private _WebMapJSMapVersion;
|
|
24
|
+
private _mainElement;
|
|
25
|
+
private _srs;
|
|
26
|
+
private _width;
|
|
27
|
+
private _height;
|
|
28
|
+
private _layers;
|
|
29
|
+
private _baseLayers;
|
|
30
|
+
private _numBaseLayers;
|
|
31
|
+
private _divZoomBox;
|
|
32
|
+
private _divBoundingBox;
|
|
33
|
+
private _divDimInfo;
|
|
61
34
|
private _displayLegendInMap;
|
|
62
|
-
private
|
|
63
|
-
|
|
64
|
-
private
|
|
65
|
-
|
|
35
|
+
private _mapHeader;
|
|
36
|
+
private _currentCursor;
|
|
37
|
+
private _mapIsActivated;
|
|
38
|
+
private _isMapHeaderEnabled;
|
|
39
|
+
private _showScaleBarInMap;
|
|
40
|
+
private _showCursorCoordinates;
|
|
41
|
+
private _wmEventListener;
|
|
66
42
|
private canvasLayerBuffer;
|
|
67
|
-
private mapHeader;
|
|
68
|
-
private currentCursor;
|
|
69
|
-
private mapIsActivated;
|
|
70
|
-
private isMapHeaderEnabled;
|
|
71
|
-
private showScaleBarInMap;
|
|
72
|
-
private showCursorCoordinates;
|
|
73
|
-
private callBack;
|
|
74
|
-
initialized: boolean;
|
|
75
|
-
isDestroyed: boolean;
|
|
76
43
|
private internalMapId;
|
|
77
|
-
private suspendDrawing;
|
|
78
44
|
private activeLayer;
|
|
79
|
-
private MaxUndos;
|
|
80
|
-
private NrOfUndos;
|
|
81
|
-
private UndoPointer;
|
|
82
|
-
private DoUndo;
|
|
83
|
-
private DoRedo;
|
|
84
|
-
private WMProjectionUndo;
|
|
85
|
-
private WMProjectionTempUndo;
|
|
86
|
-
private gfiDialogList;
|
|
87
45
|
private setTimeOffsetValue;
|
|
88
46
|
private setMessageValue;
|
|
89
47
|
private canvasErrors;
|
|
@@ -93,74 +51,118 @@ export default class WMJSMap {
|
|
|
93
51
|
private wmTileRenderer;
|
|
94
52
|
private mouseWheelBusy;
|
|
95
53
|
private wMFlyToBBox;
|
|
96
|
-
private
|
|
97
|
-
private
|
|
54
|
+
private _mouseWheelEventBBOXCurrent;
|
|
55
|
+
private _mouseWheelEventBBOXNew;
|
|
98
56
|
private mouseUpX;
|
|
99
57
|
private mouseUpY;
|
|
100
58
|
private mouseDragging;
|
|
101
|
-
private controlsBusy;
|
|
102
59
|
private mouseDownPressed;
|
|
103
60
|
private mapMode;
|
|
104
|
-
private numGetFeatureInfoRequests;
|
|
105
61
|
private oldMapMode;
|
|
106
|
-
private InValidMouseAction;
|
|
107
62
|
private resizingBBOXCursor;
|
|
108
63
|
private resizingBBOXEnabled;
|
|
109
64
|
private mouseGeoCoordXY;
|
|
110
65
|
private mouseUpdateCoordinates;
|
|
111
66
|
private mapPanning;
|
|
112
67
|
private mapPanStartGeoCoords;
|
|
113
|
-
private proj4;
|
|
114
68
|
private previousMouseButtonState;
|
|
115
|
-
private longlat;
|
|
116
69
|
private tileRenderSettings;
|
|
117
|
-
private drawPending?;
|
|
118
70
|
private needsRedraw;
|
|
119
|
-
private
|
|
120
|
-
|
|
71
|
+
private _pixelCoordinatesToXY;
|
|
72
|
+
private _makeComponentId;
|
|
73
|
+
private _adagucBeforeDraw;
|
|
74
|
+
private _adagucBeforeCanvasDisplay;
|
|
75
|
+
private _init;
|
|
76
|
+
private _rebuildMapDimensions;
|
|
77
|
+
private _checkInvalidMouseAction;
|
|
78
|
+
private _updateMouseCursorCoordinates;
|
|
79
|
+
private _setActive;
|
|
80
|
+
private _setActiveLayer;
|
|
81
|
+
private _calculateNumBaseLayers;
|
|
82
|
+
private _setSize;
|
|
83
|
+
private _abort;
|
|
84
|
+
private _makeInfoHTML;
|
|
85
|
+
private _draw;
|
|
86
|
+
private _drawReady;
|
|
87
|
+
private _drawAndLoad;
|
|
88
|
+
private _mouseDragStart;
|
|
89
|
+
private _mouseDrag;
|
|
90
|
+
private _mouseDragEnd;
|
|
91
|
+
private _mapPan;
|
|
92
|
+
private _mapPanPercentageEnd;
|
|
93
|
+
private _mapZoomStart;
|
|
94
|
+
private _showBoundingBox;
|
|
95
|
+
private _hideBoundingBox;
|
|
96
|
+
private _animFrameRedraw;
|
|
97
|
+
constructor(_element: HTMLElement);
|
|
98
|
+
_resizeBBOX: WMBBOX;
|
|
99
|
+
_defaultBBOX: WMBBOX;
|
|
100
|
+
_bbox: WMBBOX;
|
|
101
|
+
_updateBBOX: WMBBOX;
|
|
102
|
+
_drawnBBOX: WMBBOX;
|
|
103
|
+
_loadingDiv: HTMLElement;
|
|
104
|
+
_baseDiv: HTMLElement;
|
|
105
|
+
_mapZooming: 0 | 1;
|
|
106
|
+
_initialized: boolean;
|
|
107
|
+
_animationList: AnimationStep[] | string | undefined;
|
|
108
|
+
getLayerByServiceAndName(layerService: string, layerName: string): WMLayer;
|
|
109
|
+
redrawBuffer(): void;
|
|
110
|
+
addLayersToCanvasAndDisplayThem(): void;
|
|
111
|
+
_mouseDownEvent(e: MouseEvent): void;
|
|
112
|
+
_mouseMoveEvent(e: MouseEvent): void;
|
|
113
|
+
_mouseUpEvent(e: MouseEvent): void;
|
|
114
|
+
_display(): void;
|
|
115
|
+
_updateBoundingBox(_mapbbox: WMBBOX, triggerEvent?: boolean): void;
|
|
116
|
+
_mouseWheelEvent(event: WheelEvent): void;
|
|
117
|
+
_detachEvents(): void;
|
|
118
|
+
_attachEvents(): void;
|
|
119
|
+
_onContextMenu: () => boolean;
|
|
120
|
+
_mapPanStart(x: number, y: number): void;
|
|
121
|
+
_mapPanEnd(x: number, y: number): void;
|
|
122
|
+
_mapZoom(): void;
|
|
123
|
+
_mapZoomEnd(): void;
|
|
124
|
+
_getMouseCoordinatesForDocument(e: MouseEvent | TouchEvent): {
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
};
|
|
128
|
+
_setMouseCoordinates: (x: number, y: number) => void;
|
|
129
|
+
_getMouseCoordsForElement(e: MouseEvent | TouchEvent): {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
};
|
|
133
|
+
prefetchLayerImagesForTimeMemo: WMMemo;
|
|
134
|
+
shouldPrefetch: boolean;
|
|
135
|
+
mapPin: MapPin;
|
|
136
|
+
mapdimensions: WMJSDimension[];
|
|
137
|
+
timestepInMinutes: number | undefined;
|
|
138
|
+
showLayerInfo: boolean;
|
|
139
|
+
stopAnimating: () => void;
|
|
140
|
+
isAnimating: boolean;
|
|
141
|
+
animationList: AnimationStep[] | string | undefined;
|
|
142
|
+
animationDelay: number;
|
|
143
|
+
currentAnimationStep: number;
|
|
144
|
+
initialAnimationStep: number;
|
|
145
|
+
setAnimationDelay: (delay: number) => void;
|
|
146
|
+
isDestroyed: boolean;
|
|
121
147
|
getMapImageStore: WMImageStore;
|
|
122
148
|
holdShiftToScroll: boolean;
|
|
123
|
-
|
|
149
|
+
getMapMouseCoordinates(): IWMJSMapMouseCoordinates;
|
|
124
150
|
setWMTileRendererTileSettings(tileRenderSettings: TileServerSettings): void;
|
|
125
151
|
addWMTileRendererTileSetting(tileRenderSetting: TileServerDefinition): void;
|
|
126
|
-
/**
|
|
127
|
-
* Function which make a component ID which is unique over several WebMapJS instances
|
|
128
|
-
* @param the desired id
|
|
129
|
-
* @return the unique id
|
|
130
|
-
*/
|
|
131
|
-
makeComponentId(id: string): string;
|
|
132
152
|
setMessage(message: string): void;
|
|
133
153
|
setTimeOffset(message: string): void;
|
|
134
|
-
|
|
135
|
-
_adagucBeforeCanvasDisplay(ctx: CanvasRenderingContext2D): void;
|
|
136
|
-
init(): void;
|
|
137
|
-
rebuildMapDimensions(): void;
|
|
138
|
-
getLayerByServiceAndName(layerService: string, layerName: string): WMLayer;
|
|
139
|
-
getLayers(): WMLayer[];
|
|
154
|
+
getLayers(reverseOrder?: boolean): WMLayer[];
|
|
140
155
|
hasLayer(layer: WMLayer): boolean;
|
|
141
|
-
setLayer(layer: WMLayer): Promise<
|
|
142
|
-
setActive(active: boolean): void;
|
|
143
|
-
setActiveLayer(layer: WMLayer): void;
|
|
144
|
-
calculateNumBaseLayers(): void;
|
|
145
|
-
enableLayer(layer: WMLayer): void;
|
|
146
|
-
disableLayer(layer: WMLayer): void;
|
|
147
|
-
toggleLayer(layer: WMLayer): void;
|
|
156
|
+
setLayer(layer: WMLayer): Promise<IWMJSMap>;
|
|
148
157
|
displayLayer(layer: WMLayer, enabled: boolean): void;
|
|
149
|
-
_getLayerIndex(layer: WMLayer): number;
|
|
150
158
|
removeAllLayers(): void;
|
|
151
159
|
deleteLayer(layerToDelete: WMLayer): void;
|
|
152
|
-
moveLayerDown(layerToMove: WMLayer): void;
|
|
153
160
|
/**
|
|
154
161
|
* Reorder layers according to an index array with indices on how the layers should be reordered.
|
|
155
162
|
*/
|
|
156
163
|
reorderLayers(order: number[]): boolean;
|
|
157
|
-
swapLayers(_layerA: WMLayer, _layerB: WMLayer): void;
|
|
158
|
-
moveLayerUp(layerToMove: WMLayer): void;
|
|
159
164
|
configureMapDimensions(layer: WMLayer): void;
|
|
160
|
-
|
|
161
|
-
* @param layer of type WMLayer
|
|
162
|
-
*/
|
|
163
|
-
addLayer(layer: WMLayer): Promise<WMJSMap>;
|
|
165
|
+
addLayer(layer: WMLayer): Promise<IWMJSMap>;
|
|
164
166
|
getActiveLayer(): WMLayer;
|
|
165
167
|
/**
|
|
166
168
|
* setProjection
|
|
@@ -169,151 +171,36 @@ export default class WMJSMap {
|
|
|
169
171
|
*/
|
|
170
172
|
setProjection(_srs: string | {
|
|
171
173
|
srs: string;
|
|
172
|
-
bbox:
|
|
173
|
-
}, _bbox?:
|
|
174
|
+
bbox: Bbox;
|
|
175
|
+
}, _bbox?: Bbox): void;
|
|
176
|
+
getDrawBBOX(): WMBBOX;
|
|
174
177
|
getBBOX(): WMBBOX;
|
|
175
|
-
getProjection():
|
|
176
|
-
srs: string;
|
|
177
|
-
bbox: WMBBOX;
|
|
178
|
-
};
|
|
178
|
+
getProjection(): WMProjectionWH;
|
|
179
179
|
getSize(): {
|
|
180
180
|
width: number;
|
|
181
181
|
height: number;
|
|
182
182
|
};
|
|
183
|
-
getWidth(): number;
|
|
184
|
-
getHeight(): number;
|
|
185
183
|
getMapPin(): MapPin;
|
|
186
|
-
|
|
184
|
+
private _repositionLegendGraphic;
|
|
187
185
|
setSize(w: number, h: number): void;
|
|
188
|
-
_setSize(w: number, h: number): void;
|
|
189
|
-
abort(): void;
|
|
190
|
-
_makeInfoHTML(): void;
|
|
191
|
-
showScaleBar(): void;
|
|
192
|
-
hideScaleBar(): void;
|
|
193
|
-
showMouseCursorProperties(): void;
|
|
194
186
|
hideMouseCursorProperties(): void;
|
|
195
187
|
displayScaleBarInMap(display: boolean): void;
|
|
196
|
-
display(): void;
|
|
197
|
-
_animFrameRedraw(): void;
|
|
198
188
|
draw(animationList?: AnimationStep[] | string | undefined): void;
|
|
199
|
-
/**
|
|
200
|
-
* API Function called to draw the layers, fires getmap request and shows the layers on the screen
|
|
201
|
-
*/
|
|
202
|
-
_draw(animationList: AnimationStep[] | string | undefined): void;
|
|
203
|
-
_drawReady(): void;
|
|
204
|
-
_drawAndLoad(inputAnimationList: AnimationStep[] | string | undefined): void;
|
|
205
|
-
_onLayersReadyCallbackFunction(): void;
|
|
206
|
-
_onMapReadyCallbackFunction(): void;
|
|
207
|
-
_onResumeSuspendCallbackFunction(): void;
|
|
208
|
-
getWMSRequests(dimensionOverride?: Dimension[]): {
|
|
209
|
-
url: string;
|
|
210
|
-
headers: Headers[];
|
|
211
|
-
}[];
|
|
212
189
|
getAlternativeImage(imageUrl: string, bbox: CanvasBBOX, filterBad?: boolean): CanvasGeoLayer[];
|
|
213
|
-
addLayersToCanvasAndDisplayThem(): void;
|
|
214
|
-
_updateBoundingBox(_mapbbox: WMBBOX, triggerEvent?: boolean): void;
|
|
215
|
-
redrawBuffer(): void;
|
|
216
|
-
addBaseLayers(layer: WMLayer): void;
|
|
217
190
|
setBaseLayers(layer: WMLayer[]): void;
|
|
218
191
|
getBaseLayers(): WMLayer[];
|
|
219
192
|
getNumLayers(): number;
|
|
220
193
|
getBaseElement(): HTMLElement;
|
|
221
|
-
mouseWheelEvent(event: WheelEvent): void;
|
|
222
194
|
destroy(): void;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
onContextMenu: () => boolean;
|
|
226
|
-
_buildLayerDims(): void;
|
|
227
|
-
getMapMode(): string;
|
|
228
|
-
getWMSGetFeatureInfoRequestURL(layer: WMLayer, x: number, y: number, format?: string): string;
|
|
229
|
-
setMapModeGetInfo(): void;
|
|
230
|
-
setMapModeZoomBoxIn(): void;
|
|
231
|
-
setMapModeZoomOut(): void;
|
|
232
|
-
setMapModePan(): void;
|
|
233
|
-
setMapModePoint(): void;
|
|
234
|
-
setMapModeNone(): void;
|
|
235
|
-
getMouseCoordinatesForDocument(e: MouseEvent | TouchEvent): {
|
|
236
|
-
x: number;
|
|
237
|
-
y: number;
|
|
238
|
-
};
|
|
239
|
-
setMouseCoordinates: (x: number, y: number) => void;
|
|
240
|
-
getMouseCoordinatesForElement(e: MouseEvent | TouchEvent): {
|
|
241
|
-
x: number;
|
|
242
|
-
y: number;
|
|
243
|
-
};
|
|
244
|
-
mouseDown(mouseCoordX: number, mouseCoordY: number, event: MouseEvent): void;
|
|
245
|
-
_checkInvalidMouseAction(MX: number, MY: number): -1 | 0;
|
|
246
|
-
updateMouseCursorCoordinates(coordinates: {
|
|
247
|
-
x: number;
|
|
248
|
-
y: number;
|
|
249
|
-
}): void;
|
|
250
|
-
mouseDownEvent(e: MouseEvent): void;
|
|
251
|
-
mouseMoveEvent(e: MouseEvent): void;
|
|
252
|
-
mouseUpEvent(e: MouseEvent): void;
|
|
253
|
-
mouseMove(mouseCoordX: number, mouseCoordY: number, event: MouseEvent): void;
|
|
195
|
+
mouseDown(mouseCoordX: number, mouseCoordY: number, event?: MouseEvent): void;
|
|
196
|
+
mouseMove(mouseCoordX: number, mouseCoordY: number, event?: MouseEvent): void;
|
|
254
197
|
mouseUp(mouseCoordX: number, mouseCoordY: number, e: MouseEvent): void;
|
|
255
|
-
_mouseDragStart(x: number, y: number): void;
|
|
256
|
-
mouseDrag(x: number, y: number): void;
|
|
257
|
-
mouseDragEnd(x: number, y: number): void;
|
|
258
|
-
_mapPanStart(x: number, y: number): void;
|
|
259
|
-
_mapPan(x: number, y: number): void;
|
|
260
|
-
_mapPanEnd(x: number, y: number): void;
|
|
261
198
|
mapPanPercentage(percentageDiffX: number, percentageDiffY: number): void;
|
|
262
|
-
_mapPanPercentageEnd(): void;
|
|
263
|
-
_mapZoomStart(): void;
|
|
264
|
-
_mapZoom(): void;
|
|
265
|
-
_mapZoomEnd(): void;
|
|
266
199
|
setCursor(cursor?: string): void;
|
|
267
200
|
getId(): string;
|
|
268
|
-
zoomTo(_newbbox:
|
|
269
|
-
|
|
270
|
-
x: number;
|
|
271
|
-
y: number;
|
|
272
|
-
}): {
|
|
273
|
-
x: number;
|
|
274
|
-
y: number;
|
|
275
|
-
};
|
|
276
|
-
getGeoCoordFromPixelCoord(coordinates: {
|
|
277
|
-
x: number;
|
|
278
|
-
y: number;
|
|
279
|
-
}, _bbox?: WMBBOX): {
|
|
280
|
-
x: number;
|
|
281
|
-
y: number;
|
|
282
|
-
};
|
|
283
|
-
getProj4(): {
|
|
284
|
-
lonlat: string;
|
|
285
|
-
crs: string;
|
|
286
|
-
proj4: typeof proj4;
|
|
287
|
-
};
|
|
288
|
-
getPixelCoordFromLatLong(coordinates: {
|
|
289
|
-
x: number;
|
|
290
|
-
y: number;
|
|
291
|
-
}): {
|
|
292
|
-
x: number;
|
|
293
|
-
y: number;
|
|
294
|
-
};
|
|
295
|
-
getGeoCoordFromLatLong(coordinates: {
|
|
296
|
-
x: number;
|
|
297
|
-
y: number;
|
|
298
|
-
}): {
|
|
299
|
-
x: number;
|
|
300
|
-
y: number;
|
|
301
|
-
};
|
|
201
|
+
zoomTo(_newbbox: Bbox): void;
|
|
202
|
+
getProj4(): IWMProj4;
|
|
302
203
|
calculateBoundingBoxAndZoom(lat: number, lng: number): void;
|
|
303
|
-
getLatLongFromPixelCoord(coordinates: {
|
|
304
|
-
x: number;
|
|
305
|
-
y: number;
|
|
306
|
-
}): {
|
|
307
|
-
x: number;
|
|
308
|
-
y: number;
|
|
309
|
-
};
|
|
310
|
-
getPixelCoordFromGeoCoord(coordinates: {
|
|
311
|
-
x: number;
|
|
312
|
-
y: number;
|
|
313
|
-
}, _bbox?: WMBBOX, _width?: number, _height?: number): {
|
|
314
|
-
x: number;
|
|
315
|
-
y: number;
|
|
316
|
-
};
|
|
317
204
|
addListener(name: string, f: (param?: any) => void, keep?: boolean): boolean;
|
|
318
205
|
removeListener(name: string, f: (param?: any) => void): void;
|
|
319
206
|
getListener(): WMListener;
|
|
@@ -321,21 +208,13 @@ export default class WMJSMap {
|
|
|
321
208
|
resumeEvent(name: string): void;
|
|
322
209
|
getDimensionList(): WMJSDimension[];
|
|
323
210
|
getDimension(name: string): WMJSDimension;
|
|
324
|
-
setTimeDimension(value: string, triggerEvent: boolean): void;
|
|
325
211
|
setDimension(name: string, value: string, triggerEvent?: boolean, adjustLayerDims?: boolean): void;
|
|
326
212
|
zoomToLayer(_layer: WMLayer): void;
|
|
327
213
|
setDefaultBBOX(bbox: WMBBOX): void;
|
|
328
|
-
setBBOX(left: number |
|
|
329
|
-
/**
|
|
330
|
-
*
|
|
331
|
-
* @param ratio 1.0, meanse zoomout using full boundingbox width, 0.1 means zoom out 10% of full boundingbox width
|
|
332
|
-
*/
|
|
214
|
+
setBBOX(left: number | Bbox, bottom?: number, right?: number, top?: number): boolean;
|
|
333
215
|
zoomOut(ratio?: number): void;
|
|
334
216
|
zoomIn(ratio: number): void;
|
|
335
217
|
displayLegendInMap(_displayLegendInMap: boolean): void;
|
|
336
|
-
showBoundingBox(_bbox?: WMBBOX, _mapbbox?: WMBBOX): void;
|
|
337
|
-
hideBoundingBox(): void;
|
|
338
|
-
getDrawBBOX(): WMBBOX;
|
|
339
218
|
getImageStore(): WMImageStore;
|
|
340
219
|
clearImageCache(): void;
|
|
341
220
|
}
|
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
import type WMJSMap from './WMJSMap';
|
|
2
1
|
import type WMLayer from './WMLayer';
|
|
3
|
-
import type { Dimension } from './types';
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { Dimension, LinkedInfo, WMPosition } from './types';
|
|
3
|
+
import type IWMJSMap from './IWMJSMap';
|
|
4
|
+
import { WMProjectionWH } from './WMProjection';
|
|
5
|
+
import { Bbox } from './WMBBOX';
|
|
6
|
+
export declare const getBBOXandProjString: (layer: WMLayer, projection: WMProjectionWH) => string;
|
|
7
|
+
export declare const buildWMSGetMapRequest: (layer: WMLayer, projection: WMProjectionWH, dimensionOverride?: Dimension[]) => {
|
|
6
8
|
url: string;
|
|
7
9
|
headers: Headers[];
|
|
8
10
|
} | undefined;
|
|
9
11
|
export declare const isProjectionSupported: (srs: string, proj4Defintions?: string[][]) => boolean;
|
|
12
|
+
export declare const getWMSRequests: (map: IWMJSMap, dimensionOverride?: Dimension[]) => {
|
|
13
|
+
url: string;
|
|
14
|
+
headers: Headers[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const getLayerIndex: (layer: WMLayer, layers: WMLayer[]) => number;
|
|
17
|
+
export declare const buildMapLayerDims: (map: IWMJSMap) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Makes a valid getfeatureinfoURL for each layer
|
|
20
|
+
* @param layer
|
|
21
|
+
* @param x
|
|
22
|
+
* @param y
|
|
23
|
+
* @param format
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const getWMSGetFeatureInfoRequestURL: (layer: WMLayer, x: number, y: number, format?: string) => string;
|
|
27
|
+
export declare const getGeoCoordFromPixelCoord: (coordinates: WMPosition, bbox: Bbox, width: number, height: number) => WMPosition;
|
|
28
|
+
export declare const getPixelCoordFromLatLong: (map: IWMJSMap, coordinates: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}) => {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const getGeoCoordFromLatLong: (map: IWMJSMap, coordinates: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}) => {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
export declare const getLatLongFromPixelCoord: (map: IWMJSMap, coordinates: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}) => {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
49
|
+
export declare const getPixelCoordFromGeoCoord: (map: IWMJSMap, coordinates: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}, _bbox?: Bbox, _width?: number, _height?: number) => {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
};
|
|
56
|
+
export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
|
|
57
|
+
export declare const detectLeftButton: (evt?: MouseEvent) => boolean;
|
|
58
|
+
export declare const detectRightButton: (evt?: MouseEvent) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { FeatureCollection } from 'geojson';
|
|
3
|
-
import type
|
|
3
|
+
import type IWMJSMap from './IWMJSMap';
|
|
4
4
|
import WMJSDimension from './WMJSDimension';
|
|
5
5
|
import WMProjection from './WMProjection';
|
|
6
6
|
import { GetCapabilitiesJson } from './WMJSService';
|
|
@@ -41,12 +41,12 @@ export interface LayerOptions extends LayerFoundation {
|
|
|
41
41
|
keepOnTop?: boolean;
|
|
42
42
|
transparent?: boolean;
|
|
43
43
|
onReady?: (param: LayerOptions) => void;
|
|
44
|
-
parentMap?:
|
|
44
|
+
parentMap?: IWMJSMap;
|
|
45
45
|
headers?: Headers[];
|
|
46
46
|
failure?: (layer: WMLayer, message: string) => void;
|
|
47
47
|
ReactWMJSLayerId?: string;
|
|
48
|
-
onLayerError?: (layer: WMLayer, error: Error, webmapInstance:
|
|
49
|
-
onLayerReady?: (layer: WMLayer, webmap?:
|
|
48
|
+
onLayerError?: (layer: WMLayer, error: Error, webmapInstance: IWMJSMap) => void;
|
|
49
|
+
onLayerReady?: (layer: WMLayer, webmap?: IWMJSMap) => void;
|
|
50
50
|
geojson?: GeoJSON.FeatureCollection;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
@@ -105,7 +105,7 @@ export default class WMLayer {
|
|
|
105
105
|
queryable: boolean;
|
|
106
106
|
styles: Style[];
|
|
107
107
|
serviceTitle: string;
|
|
108
|
-
parentMap:
|
|
108
|
+
parentMap: IWMJSMap;
|
|
109
109
|
sldURL: string;
|
|
110
110
|
active: boolean;
|
|
111
111
|
getgraphinfoURL: string;
|
|
@@ -129,8 +129,6 @@ export default class WMLayer {
|
|
|
129
129
|
setOpacity(opacityValue: number): void;
|
|
130
130
|
getOpacity(): number;
|
|
131
131
|
remove(): void;
|
|
132
|
-
moveUp(): void;
|
|
133
|
-
moveDown(): void;
|
|
134
132
|
zoomToLayer(): void;
|
|
135
133
|
draw(e: string): void;
|
|
136
134
|
handleReferenceTime(name: string, value: string, updateMapDimensions?: boolean): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import WMBBOX from './WMBBOX';
|
|
2
|
-
import type
|
|
1
|
+
import WMBBOX, { Bbox } from './WMBBOX';
|
|
2
|
+
import type IWMJSMap from './IWMJSMap';
|
|
3
3
|
declare class MapPin {
|
|
4
4
|
private _map;
|
|
5
5
|
private x;
|
|
@@ -10,11 +10,11 @@ declare class MapPin {
|
|
|
10
10
|
private geoPosY;
|
|
11
11
|
displayMapPin: boolean;
|
|
12
12
|
disableMapPin: boolean;
|
|
13
|
-
constructor(_map:
|
|
13
|
+
constructor(_map: IWMJSMap);
|
|
14
14
|
redrawMap: () => void;
|
|
15
15
|
drawMarker(ctx: CanvasRenderingContext2D): void;
|
|
16
16
|
repositionMapPin: (_bbox: WMBBOX) => void;
|
|
17
|
-
setMapPin: (_x: number, _y: number, _bbox?:
|
|
17
|
+
setMapPin: (_x: number, _y: number, _bbox?: Bbox) => void;
|
|
18
18
|
positionMapPinByLatLon: (coord: {
|
|
19
19
|
x: number;
|
|
20
20
|
y: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare function prefetchImagesForAnimation(wmMap:
|
|
1
|
+
import type IWMJSMap from './IWMJSMap';
|
|
2
|
+
export declare function prefetchImagesForAnimation(wmMap: IWMJSMap, maxImagesToPrefetch?: number): void;
|
|
3
3
|
interface PrefetchRequest {
|
|
4
4
|
url: string;
|
|
5
5
|
headers: Headers[];
|
|
6
6
|
}
|
|
7
|
-
export declare function getLayersImageUrlsForTime(wmMap:
|
|
8
|
-
export declare function prefetchImagesForNonAnimation(wmMap:
|
|
7
|
+
export declare function getLayersImageUrlsForTime(wmMap: IWMJSMap, timeToPrefetch: string): PrefetchRequest[];
|
|
8
|
+
export declare function prefetchImagesForNonAnimation(wmMap: IWMJSMap, maxImagesToPrefetch?: number, batchSize?: number): void;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import WMBBOX from './WMBBOX';
|
|
1
|
+
import WMBBOX, { Bbox } from './WMBBOX';
|
|
2
2
|
/**
|
|
3
3
|
* WMProjection Class
|
|
4
4
|
* Keep all projection information, by a bbox and an srs value.
|
|
@@ -8,3 +8,9 @@ export default class WMProjection {
|
|
|
8
8
|
srs: string;
|
|
9
9
|
constructor();
|
|
10
10
|
}
|
|
11
|
+
export interface WMProjectionWH {
|
|
12
|
+
bbox: Bbox;
|
|
13
|
+
srs: string;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type IWMJSMap from './IWMJSMap';
|
|
2
2
|
import { isDefined, WMJScheckURL, URLDecode, URLEncode, toArray, debugLogger, DebugType, getUriWithParam } from './WMJSTools';
|
|
3
3
|
import WMGetServiceFromStore from './WMGetServiceFromStore';
|
|
4
4
|
import { parseISO8601DateToDate, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration } from './WMTime';
|
|
@@ -8,13 +8,18 @@ import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
|
|
|
8
8
|
import { WMImageEventType } from './WMImageStore';
|
|
9
9
|
import { WMJSService, wmServiceListener } from './WMJSService';
|
|
10
10
|
import WMListener from './WMListener';
|
|
11
|
+
import WMJSMap from './WMJSMap';
|
|
12
|
+
import WMProjection from './WMProjection';
|
|
11
13
|
export { default as WMJSDimension, handleDateUtilsISOString, } from './WMJSDimension';
|
|
12
14
|
export { default as WMLayer, LayerType } from './WMLayer';
|
|
13
15
|
export type { LayerOptions, LayerFoundation } from './WMLayer';
|
|
14
16
|
export { default as WMBBOX } from './WMBBOX';
|
|
15
17
|
export type { Bbox } from './WMBBOX';
|
|
16
|
-
export {
|
|
18
|
+
export type { WMProjectionWH } from './WMProjection';
|
|
19
|
+
export { WMProjection };
|
|
20
|
+
export { IWMJSMap, WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService, getUriWithParam, wmServiceListener, WMListener, };
|
|
17
21
|
export * from './types';
|
|
18
22
|
export * from './WMTimeTypes';
|
|
19
23
|
export * from './WMConstants';
|
|
20
24
|
export * from './WMJSMapHelpers';
|
|
25
|
+
export * from './WMCanvasDrawFunctions';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import proj4 from 'proj4';
|
|
1
2
|
import type WMJSDimension from './WMJSDimension';
|
|
2
3
|
import type WMLayer from './WMLayer';
|
|
3
4
|
import { Bbox } from './WMBBOX';
|
|
4
5
|
import type WMImage from './WMImage';
|
|
5
|
-
import type
|
|
6
|
+
import type IWMJSMap from './IWMJSMap';
|
|
6
7
|
export interface AnimationStep {
|
|
7
8
|
name: string;
|
|
8
9
|
value: string;
|
|
@@ -156,8 +157,18 @@ export interface WMSLayerFromGetCapabilities {
|
|
|
156
157
|
}[];
|
|
157
158
|
}
|
|
158
159
|
export interface WMJSMapMouseClickEvent {
|
|
159
|
-
map:
|
|
160
|
+
map: IWMJSMap;
|
|
160
161
|
x: number;
|
|
161
162
|
y: number;
|
|
162
163
|
shiftKeyPressed: boolean;
|
|
163
164
|
}
|
|
165
|
+
export interface IWMJSMapMouseCoordinates {
|
|
166
|
+
mouseX: number;
|
|
167
|
+
mouseDownX: number;
|
|
168
|
+
mouseY: number;
|
|
169
|
+
mouseDownY: number;
|
|
170
|
+
}
|
|
171
|
+
export interface IWMProj4 {
|
|
172
|
+
crs: string;
|
|
173
|
+
proj4: typeof proj4;
|
|
174
|
+
}
|