@opengeoweb/webmap 2.1.0 → 2.1.4

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.
@@ -1,2 +1,2 @@
1
- declare const WMDrawMarker: (context: CanvasRenderingContext2D, coordx: number, coordy: number, fillColor?: string, outlineColor?: string) => void;
1
+ declare const WMDrawMarker: (context: CanvasRenderingContext2D, coordx: number, coordy: number, fillColor?: string) => void;
2
2
  export default WMDrawMarker;
@@ -1,3 +1,3 @@
1
1
  import { WMJSService } from './WMJSService';
2
- declare const WMGetServiceFromStore: (serviceName: string, xml2jsonrequestURL?: string) => WMJSService;
2
+ declare const WMGetServiceFromStore: (serviceName: string) => WMJSService;
3
3
  export default WMGetServiceFromStore;
@@ -15,6 +15,7 @@ export default class WMJSMap {
15
15
  mapPin: MapPin;
16
16
  mapdimensions: WMJSDimension[];
17
17
  stopAnimating: () => void;
18
+ showLayerInfo: boolean;
18
19
  isAnimating: boolean;
19
20
  animationDelay: number;
20
21
  animationList: any;
@@ -108,13 +109,11 @@ export default class WMJSMap {
108
109
  private proj4;
109
110
  private previousMouseButtonState;
110
111
  private longlat;
111
- xml2jsonrequest: string;
112
112
  private tileRenderSettings;
113
113
  private drawPending;
114
114
  private needsRedraw;
115
115
  private buildLayerDimsBusy;
116
116
  constructor(_element: HTMLElement);
117
- setXML2JSONURL(_xml2jsonrequest: string): void;
118
117
  setWMTileRendererTileSettings(_WMTileRendererTileSettings: unknown): void;
119
118
  /**
120
119
  * Function which make a component ID which is unique over several WebMapJS instances
@@ -1,3 +1,4 @@
1
+ import { Style } from './types';
1
2
  export interface GetCapabilitiesJson {
2
3
  WMS_Capabilities?: any;
3
4
  WMT_MS_Capabilities?: any;
@@ -13,7 +14,7 @@ export declare const getWMSUrl: (service?: string, additionalParams?: {}) => str
13
14
  /**
14
15
  * Global getcapabilities function
15
16
  */
16
- export declare const WMJSGetCapabilities: (service: string, succes: (param: any) => void, fail: (param: string) => void, xml2jsonrequestURL: string, options: {
17
+ export declare const WMJSGetCapabilities: (service: string, succes: (param: any) => void, fail: (param: string) => void, options: {
17
18
  headers?: any;
18
19
  }, disableCache?: boolean) => void;
19
20
  interface NodeObject {
@@ -24,6 +25,7 @@ interface NodeObject {
24
25
  children?: [];
25
26
  keywords?: string[];
26
27
  abstract?: string;
28
+ styles?: Style[];
27
29
  }
28
30
  export declare const sortByKey: (array: NodeObject[], key: string) => NodeObject[];
29
31
  export declare const recursivelyFindLayer: (layers: any[], rootNode: any[], path: string) => void;
@@ -32,7 +34,6 @@ export declare const recursivelyFindLayer: (layers: any[], rootNode: any[], path
32
34
  *
33
35
  * options:
34
36
  * service
35
- * xml2jsonrequestURL
36
37
  * title (optional)
37
38
  */
38
39
  export declare class WMJSService {
@@ -44,13 +45,11 @@ export declare class WMJSService {
44
45
  getcapabilitiesDoc: GetCapabilitiesJson;
45
46
  busy: boolean;
46
47
  _flatLayerObject: any[];
47
- xml2jsonrequestURL: string;
48
48
  functionCallbackList: any[];
49
49
  _options: any;
50
50
  nodeCache: any;
51
51
  constructor(options: {
52
52
  service: string;
53
- xml2jsonrequestURL: string;
54
53
  title?: string;
55
54
  });
56
55
  checkVersion111(jsonData: GetCapabilitiesJson): void;
@@ -64,16 +63,16 @@ export declare class WMJSService {
64
63
  * @param succescallback Function called upon succes, cannot be left blank
65
64
  * @param failcallback Function called upon failure, cannot be left blank
66
65
  */
67
- getCapabilities(succescallback: (param: GetCapabilitiesJson) => void, failcallback: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL: string, options: unknown): void;
66
+ getCapabilities(succescallback: (param: GetCapabilitiesJson) => void, failcallback: (param: unknown) => void, forceReload: boolean, options: unknown): void;
68
67
  checkException(jsonData: GetCapabilitiesJson): string | undefined;
69
68
  /**
70
69
  * Calls succes with a hierarchical node structure
71
70
  * Calls failure with a string when someting goes wrong
72
71
  */
73
- getNodes(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL?: string, options?: unknown): void;
72
+ getNodes(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, options?: unknown): void;
74
73
  /** Calls succes with an array of all layerobjects
75
74
  * Calls failure when something goes wrong
76
75
  */
77
- getLayerObjectsFlat(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, xml2jsonrequestURL?: string, options?: any): void;
76
+ getLayerObjectsFlat(succes: (param: unknown) => void, failure: (param: unknown) => void, forceReload: boolean, options?: any): void;
78
77
  }
79
78
  export {};
@@ -1,3 +1,4 @@
1
+ import type { Style, WMSLayerFromGetCapabilities } from './types';
1
2
  import type WMLayer from './WMLayer';
2
3
  export declare const enableConsoleDebugging = false;
3
4
  export declare enum DebugType {
@@ -58,3 +59,9 @@ export declare const getUriAddParam: (baseUrl: string, params: Record<string, an
58
59
  * @returns ISO8601 string
59
60
  */
60
61
  export declare const dateToISO8601: (date: Date) => string;
62
+ /**
63
+ * Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilties document
64
+ * @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
65
+ * @returns Style[] Array of style objects.
66
+ */
67
+ export declare const addStylesForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities) => Style[];
@@ -1,11 +1,9 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="node" />
3
2
  import type WMJSMap from './WMJSMap';
4
3
  import WMJSDimension from './WMJSDimension';
5
4
  import WMProjection from './WMProjection';
6
- import WMImage from './WMImage';
7
- import { GetCapabilitiesJson, WMJSService } from './WMJSService';
8
- import { Style, Dimension } from './types';
5
+ import { GetCapabilitiesJson } from './WMJSService';
6
+ import { Style, Dimension, WMSLayerFromGetCapabilities } from './types';
9
7
  export declare enum LayerType {
10
8
  mapLayer = "mapLayer",
11
9
  baseLayer = "baseLayer",
@@ -29,26 +27,13 @@ export interface LayerOptions {
29
27
  transparent?: boolean;
30
28
  onReady?: (param: any) => void;
31
29
  type?: string;
32
- parentMaps?: WMJSMap[];
30
+ parentMap?: WMJSMap;
33
31
  dimensions?: Dimension[];
34
32
  headers?: Headers[];
35
33
  failure?: (layer: WMLayer, message: string) => void;
36
34
  ReactWMJSLayerId?: string;
35
+ onLayerError?: (layer: WMLayer, error: Error, webmapInstance: WMJSMap) => void;
37
36
  }
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
37
  /**
53
38
  * 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
39
  * @param layerObjectFromWMS The corresponding layer object from the WMS GetCapabilities.
@@ -72,7 +57,6 @@ export default class WMLayer {
72
57
  id: string;
73
58
  name?: string;
74
59
  ReactWMJSLayerId?: string;
75
- reactWebMapJSLayer?: React.ReactElement;
76
60
  hasError?: boolean;
77
61
  enabled?: boolean;
78
62
  lastError?: string;
@@ -82,7 +66,6 @@ export default class WMLayer {
82
66
  service: string;
83
67
  layerType: LayerType;
84
68
  currentStyle?: string;
85
- image?: WMImage;
86
69
  linkedInfo: {
87
70
  layer: string;
88
71
  message: string;
@@ -90,7 +73,6 @@ export default class WMLayer {
90
73
  headers: Headers[];
91
74
  autoupdate: boolean;
92
75
  timer: NodeJS.Timeout;
93
- WMJSService: WMJSService;
94
76
  getmapURL: string;
95
77
  getfeatureinfoURL: string;
96
78
  getlegendgraphicURL: string;
@@ -106,9 +88,8 @@ export default class WMLayer {
106
88
  projectionProperties: WMProjection[];
107
89
  queryable: boolean;
108
90
  styles: Style[];
109
- getCapabilitiesDoc: GetCapabilitiesJson;
110
91
  serviceTitle: string;
111
- parentMaps: WMJSMap[];
92
+ parentMap: WMJSMap;
112
93
  sldURL: string;
113
94
  active: boolean;
114
95
  getgraphinfoURL: string;
@@ -120,7 +101,6 @@ export default class WMLayer {
120
101
  url: string;
121
102
  colorscalerange: Record<string, unknown>[];
122
103
  };
123
- jsonlayer: this;
124
104
  isConfigured: boolean;
125
105
  init(): void;
126
106
  constructor(options?: LayerOptions);
@@ -137,13 +117,13 @@ export default class WMLayer {
137
117
  handleReferenceTime(name: string, value: string, updateMapDimensions?: boolean): void;
138
118
  getDimensions(): WMJSDimension[];
139
119
  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;
120
+ __parseGetCapForLayer(getcapabilitiesjson: GetCapabilitiesJson, layerDoneCallback: (layer: WMLayer) => void, fail: (layer: WMLayer, message: string) => void): void;
141
121
  /**
142
122
  * Calls success with a configured layer object
143
123
  * Calls options.failure with error message.
144
124
  * Throws string exceptions when someting goes wrong
145
125
  */
146
- parseLayer(_layerDoneCallback: (layer: WMLayer) => void, forceReload: boolean, xml2jsonrequest?: string): void;
126
+ parseLayer(_layerDoneCallback: (layer: WMLayer) => void, forceReload: boolean, origin: string): void;
147
127
  /**
148
128
  * A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
149
129
  * @param forceReload Do not use the cache of the WMS GetCapabilties document, but instead fetch new data from the server
@@ -197,4 +177,3 @@ export default class WMLayer {
197
177
  setSLDURL(url: string): void;
198
178
  display(displayornot: boolean): void;
199
179
  }
200
- export {};
@@ -1,6 +1,6 @@
1
- import WMJSDimension from './WMJSDimension';
1
+ import type WMJSDimension from './WMJSDimension';
2
2
  import type WMLayer from './WMLayer';
3
- import { DateInterval } from './WMTime';
3
+ import type { DateInterval } from './WMTime';
4
4
  export declare type WMPosition = {
5
5
  x: number;
6
6
  y: number;
@@ -35,3 +35,11 @@ export declare type WMLayerType = {
35
35
  title?: string;
36
36
  headers?: Headers[];
37
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
+ export interface WMSLayerFromGetCapabilities {
42
+ Dimension: unknown;
43
+ Style: unknown;
44
+ Extent: unknown;
45
+ }
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "2.1.0",
3
+ "version": "2.1.4",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
- "main": "./webmap.umd.js",
11
- "module": "./webmap.esm.js",
10
+ "main": "./index.umd.js",
11
+ "module": "./index.esm.js",
12
12
  "typings": "./index.d.ts",
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
15
  "moment": "^2.29.0",
16
16
  "throttle-debounce": "^3.0.1",
17
17
  "proj4": "^2.6.2",
18
- "react": "16.14.0",
19
- "@material-ui/core": "^4.11.0"
18
+ "react": "^17.0.2",
19
+ "@mui/styles": "^5.2.3"
20
20
  }
21
21
  }