@opengeoweb/webmap 4.16.0 → 4.18.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.
@@ -76,7 +76,7 @@ export default class WMCanvasBuffer {
76
76
  _height: number;
77
77
  _webmapJSCallback: WMListener;
78
78
  nrLoading: number;
79
- onLoadReadyFunction: (param: any) => void;
79
+ onLoadReadyFunction: (param: unknown) => void;
80
80
  _internalCallbacks: InternalCallback;
81
81
  srs: string;
82
82
  bbox: WMBBOX;
@@ -1,3 +1,4 @@
1
+ import { throttle } from 'throttle-debounce';
1
2
  import WMBBOX from './WMBBOX';
2
3
  import type WMJSMap from './WMJSMap';
3
4
  export default class WMFlyToBBox {
@@ -19,6 +20,6 @@ export default class WMFlyToBBox {
19
20
  resetBBoxTimer: () => void;
20
21
  flyZoomToBBOXStop: () => void;
21
22
  flyZoomToBBOXStartZoom: (currentbox: WMBBOX, newbox: WMBBOX) => void;
22
- startZoomThrottled: any;
23
+ startZoomThrottled: throttle<(currentbox: WMBBOX, newbox: WMBBOX) => void>;
23
24
  flyZoomToBBOXStartZoomThrottled: (currentbox: WMBBOX, newbox: WMBBOX) => void;
24
25
  }
@@ -1,4 +1,5 @@
1
1
  import { TimeInterval } from './types';
2
+ import { CustomDate } from './WMTimeTypes';
2
3
  interface WMJSDimensionConfig {
3
4
  name?: string;
4
5
  units?: string;
@@ -62,7 +63,7 @@ export default class WMJSDimension {
62
63
  /**
63
64
  * Get dimension value for specified index
64
65
  */
65
- getValueForIndex(index: number): string;
66
+ getValueForIndex(index: number): string | CustomDate;
66
67
  /**
67
68
  * Hint about the timestep size / time resolution of this dimension.
68
69
  * @returns The dimTimeInterval
@@ -1,9 +1,11 @@
1
1
  import WMBBOX from './WMBBOX';
2
2
  import WMListener from './WMListener';
3
+ import WMTimer from './WMTimer';
4
+ import { proj4 } from './WMJSExternalDependencies';
3
5
  import WMJSDimension from './WMJSDimension';
4
6
  import MapPin from './WMMapPin';
5
7
  import WMLayer from './WMLayer';
6
- import { LinkedInfo } from './types';
8
+ import { AnimationList, LinkedInfo } from './types';
7
9
  export declare const detectLeftButton: (evt: MouseEvent) => boolean;
8
10
  export declare const detectRightButton: (evt: MouseEvent) => boolean;
9
11
  export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
@@ -19,14 +21,14 @@ export default class WMJSMap {
19
21
  showLayerInfo: boolean;
20
22
  isAnimating: boolean;
21
23
  animationDelay: number;
22
- animationList: any;
23
- _animationList: any;
24
+ animationList: AnimationList[] | string | undefined;
25
+ _animationList: AnimationList[] | string | undefined;
24
26
  currentAnimationStep: number;
25
- setAnimationDelay: (delay: any) => void;
27
+ setAnimationDelay: (delay: number) => void;
26
28
  isAnimatingLoopRunning: boolean;
27
29
  checkAnimation: () => void;
28
30
  animateBusy: boolean;
29
- animationTimer: any;
31
+ animationTimer: WMTimer;
30
32
  mouseHoverAnimationBox: boolean;
31
33
  loadingDiv: HTMLElement;
32
34
  baseDiv: HTMLElement;
@@ -99,7 +101,6 @@ export default class WMJSMap {
99
101
  private mouseDownPressed;
100
102
  private mapMode;
101
103
  private numGetFeatureInfoRequests;
102
- private getFeatureInfoResult;
103
104
  private oldMapMode;
104
105
  private InValidMouseAction;
105
106
  private resizingBBOXCursor;
@@ -176,20 +177,19 @@ export default class WMJSMap {
176
177
  setSize(w: number, h: number): void;
177
178
  _setSize(w: number, h: number): void;
178
179
  abort(): void;
179
- isBusy(): boolean;
180
180
  _makeInfoHTML(): void;
181
181
  showScaleBar(): void;
182
182
  hideScaleBar(): void;
183
183
  displayScaleBarInMap(display: boolean): void;
184
184
  display(): void;
185
185
  _animFrameRedraw(): void;
186
- draw(animationList?: {}): void;
186
+ draw(animationList?: AnimationList[] | string | undefined): void;
187
187
  /**
188
188
  * API Function called to draw the layers, fires getmap request and shows the layers on the screen
189
189
  */
190
- _draw(animationList: string | any[]): void;
190
+ _draw(animationList: AnimationList[] | string | undefined): void;
191
191
  _drawReady(): void;
192
- _drawAndLoad(animationList: string | any[]): void;
192
+ _drawAndLoad(animationList: AnimationList[] | string | undefined): void;
193
193
  _onLayersReadyCallbackFunction(): void;
194
194
  _onMapReadyCallbackFunction(): void;
195
195
  _onResumeSuspendCallbackFunction(): void;
@@ -270,14 +270,14 @@ export default class WMJSMap {
270
270
  getProj4(): {
271
271
  lonlat: string;
272
272
  crs: string;
273
- proj4: any;
273
+ proj4: typeof proj4;
274
274
  };
275
275
  getPixelCoordFromLatLong(coordinates: {
276
- x: any;
277
- y: any;
276
+ x: number;
277
+ y: number;
278
278
  }): {
279
- x: any;
280
- y: any;
279
+ x: number;
280
+ y: number;
281
281
  };
282
282
  calculateBoundingBoxAndZoom(lat: number, lng: number): void;
283
283
  getLatLongFromPixelCoord(coordinates: {
@@ -294,8 +294,8 @@ export default class WMJSMap {
294
294
  x: number;
295
295
  y: number;
296
296
  };
297
- addListener(name: string, f: (param?: any) => void, keep?: boolean): boolean;
298
- removeListener(name: string, f: (param?: any) => void): void;
297
+ addListener(name: string, f: (param?: unknown) => void, keep?: boolean): boolean;
298
+ removeListener(name: string, f: (param?: unknown) => void): void;
299
299
  getListener(): WMListener;
300
300
  suspendEvent(name: string): void;
301
301
  resumeEvent(name: string): void;
@@ -7,15 +7,17 @@ export interface GetCapabilitiesJson {
7
7
  export interface Capability {
8
8
  Layer: WMSLayerFromGetCapabilities;
9
9
  Request: any;
10
- Exception?: any;
11
10
  }
12
11
  export declare const loadGetCapabilitiesViaProxy: (url: string, succes: (param: string) => void, fail: (param: string) => void, xml2jsonrequestURL: string) => void;
13
12
  export declare const getWMSUrl: (service?: string, additionalParams?: {}) => string;
14
13
  /**
15
14
  * Global getcapabilities function
16
15
  */
17
- export declare const WMJSGetCapabilities: (service: string, succes: (param: any) => void, fail: (param: string) => void, options: {
18
- headers?: any;
16
+ export declare const WMJSGetCapabilities: (service: string, succes: (param: unknown) => void, fail: (param: string) => void, options: {
17
+ headers?: {
18
+ name: string;
19
+ value: string;
20
+ }[] | undefined;
19
21
  }, disableCache?: boolean) => void;
20
22
  /**
21
23
  * WMJSService Class
@@ -36,7 +38,6 @@ export declare class WMJSService {
36
38
  _flatLayerObject: LayerProps[] | undefined;
37
39
  functionCallbackList: any[];
38
40
  _options: any;
39
- nodeCache: any;
40
41
  constructor(options: {
41
42
  service: string;
42
43
  title?: string;
@@ -25,7 +25,7 @@ export interface LayerOptions {
25
25
  enabled?: boolean;
26
26
  keepOnTop?: boolean;
27
27
  transparent?: boolean;
28
- onReady?: (param: any) => void;
28
+ onReady?: (param: this) => void;
29
29
  type?: string;
30
30
  parentMap?: WMJSMap;
31
31
  dimensions?: Dimension[];
@@ -33,7 +33,7 @@ export interface LayerOptions {
33
33
  failure?: (layer: WMLayer, message: string) => void;
34
34
  ReactWMJSLayerId?: string;
35
35
  onLayerError?: (layer: WMLayer, error: Error, webmapInstance: WMJSMap) => void;
36
- onLayerReady?: (layer: any, webmap?: any) => void;
36
+ onLayerReady?: (layer: WMLayer, webmap?: WMJSMap) => void;
37
37
  }
38
38
  /**
39
39
  * 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.
@@ -97,7 +97,7 @@ export default class WMLayer {
97
97
  getgraphinfoURL: string;
98
98
  format: string;
99
99
  _options: LayerOptions;
100
- onReady: (param: any) => void;
100
+ onReady: (param: this) => void;
101
101
  optimalFormat: string;
102
102
  wmsextensions: {
103
103
  url: string;
@@ -1,10 +1,19 @@
1
+ export interface CallBack {
2
+ name: string;
3
+ finished: number;
4
+ keepOnCall: boolean;
5
+ functionpointer: (param?: unknown, that?: unknown) => void;
6
+ }
7
+ export interface SuspendedEvent {
8
+ [key: string]: boolean;
9
+ }
1
10
  export default class WMListener {
2
11
  private _callBacks;
3
12
  private _suspendedEvents;
4
13
  private _allEventsSuspended;
5
14
  constructor();
6
- addToCallback(name: string, functionpointer: (param?: any) => void, keepOnCall?: boolean): boolean;
7
- removeEvents(name: string, f: (param?: any) => unknown): void;
15
+ addToCallback(name: string, functionpointer: (param: unknown) => void, keepOnCall?: boolean): boolean;
16
+ removeEvents(name: string, f: (param?: unknown) => unknown): void;
8
17
  destroy(): void;
9
18
  suspendEvent(name: string): void;
10
19
  resumeEvent(name: string): void;
@@ -21,7 +21,7 @@ export declare const getTimeValues: (isotime: string) => number[];
21
21
  export declare const parseISO8601DateToDate: (unvalidatedIsotime: string) => CustomDate;
22
22
  /** ****************************************************** */
23
23
  /** ****************************************************** */
24
- export declare const parseISO8601IntervalToDateInterval: (isotime: string) => DateInterval;
24
+ export declare const parseISO8601IntervalToDateInterval: (_isotime: string) => DateInterval;
25
25
  /** ******************************************************* */
26
26
  /** ******************************************************* */
27
27
  export declare function getNumberOfTimeSteps(starttime: CustomDate, stoptime: CustomDate, interval: DateInterval): number;
@@ -2,6 +2,16 @@ import type WMJSDimension from './WMJSDimension';
2
2
  import type WMLayer from './WMLayer';
3
3
  import type { DateInterval } from './WMTime';
4
4
  import { Bbox } from './WMBBOX';
5
+ import type WMImage from './WMImage';
6
+ export interface AnimationList {
7
+ name: string;
8
+ value: string;
9
+ requests: {
10
+ url: string;
11
+ headers: Headers[];
12
+ }[];
13
+ imagesInPrefetch?: WMImage[];
14
+ }
5
15
  export declare type WMPosition = {
6
16
  x: number;
7
17
  y: number;
@@ -95,11 +105,11 @@ export interface WMSLayerFromGetCapabilities {
95
105
  cascaded: string;
96
106
  };
97
107
  Name: {
98
- attr: any;
108
+ attr: Record<string, unknown>;
99
109
  value: string;
100
110
  };
101
111
  Title: {
102
- attr: any;
112
+ attr: Record<string, unknown>;
103
113
  value: string;
104
114
  };
105
115
  Dimension: unknown;
@@ -114,10 +124,22 @@ export interface WMSLayerFromGetCapabilities {
114
124
  };
115
125
  Layer: WMSLayerFromGetCapabilities | WMSLayerFromGetCapabilities[];
116
126
  EX_GeographicBoundingBox?: {
117
- northBoundLatitude: any;
118
- southBoundLatitude: any;
119
- westBoundLongitude: any;
120
- eastBoundLongitude: any;
127
+ northBoundLatitude: {
128
+ attr: Record<string, unknown>;
129
+ value: string;
130
+ };
131
+ southBoundLatitude: {
132
+ attr: Record<string, unknown>;
133
+ value: string;
134
+ };
135
+ westBoundLongitude: {
136
+ attr: Record<string, unknown>;
137
+ value: string;
138
+ };
139
+ eastBoundLongitude: {
140
+ attr: Record<string, unknown>;
141
+ value: string;
142
+ };
121
143
  };
122
144
  LatLonBoundingBox?: {
123
145
  attr: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "4.16.0",
3
+ "version": "4.18.0",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {