@opengeoweb/webmap 9.10.2 → 9.12.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 +12930 -6649
- package/package.json +1 -1
- package/src/lib/components/WMAnimate.d.ts +0 -1
- package/src/lib/components/WMCanvasBuffer.d.ts +7 -4
- package/src/lib/components/WMConstants.d.ts +2 -0
- package/src/lib/components/WMImageStore.d.ts +0 -1
- package/src/lib/components/WMJSMap.d.ts +7 -1
- package/src/lib/components/WMJSService.d.ts +2 -0
- package/src/lib/components/WMJSTools.d.ts +1 -1
- package/src/lib/components/WMLayer.d.ts +1 -1
- package/src/lib/components/WMListener.d.ts +47 -11
- package/src/lib/components/WMListener.spec.d.ts +1 -0
- package/src/lib/components/WMMemo.d.ts +5 -0
- package/src/lib/components/WMMemo.spec.d.ts +1 -0
- package/src/lib/components/WMPrefetch.d.ts +1 -1
- package/src/lib/components/index.d.ts +5 -4
- package/src/lib/components/types.d.ts +1 -1
- package/src/lib/utils/index.d.ts +3 -0
- package/src/lib/utils/mapConstants.d.ts +7 -0
- package/src/lib/utils/utils.d.ts +10 -0
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import WMImage from './WMImage';
|
|
3
3
|
import WMImageStore from './WMImageStore';
|
|
4
4
|
import WMBBOX from './WMBBOX';
|
|
5
|
-
import WMListener from './WMListener';
|
|
6
5
|
import { LinkedInfo, LinkedInfoContent, WMPosition } from './types';
|
|
6
|
+
import type WMJSMap from './WMJSMap';
|
|
7
7
|
interface InternalCallback {
|
|
8
8
|
beforecanvasstartdraw?: (context: CanvasRenderingContext2D) => void;
|
|
9
9
|
beforecanvasdisplay?: (context: CanvasRenderingContext2D) => void;
|
|
@@ -70,12 +70,11 @@ export default class WMCanvasBuffer {
|
|
|
70
70
|
_imageStore: WMImageStore;
|
|
71
71
|
ready: boolean;
|
|
72
72
|
layers: CanvasGeoLayer[];
|
|
73
|
-
_defaultImage: WMImage;
|
|
74
73
|
_currentbbox: WMBBOX;
|
|
75
74
|
_currentnewbbox: WMBBOX;
|
|
76
75
|
_width: number;
|
|
77
76
|
_height: number;
|
|
78
|
-
|
|
77
|
+
_webMapJS: WMJSMap;
|
|
79
78
|
nrLoading: number;
|
|
80
79
|
onLoadReadyFunction: (param: unknown) => void;
|
|
81
80
|
_internalCallbacks: InternalCallback;
|
|
@@ -84,7 +83,8 @@ export default class WMCanvasBuffer {
|
|
|
84
83
|
animationFrameRequest: number;
|
|
85
84
|
timerHandle: NodeJS.Timeout;
|
|
86
85
|
_errorList: LinkedInfo[];
|
|
87
|
-
|
|
86
|
+
_isBufferLoading: boolean;
|
|
87
|
+
constructor(webMapJS: WMJSMap, w: number, h: number, internalCallbacks: InternalCallback);
|
|
88
88
|
getCanvasContext(): CanvasRenderingContext2D;
|
|
89
89
|
/**
|
|
90
90
|
* Triggered by the WMImageStore when an image completes loading
|
|
@@ -113,8 +113,11 @@ export default class WMCanvasBuffer {
|
|
|
113
113
|
* @returns Void
|
|
114
114
|
*/
|
|
115
115
|
setSrc(layerIndex: number, imageSource: string, linkedInfo: LinkedInfoContent, opacity: number, bbox: WMBBOX): void;
|
|
116
|
+
checkIfLoading(): void;
|
|
117
|
+
isImageStoreLoading(): boolean;
|
|
116
118
|
_getPixelCoordFromGeoCoord(coordinates: WMPosition, b: WMBBOX): WMPosition;
|
|
117
119
|
setBBOX(newbbox: WMBBOX, loadedbbox: WMBBOX): void;
|
|
120
|
+
destroy(): void;
|
|
118
121
|
getBuffer(): HTMLCanvasElement;
|
|
119
122
|
}
|
|
120
123
|
export {};
|
|
@@ -27,3 +27,5 @@ export declare const epsgDescriptionLookup: {
|
|
|
27
27
|
export declare const mapImageStoreLength = 1000;
|
|
28
28
|
export declare const bgImageStoreLength = 360;
|
|
29
29
|
export declare const legendImageStoreLength = 500;
|
|
30
|
+
export declare const EVENT_GETCAPABILITIES_START = "onstartgetcapabilities";
|
|
31
|
+
export declare const EVENT_GETCAPABILITIES_READY = "onreadygetcapabilities";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import WMImageStore from './WMImageStore';
|
|
1
2
|
import WMBBOX from './WMBBOX';
|
|
2
3
|
import WMListener from './WMListener';
|
|
3
4
|
import { proj4 } from './WMJSExternalDependencies';
|
|
@@ -5,15 +6,17 @@ import WMJSDimension from './WMJSDimension';
|
|
|
5
6
|
import MapPin from './WMMapPin';
|
|
6
7
|
import WMLayer from './WMLayer';
|
|
7
8
|
import { AnimationStep, Dimension, LinkedInfo } from './types';
|
|
9
|
+
import { WMMemo } from './WMMemo';
|
|
8
10
|
export declare const detectLeftButton: (evt: MouseEvent) => boolean;
|
|
9
11
|
export declare const detectRightButton: (evt: MouseEvent) => boolean;
|
|
10
12
|
export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
|
|
11
|
-
export declare const clearImageCache: () => void;
|
|
12
13
|
/**
|
|
13
14
|
/**
|
|
14
15
|
* WMJSMap class
|
|
15
16
|
*/
|
|
16
17
|
export default class WMJSMap {
|
|
18
|
+
prefetchLayerImagesForTimeMemo: WMMemo;
|
|
19
|
+
shouldPrefetch: boolean;
|
|
17
20
|
mapPin: MapPin;
|
|
18
21
|
mapdimensions: WMJSDimension[];
|
|
19
22
|
timestepInMinutes: number | undefined;
|
|
@@ -113,6 +116,7 @@ export default class WMJSMap {
|
|
|
113
116
|
private needsRedraw;
|
|
114
117
|
private buildLayerDimsBusy;
|
|
115
118
|
isProjectionSupported: (srs: string) => boolean;
|
|
119
|
+
getMapImageStore: WMImageStore;
|
|
116
120
|
constructor(_element: HTMLElement);
|
|
117
121
|
setWMTileRendererTileSettings(_WMTileRendererTileSettings: unknown): void;
|
|
118
122
|
/**
|
|
@@ -316,4 +320,6 @@ export default class WMJSMap {
|
|
|
316
320
|
showBoundingBox(_bbox?: WMBBOX, _mapbbox?: WMBBOX): void;
|
|
317
321
|
hideBoundingBox(): void;
|
|
318
322
|
getDrawBBOX(): WMBBOX;
|
|
323
|
+
getImageStore(): WMImageStore;
|
|
324
|
+
clearImageCache(): void;
|
|
319
325
|
}
|
|
@@ -60,7 +60,7 @@ export declare const getUriAddParam: (baseUrl: string, params: Record<string, an
|
|
|
60
60
|
*/
|
|
61
61
|
export declare const dateToISO8601: (date: Date) => string;
|
|
62
62
|
/**
|
|
63
|
-
* Helper function to figure out the styles from the WMS layer object from the WMS
|
|
63
|
+
* Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilities document
|
|
64
64
|
* @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
|
|
65
65
|
* @returns Style[] Array of style objects.
|
|
66
66
|
*/
|
|
@@ -140,7 +140,7 @@ export default class WMLayer {
|
|
|
140
140
|
parseLayer(_layerDoneCallback: (layer: WMLayer) => void, forceReload: boolean, origin: string): void;
|
|
141
141
|
/**
|
|
142
142
|
* A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
|
|
143
|
-
* @param forceReload Do not use the cache of the WMS
|
|
143
|
+
* @param forceReload Do not use the cache of the WMS GetCapabilities document, but instead fetch new data from the server
|
|
144
144
|
* @returns WMLayer object
|
|
145
145
|
*/
|
|
146
146
|
parseLayerPromise(forceReload?: boolean): Promise<WMLayer>;
|
|
@@ -1,21 +1,57 @@
|
|
|
1
|
-
export interface CallBack {
|
|
2
|
-
name: string;
|
|
3
|
-
finished: number;
|
|
4
|
-
keepOnCall: boolean;
|
|
5
|
-
functionpointer: (param?: unknown, that?: unknown) => void;
|
|
6
|
-
}
|
|
7
|
-
export type SuspendedEvent = Record<string, boolean>;
|
|
8
1
|
export default class WMListener {
|
|
9
|
-
private
|
|
2
|
+
private registeredEvents;
|
|
10
3
|
private _suspendedEvents;
|
|
11
|
-
private
|
|
4
|
+
private _suspendAllEvents;
|
|
12
5
|
constructor();
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Remove events by name and function.
|
|
8
|
+
* @param name Event name
|
|
9
|
+
* @param f Function pointer to check
|
|
10
|
+
*/
|
|
11
|
+
removeEventListener(name: string, f: (param?: unknown) => unknown): number;
|
|
12
|
+
/**
|
|
13
|
+
* Remove all events by name
|
|
14
|
+
* @param name Event name
|
|
15
|
+
*/
|
|
16
|
+
removeEventListeners(name: string): number;
|
|
17
|
+
/**
|
|
18
|
+
* Add multiple functions which will be called after the event with the same name is triggered
|
|
19
|
+
* @param name: The name of the event to register
|
|
20
|
+
* @param function: The function to trigger
|
|
21
|
+
* @param keepOnCall: When false, this event name and function combination is removed once triggered.
|
|
22
|
+
* When true Otherwise keep the event and allow it to be triggered multiple times
|
|
23
|
+
* @return: true if the event is registerd, false if it already was registered
|
|
24
|
+
*/
|
|
25
|
+
addEventListener(name: string, functionpointer: (param: unknown) => void, keepOnCall?: boolean): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Destroys this listener, deregistering all events
|
|
28
|
+
*/
|
|
15
29
|
destroy(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Suspend a specific event by name, triggers will not be called
|
|
32
|
+
* @param name
|
|
33
|
+
*/
|
|
16
34
|
suspendEvent(name: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resume a specific event by name, resuming normal operation
|
|
37
|
+
* @param name
|
|
38
|
+
*/
|
|
17
39
|
resumeEvent(name: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* This listener will not listen to any triggers
|
|
42
|
+
*/
|
|
18
43
|
suspendEvents(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Resume event listening
|
|
46
|
+
*/
|
|
19
47
|
resumeEvents(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Trigger an event with custom parameters
|
|
50
|
+
* @param name The name of the event to trigger
|
|
51
|
+
* @param param The parameters to provide to the associated function
|
|
52
|
+
* @returns The results of the function.
|
|
53
|
+
*/
|
|
20
54
|
triggerEvent(name: string, param?: unknown): unknown[];
|
|
55
|
+
private removeFinishedEvents;
|
|
56
|
+
removeEvents(name: string, f?: (param?: unknown) => unknown): number;
|
|
21
57
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,5 +5,5 @@ interface PrefetchRequest {
|
|
|
5
5
|
headers: Headers[];
|
|
6
6
|
}
|
|
7
7
|
export declare function getLayersImageUrlsForTime(wmMap: WMJSMap, timeToPrefetch: string): PrefetchRequest[];
|
|
8
|
-
export declare function prefetchImagesForNonAnimation(wmMap: WMJSMap, maxImagesToPrefetch?: number): void;
|
|
8
|
+
export declare function prefetchImagesForNonAnimation(wmMap: WMJSMap, maxImagesToPrefetch?: number, batchSize?: number): void;
|
|
9
9
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import WMJSMap
|
|
1
|
+
import WMJSMap from './WMJSMap';
|
|
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';
|
|
5
5
|
import I18n from '../utils/I18n/lang.en';
|
|
6
6
|
import WMImage from './WMImage';
|
|
7
7
|
import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
|
|
8
|
-
import {
|
|
9
|
-
import { WMJSService } from './WMJSService';
|
|
8
|
+
import { WMImageEventType } from './WMImageStore';
|
|
9
|
+
import { WMJSService, wmServiceListener } from './WMJSService';
|
|
10
10
|
import { getAlternativeImage } from './WMCanvasBuffer';
|
|
11
|
+
import WMListener from './WMListener';
|
|
11
12
|
export { default as WMJSDimension, handleMomentISOString, } from './WMJSDimension';
|
|
12
13
|
export { default as WMLayer, LayerType } from './WMLayer';
|
|
13
14
|
export type { LayerOptions, LayerFoundation } from './WMLayer';
|
|
14
15
|
export { default as WMBBOX } from './WMBBOX';
|
|
15
16
|
export type { Bbox } from './WMBBOX';
|
|
16
|
-
export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService,
|
|
17
|
+
export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService, getUriWithParam, getAlternativeImage, wmServiceListener, WMListener, };
|
|
17
18
|
export * from './types';
|
|
18
19
|
export * from './WMTimeTypes';
|
|
19
20
|
export * from './WMConstants';
|
|
@@ -97,7 +97,7 @@ export interface WMSBoundingBox {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* This interface is for reading from the WMS
|
|
100
|
+
* This interface is for reading from the WMS GetCapabilities document, which can have different structures for V1.1.1 and V1.3.0
|
|
101
101
|
*/
|
|
102
102
|
export interface WMSLayerFromGetCapabilities {
|
|
103
103
|
attr: {
|
package/src/lib/utils/index.d.ts
CHANGED
|
@@ -4,3 +4,6 @@ export * as webmapUtils from './utils';
|
|
|
4
4
|
export * from './utils';
|
|
5
5
|
export * from './testUtils';
|
|
6
6
|
export * from './getCapabilities';
|
|
7
|
+
export type { SpeedFactorType } from './mapConstants';
|
|
8
|
+
export * as mapConstants from './mapConstants';
|
|
9
|
+
export { speedFactors } from './mapConstants';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const defaultAnimationDelayAtStart = 250;
|
|
2
|
+
export declare const defaultDelay = 1000;
|
|
3
|
+
export declare const defaultTimeStep = 60;
|
|
4
|
+
export declare const defaultSecondsPerPx = 80;
|
|
5
|
+
export declare const defaultTimeSpan: number;
|
|
6
|
+
export type SpeedFactorType = 0.1 | 0.2 | 0.5 | 1 | 2 | 4 | 8 | 16;
|
|
7
|
+
export declare const speedFactors: SpeedFactorType[];
|
package/src/lib/utils/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WMJSDimension, WMJSMap, WMLayer } from '../components';
|
|
2
|
+
import { SpeedFactorType } from './mapConstants';
|
|
2
3
|
export declare const generateLayerId: () => string;
|
|
3
4
|
export declare const generateMapId: () => string;
|
|
4
5
|
export declare const generateTimesliderId: () => string;
|
|
@@ -44,3 +45,12 @@ export declare const getWMJSDimensionForLayerAndDimension: (layerId: string, dim
|
|
|
44
45
|
* @return: The WMJSDimension if found, otherwise null
|
|
45
46
|
*/
|
|
46
47
|
export declare const getWMJSTimeDimensionForLayerId: (layerId: string) => WMJSDimension;
|
|
48
|
+
/**
|
|
49
|
+
* Clears the image store for all maps
|
|
50
|
+
*/
|
|
51
|
+
export declare const clearImageCacheForAllMaps: () => void;
|
|
52
|
+
export declare const roundWithTimeStep: (unixTime: number, timeStep: number, type?: string) => number;
|
|
53
|
+
/**
|
|
54
|
+
* Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
|
|
55
|
+
*/
|
|
56
|
+
export declare const getSpeedDelay: (speedFactor: SpeedFactorType) => number;
|