@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
package/package.json
CHANGED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import WMImageStore from './WMImageStore';
|
|
2
|
+
import { Bbox } from './WMBBOX';
|
|
3
|
+
import WMListener from './WMListener';
|
|
4
|
+
import { CanvasBBOX, CanvasGeoLayer } from './WMCanvasBuffer';
|
|
5
|
+
import WMJSDimension from './WMJSDimension';
|
|
6
|
+
import MapPin from './WMMapPin';
|
|
7
|
+
import WMLayer from './WMLayer';
|
|
8
|
+
import { AnimationStep, IWMJSMapMouseCoordinates, IWMProj4 } from './types';
|
|
9
|
+
import { WMMemo } from './WMMemo';
|
|
10
|
+
import type { TileServerSettings, TileServerDefinition } from '../utils';
|
|
11
|
+
import { WMProjectionWH } from './WMProjection';
|
|
12
|
+
/**
|
|
13
|
+
* *
|
|
14
|
+
* IWMJSMap interface
|
|
15
|
+
*/
|
|
16
|
+
interface IWMJSMap {
|
|
17
|
+
prefetchLayerImagesForTimeMemo: WMMemo;
|
|
18
|
+
shouldPrefetch: boolean;
|
|
19
|
+
mapPin: MapPin;
|
|
20
|
+
mapdimensions: WMJSDimension[];
|
|
21
|
+
timestepInMinutes: number | undefined;
|
|
22
|
+
showLayerInfo: boolean;
|
|
23
|
+
stopAnimating: () => void;
|
|
24
|
+
isAnimating: boolean;
|
|
25
|
+
animationDelay: number;
|
|
26
|
+
animationList: AnimationStep[] | string | undefined;
|
|
27
|
+
currentAnimationStep: number;
|
|
28
|
+
initialAnimationStep: number;
|
|
29
|
+
setAnimationDelay: (delay: number) => void;
|
|
30
|
+
isDestroyed: boolean;
|
|
31
|
+
getMapImageStore: WMImageStore;
|
|
32
|
+
holdShiftToScroll: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* getMapMouseCoordinates returns the coordinates of the mouse in pixels for the map
|
|
35
|
+
* @returns The coordinates of the mouse in pixels for the map
|
|
36
|
+
*/
|
|
37
|
+
getMapMouseCoordinates: () => IWMJSMapMouseCoordinates;
|
|
38
|
+
/**
|
|
39
|
+
* Trigger a mouseUp for the map
|
|
40
|
+
* @param mouseCoordX
|
|
41
|
+
* @param mouseCoordY
|
|
42
|
+
* @param e
|
|
43
|
+
*/
|
|
44
|
+
mouseUp(mouseCoordX: number, mouseCoordY: number, e?: MouseEvent): void;
|
|
45
|
+
/**
|
|
46
|
+
* Trigger a mouseMove for the map
|
|
47
|
+
* @param mouseCoordX
|
|
48
|
+
* @param mouseCoordY
|
|
49
|
+
* @param e
|
|
50
|
+
*/
|
|
51
|
+
mouseMove(mouseCoordX: number, mouseCoordY: number, e?: MouseEvent): void;
|
|
52
|
+
/**
|
|
53
|
+
* Trigger a mousedown for the map
|
|
54
|
+
* @param mouseCoordX
|
|
55
|
+
* @param mouseCoordY
|
|
56
|
+
* @param e
|
|
57
|
+
*/
|
|
58
|
+
mouseDown(mouseCoordX: number, mouseCoordY: number, e?: MouseEvent): void;
|
|
59
|
+
/**
|
|
60
|
+
* Set a list with tileservers to be used within the map instance
|
|
61
|
+
* @param tileRenderSettings
|
|
62
|
+
*/
|
|
63
|
+
setWMTileRendererTileSettings(tileRenderSettings: TileServerSettings): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add one tileserver to the existing set of tileservers to the map instance
|
|
66
|
+
* @param tileRenderSetting
|
|
67
|
+
*/
|
|
68
|
+
addWMTileRendererTileSetting(tileRenderSetting: TileServerDefinition): void;
|
|
69
|
+
/**
|
|
70
|
+
* Displays a message in the map
|
|
71
|
+
* @param message
|
|
72
|
+
*/
|
|
73
|
+
setMessage(message: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Displays a message in the map, meant to print a time offset in the map (used with multimapviews)
|
|
76
|
+
* @param message
|
|
77
|
+
*/
|
|
78
|
+
setTimeOffset(message: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Displays the scalebar in the map
|
|
81
|
+
* @param display
|
|
82
|
+
*/
|
|
83
|
+
displayScaleBarInMap(display: boolean): void;
|
|
84
|
+
/**
|
|
85
|
+
* Do not show mouse cursor coordinates in the map
|
|
86
|
+
*/
|
|
87
|
+
hideMouseCursorProperties(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Get all layers currently in the map (except the baselayer and overlayer)
|
|
90
|
+
* @param reverseOrder True to return them in reversed order
|
|
91
|
+
*/
|
|
92
|
+
getLayers(reverseOrder?: boolean): WMLayer[];
|
|
93
|
+
/**
|
|
94
|
+
* Check if this layer is present in the map
|
|
95
|
+
* @param layer
|
|
96
|
+
*/
|
|
97
|
+
hasLayer(layer: WMLayer): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Set an existing layer for the map, usually used to change the name of the layer
|
|
100
|
+
* @param layer
|
|
101
|
+
*/
|
|
102
|
+
setLayer(layer: WMLayer): Promise<IWMJSMap>;
|
|
103
|
+
/**
|
|
104
|
+
* Displays or hides a given layer
|
|
105
|
+
* @param layer
|
|
106
|
+
* @param enabled
|
|
107
|
+
*/
|
|
108
|
+
displayLayer(layer: WMLayer, enabled: boolean): void;
|
|
109
|
+
/**
|
|
110
|
+
* Remove all layers (except baselayers and overlayers)
|
|
111
|
+
*/
|
|
112
|
+
removeAllLayers(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Delete this specific layer
|
|
115
|
+
* @param layerToDelete
|
|
116
|
+
*/
|
|
117
|
+
deleteLayer(layerToDelete: WMLayer): void;
|
|
118
|
+
/**
|
|
119
|
+
* @param layer of type WMLayer
|
|
120
|
+
*/
|
|
121
|
+
addLayer(layer: WMLayer): Promise<IWMJSMap>;
|
|
122
|
+
/**
|
|
123
|
+
* Zoom to given layer
|
|
124
|
+
* @param _layer
|
|
125
|
+
*/
|
|
126
|
+
zoomToLayer(_layer: WMLayer): void;
|
|
127
|
+
/**
|
|
128
|
+
* Get the current active layer.
|
|
129
|
+
*/
|
|
130
|
+
getActiveLayer(): WMLayer;
|
|
131
|
+
/**
|
|
132
|
+
* Reorder layers according to an index array with indices on how the layers should be reordered.
|
|
133
|
+
*/
|
|
134
|
+
reorderLayers(order: number[]): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Set the projection of the current webmap object
|
|
137
|
+
* _srs also accepts a projectionProperty object
|
|
138
|
+
*/
|
|
139
|
+
setProjection(_srs: string, _bbox?: Bbox): void;
|
|
140
|
+
/**
|
|
141
|
+
* Returns the current boundingbox, projection, width and height of the map
|
|
142
|
+
*/
|
|
143
|
+
getProjection(): WMProjectionWH;
|
|
144
|
+
/**
|
|
145
|
+
* Set the default boundingbox, used when pressing the home button in the map.
|
|
146
|
+
* @param bbox
|
|
147
|
+
*/
|
|
148
|
+
setDefaultBBOX(bbox: Bbox): void;
|
|
149
|
+
/**
|
|
150
|
+
* Change the current boundingbox of the map
|
|
151
|
+
* @param bbox
|
|
152
|
+
*/
|
|
153
|
+
setBBOX(bbox: Bbox): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Returns the current boundingbox of the map, updated with the extent for which WMS layers are loaded
|
|
156
|
+
*/
|
|
157
|
+
getBBOX(): Bbox;
|
|
158
|
+
/**
|
|
159
|
+
* Get the current intermediate boundingbox, it is immediately updated when panning or zooming the map. This one is not the one which is used for WMS requests. It can be used to update drawings in the canvas
|
|
160
|
+
*/
|
|
161
|
+
getDrawBBOX(): Bbox;
|
|
162
|
+
/**
|
|
163
|
+
* Get the width and height in pixels of the map
|
|
164
|
+
*/
|
|
165
|
+
getSize(): {
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Change the size of the map in pixels, e.g. when container is resized.s
|
|
171
|
+
* @param w
|
|
172
|
+
* @param h
|
|
173
|
+
*/
|
|
174
|
+
setSize(w: number, h: number): void;
|
|
175
|
+
/**
|
|
176
|
+
* Zoomout given ratio
|
|
177
|
+
* @param ratio 1.0, means zoomout using full boundingbox width, 0.1 means zoom out 10% of full boundingbox width
|
|
178
|
+
*/
|
|
179
|
+
zoomOut(ratio?: number): void;
|
|
180
|
+
/**
|
|
181
|
+
* Zoomin given ratio
|
|
182
|
+
* @param ratio 1.0, meane zoomin using full boundingbox width, 0.1 means zoom in to 10% of full boundingbox width
|
|
183
|
+
*/
|
|
184
|
+
zoomIn(ratio?: number): void;
|
|
185
|
+
/**
|
|
186
|
+
* Zooms the map to the specified bounding box
|
|
187
|
+
* @param _newbbox
|
|
188
|
+
*/
|
|
189
|
+
zoomTo(_newbbox: Bbox): void;
|
|
190
|
+
/**
|
|
191
|
+
* Displays the legend of the layer inside the map
|
|
192
|
+
* @param _displayLegendInMap
|
|
193
|
+
*/
|
|
194
|
+
displayLegendInMap(_displayLegendInMap: boolean): void;
|
|
195
|
+
/**
|
|
196
|
+
* Tell the map to load layers and draw again
|
|
197
|
+
* @param animationList
|
|
198
|
+
*/
|
|
199
|
+
draw(animationList?: AnimationStep[] | string | undefined): void;
|
|
200
|
+
/**
|
|
201
|
+
* Just refresh the drawing buffer, useful when opacity of a layer is changed.
|
|
202
|
+
*/
|
|
203
|
+
redrawBuffer(): void;
|
|
204
|
+
/**
|
|
205
|
+
* Set the baselayers for the map
|
|
206
|
+
* @param layers
|
|
207
|
+
*/
|
|
208
|
+
setBaseLayers(layers: WMLayer[]): void;
|
|
209
|
+
/**
|
|
210
|
+
* Return a list of baselayers from the map
|
|
211
|
+
*/
|
|
212
|
+
getBaseLayers(): WMLayer[];
|
|
213
|
+
/**
|
|
214
|
+
* Returns how many layers the map currently has (baselayers and overlays not included)
|
|
215
|
+
*/
|
|
216
|
+
getNumLayers(): number;
|
|
217
|
+
/**
|
|
218
|
+
* Returns the HTML base element used for the map
|
|
219
|
+
*/
|
|
220
|
+
getBaseElement(): HTMLElement;
|
|
221
|
+
/**
|
|
222
|
+
* Destroys the map, useful when a component container unmounts.
|
|
223
|
+
*/
|
|
224
|
+
destroy(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Pan the map with a given percentage (used for keyboard controls)
|
|
227
|
+
* @param percentageDiffX
|
|
228
|
+
* @param percentageDiffY
|
|
229
|
+
*/
|
|
230
|
+
mapPanPercentage(percentageDiffX: number, percentageDiffY: number): void;
|
|
231
|
+
/**
|
|
232
|
+
* Changes the cursor icon of the map
|
|
233
|
+
* @param cursor 'move', 'pointer' or '' ( for default)
|
|
234
|
+
*/
|
|
235
|
+
setCursor(cursor?: string): void;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the id of this map
|
|
238
|
+
*/
|
|
239
|
+
getId(): string;
|
|
240
|
+
/**
|
|
241
|
+
* Returns proj4 instance of the map
|
|
242
|
+
*/
|
|
243
|
+
getProj4(): IWMProj4;
|
|
244
|
+
/**
|
|
245
|
+
* Zoom in to specified location
|
|
246
|
+
* @param lat
|
|
247
|
+
* @param lng
|
|
248
|
+
*/
|
|
249
|
+
calculateBoundingBoxAndZoom(lat: number, lng: number): void;
|
|
250
|
+
/**
|
|
251
|
+
* Add something to the event listener
|
|
252
|
+
* @param name
|
|
253
|
+
* @param f
|
|
254
|
+
* @param keep
|
|
255
|
+
*/
|
|
256
|
+
addListener(name: string, f: (param?: unknown) => void, keep?: boolean): boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Remove something from the event listener
|
|
259
|
+
* @param name
|
|
260
|
+
* @param f
|
|
261
|
+
*/
|
|
262
|
+
removeListener(name: string, f: (param?: unknown) => void): void;
|
|
263
|
+
/**
|
|
264
|
+
* Get a direct handle to the event listener system
|
|
265
|
+
*/
|
|
266
|
+
getListener(): WMListener;
|
|
267
|
+
/**
|
|
268
|
+
* Suspend a specific event
|
|
269
|
+
* @param name
|
|
270
|
+
*/
|
|
271
|
+
suspendEvent(name: string): void;
|
|
272
|
+
/**
|
|
273
|
+
* Resume a specific event
|
|
274
|
+
* @param name
|
|
275
|
+
*/
|
|
276
|
+
resumeEvent(name: string): void;
|
|
277
|
+
/**
|
|
278
|
+
* Returns a list of all used map dimensions
|
|
279
|
+
*/
|
|
280
|
+
getDimensionList(): WMJSDimension[];
|
|
281
|
+
/**
|
|
282
|
+
* Get a specific map dimension
|
|
283
|
+
* @param name
|
|
284
|
+
*/
|
|
285
|
+
getDimension(name: string): WMJSDimension | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* Set a specific map dimension
|
|
288
|
+
* @param name
|
|
289
|
+
* @param value
|
|
290
|
+
* @param triggerEvent
|
|
291
|
+
* @param adjustLayerDims
|
|
292
|
+
*/
|
|
293
|
+
setDimension(name: string, value: string, triggerEvent?: boolean, adjustLayerDims?: boolean): void;
|
|
294
|
+
/**
|
|
295
|
+
* Get a handle to the imagestore
|
|
296
|
+
*/
|
|
297
|
+
getImageStore(): WMImageStore;
|
|
298
|
+
/**
|
|
299
|
+
* Tell the imagestore to forget all its images
|
|
300
|
+
*/
|
|
301
|
+
clearImageCache(): void;
|
|
302
|
+
/**
|
|
303
|
+
* Handle to the map pin
|
|
304
|
+
*/
|
|
305
|
+
getMapPin(): MapPin;
|
|
306
|
+
/**
|
|
307
|
+
* For a given WMS GetMap imageUrl, return an alternative image which is directly available for display.
|
|
308
|
+
* @param imageUrl
|
|
309
|
+
* @param bbox
|
|
310
|
+
* @param filterBad
|
|
311
|
+
*/
|
|
312
|
+
getAlternativeImage(imageUrl: string, bbox: CanvasBBOX, filterBad: boolean): CanvasGeoLayer[];
|
|
313
|
+
configureMapDimensions(layer: WMLayer): void;
|
|
314
|
+
}
|
|
315
|
+
export default IWMJSMap;
|
|
@@ -4,7 +4,7 @@ export interface Bbox {
|
|
|
4
4
|
top: number;
|
|
5
5
|
bottom: number;
|
|
6
6
|
}
|
|
7
|
-
export default class WMBBOX {
|
|
7
|
+
export default class WMBBOX implements Bbox {
|
|
8
8
|
left: number;
|
|
9
9
|
bottom: number;
|
|
10
10
|
right: number;
|
|
@@ -23,7 +23,7 @@ export default class WMBBOX {
|
|
|
23
23
|
* When no parameters are given, a global latlon bbox is generated.
|
|
24
24
|
*/
|
|
25
25
|
setBBOX(left?: number | string | Bbox, bottom?: number, right?: number, top?: number): void;
|
|
26
|
-
equals(left: number | string | WMBBOX, bottom: number, right: number, top: number): boolean;
|
|
26
|
+
equals(left: number | string | WMBBOX | Bbox, bottom: number, right: number, top: number): boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Returns the current BBOX as a string, useful for generating WMS requests.
|
|
29
29
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WMBBOX from './WMBBOX';
|
|
2
2
|
import { LinkedInfo, LinkedInfoContent } from './types';
|
|
3
|
-
import type
|
|
3
|
+
import type IWMJSMap from './IWMJSMap';
|
|
4
4
|
export type SharedImageListType = Record<string, CanvasGeoLayer[]>;
|
|
5
5
|
interface CanvasBufferCallbacks {
|
|
6
6
|
beforecanvasstartdraw?: (context: CanvasRenderingContext2D) => void;
|
|
@@ -54,7 +54,7 @@ export default class WMCanvasBuffer {
|
|
|
54
54
|
private _isBufferLoading;
|
|
55
55
|
private _onLoadReadyFunction;
|
|
56
56
|
private sharedImagesList;
|
|
57
|
-
constructor(webMapJS:
|
|
57
|
+
constructor(webMapJS: IWMJSMap, w: number, h: number, internalCallbacks: CanvasBufferCallbacks);
|
|
58
58
|
/**
|
|
59
59
|
* Triggered by the WMImageStore when an image completes loading
|
|
60
60
|
* @param image
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type IWMJSMap from './IWMJSMap';
|
|
2
|
+
interface ScaleBarProps {
|
|
3
|
+
width: number;
|
|
4
|
+
mapHeight: number;
|
|
5
|
+
mapunits: number;
|
|
6
|
+
mapSrs: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const drawTextBG: (ctx: CanvasRenderingContext2D, txt: string, x: number, y: number, fontSize: number) => void;
|
|
9
|
+
export declare const getScaleBarProperties: (map: IWMJSMap) => ScaleBarProps;
|
|
10
|
+
export declare const drawScaleBar: (scaleBarProps: ScaleBarProps, ctx: CanvasRenderingContext2D) => void;
|
|
11
|
+
export {};
|
|
@@ -3,6 +3,8 @@ export declare const WMEmptyLayerTitle = "empty layer";
|
|
|
3
3
|
export declare const WMDateOutSideRange = "outside range";
|
|
4
4
|
export declare const WMDateTooEarlyString = "date too early";
|
|
5
5
|
export declare const WMDateTooLateString = "date too late";
|
|
6
|
+
export declare const WMSJSMAP_MINIMUM_MAP_WIDTH = 4;
|
|
7
|
+
export declare const WMSJSMAP_MINIMUM_MAP_HEIGHT = 4;
|
|
6
8
|
export declare const WMSVersion: {
|
|
7
9
|
version100: string;
|
|
8
10
|
version111: string;
|
|
@@ -29,3 +31,4 @@ export declare const bgImageStoreLength = 360;
|
|
|
29
31
|
export declare const legendImageStoreLength = 500;
|
|
30
32
|
export declare const EVENT_GETCAPABILITIES_START = "onstartgetcapabilities";
|
|
31
33
|
export declare const EVENT_GETCAPABILITIES_READY = "onreadygetcapabilities";
|
|
34
|
+
export declare const WMJSMAP_LONLAT_EPSGCODE = "EPSG:4326";
|