@opengeoweb/webmap 6.0.1 → 6.0.2

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.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
@@ -522,7 +522,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
522
522
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
523
523
  step((generator = generator.apply(thisArg, _arguments || [])).next());
524
524
  });
525
- }
525
+ }
526
+
527
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
528
+ var e = new Error(message);
529
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
530
+ };
526
531
 
527
532
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
528
533
 
@@ -18126,9 +18131,11 @@ var makeNodeLayerFromWMSGetCapabilityLayer = function makeNodeLayerFromWMSGetCap
18126
18131
  }
18127
18132
  return undefined;
18128
18133
  })) : [];
18134
+ var layerName = layer.Name ? layer.Name.value : null;
18135
+ var layerTitle = layer.Title ? layer.Title.value : layerName;
18129
18136
  return {
18130
- name: layer.Name ? layer.Name.value : null,
18131
- title: layer.Title ? layer.Title.value : 'Layer',
18137
+ name: layerName,
18138
+ title: layerTitle || 'Layer',
18132
18139
  leaf: isleaf,
18133
18140
  path: path,
18134
18141
  keywords: toArray(layer.KeywordList && layer.KeywordList.Keyword).map(function (keywords) {
@@ -25564,13 +25571,22 @@ var moment$1 = {exports: {}};
25564
25571
 
25565
25572
  var moment = moment$1.exports;
25566
25573
 
25574
+ function _typeof(obj) {
25575
+ "@babel/helpers - typeof";
25576
+
25577
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
25578
+ return typeof obj;
25579
+ } : function (obj) {
25580
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
25581
+ }, _typeof(obj);
25582
+ }
25583
+
25567
25584
  function requiredArgs(required, args) {
25568
25585
  if (args.length < required) {
25569
25586
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
25570
25587
  }
25571
25588
  }
25572
25589
 
25573
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
25574
25590
  /**
25575
25591
  * @name toDate
25576
25592
  * @category Common Helpers
@@ -25601,11 +25617,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
25601
25617
  * const result = toDate(1392098430000)
25602
25618
  * //=> Tue Feb 11 2014 11:30:30
25603
25619
  */
25604
-
25605
25620
  function toDate(argument) {
25606
25621
  requiredArgs(1, arguments);
25607
- var argStr = Object.prototype.toString.call(argument); // Clone the date
25622
+ var argStr = Object.prototype.toString.call(argument);
25608
25623
 
25624
+ // Clone the date
25609
25625
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
25610
25626
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
25611
25627
  return new Date(argument.getTime());
@@ -25614,11 +25630,10 @@ function toDate(argument) {
25614
25630
  } else {
25615
25631
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
25616
25632
  // eslint-disable-next-line no-console
25617
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
25618
-
25633
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
25634
+ // eslint-disable-next-line no-console
25619
25635
  console.warn(new Error().stack);
25620
25636
  }
25621
-
25622
25637
  return new Date(NaN);
25623
25638
  }
25624
25639
  }
@@ -25666,12 +25681,12 @@ function isWithinInterval(dirtyDate, interval) {
25666
25681
  requiredArgs(2, arguments);
25667
25682
  var time = toDate(dirtyDate).getTime();
25668
25683
  var startTime = toDate(interval.start).getTime();
25669
- var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`
25684
+ var endTime = toDate(interval.end).getTime();
25670
25685
 
25686
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
25671
25687
  if (!(startTime <= endTime)) {
25672
25688
  throw new RangeError('Invalid interval');
25673
25689
  }
25674
-
25675
25690
  return time >= startTime && time <= endTime;
25676
25691
  }
25677
25692
 
package/package.json CHANGED
@@ -1,20 +1,19 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
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
- "module": "./index.js",
11
- "main": "./index.js",
10
+ "module": "./index.esm.js",
12
11
  "type": "module",
13
- "types": "./src/index.d.ts",
12
+ "main": "./index.esm.js",
14
13
  "dependencies": {},
15
14
  "peerDependencies": {
16
- "@opengeoweb/shared": "6.0.1",
17
- "date-fns": "2.29.3",
15
+ "@opengeoweb/shared": "6.0.2",
16
+ "date-fns": "2.30.0",
18
17
  "lodash": "4.17.21",
19
18
  "moment": "2.29.4",
20
19
  "proj4": "2.9.0",
@@ -1,4 +1,4 @@
1
- export declare type Bbox = {
1
+ export type Bbox = {
2
2
  left: number;
3
3
  right: number;
4
4
  top: number;
@@ -3,7 +3,7 @@ import WMImageStore from './WMImageStore';
3
3
  import WMBBOX from './WMBBOX';
4
4
  import WMListener from './WMListener';
5
5
  import { LinkedInfo, LinkedInfoContent, WMPosition } from './types';
6
- declare type InternalCallback = {
6
+ type InternalCallback = {
7
7
  beforecanvasstartdraw?: (context: CanvasRenderingContext2D) => void;
8
8
  beforecanvasdisplay?: (context: CanvasRenderingContext2D) => void;
9
9
  canvasonerror?: (e: LinkedInfo[]) => void;
@@ -14,7 +14,7 @@ declare class MapPin {
14
14
  redrawMap: () => void;
15
15
  drawMarker(ctx: CanvasRenderingContext2D): void;
16
16
  repositionMapPin: (_bbox: WMBBOX) => void;
17
- setMapPin: (_x: number, _y: number, _bbox?: WMBBOX | undefined) => void;
17
+ setMapPin: (_x: number, _y: number, _bbox?: WMBBOX) => void;
18
18
  positionMapPinByLatLon: (coord: {
19
19
  x: number;
20
20
  y: number;
@@ -1,4 +1,4 @@
1
- declare type DateInterval = {
1
+ type DateInterval = {
2
2
  year: number;
3
3
  month: number;
4
4
  day: number;
@@ -1,4 +1,4 @@
1
- declare type WMJSONDocument = any;
1
+ type WMJSONDocument = any;
2
2
  export declare const WMXMLStringToXMLDocument: (xmlString: string) => XMLDocument;
3
3
  export declare const WMXMLtoJSON: (xmlDocument: XMLDocument) => WMJSONDocument;
4
4
  export declare const WMXMLStringToJson: (xmlString: string) => WMJSONDocument;
@@ -12,18 +12,18 @@ export interface AnimationList {
12
12
  }[];
13
13
  imagesInPrefetch?: WMImage[];
14
14
  }
15
- export declare type WMPosition = {
15
+ export type WMPosition = {
16
16
  x: number;
17
17
  y: number;
18
18
  };
19
- export declare type LinkedInfoContent = {
19
+ export type LinkedInfoContent = {
20
20
  layer: WMLayer;
21
21
  message?: string;
22
22
  };
23
- export declare type LinkedInfo = {
23
+ export type LinkedInfo = {
24
24
  linkedInfo: LinkedInfoContent;
25
25
  };
26
- export declare type TimeInterval = {
26
+ export type TimeInterval = {
27
27
  year: number;
28
28
  month: number;
29
29
  day: number;
@@ -32,7 +32,7 @@ export declare type TimeInterval = {
32
32
  second: number;
33
33
  isRegularInterval: boolean;
34
34
  };
35
- export declare type Dimension = {
35
+ export type Dimension = {
36
36
  name?: string;
37
37
  units?: string;
38
38
  currentValue: string;
@@ -55,7 +55,7 @@ export interface GeographicBoundingBox {
55
55
  north: string;
56
56
  south: string;
57
57
  }
58
- export declare type WMLayerType = {
58
+ export type WMLayerType = {
59
59
  setDimension: (name: string, value: string, updateMapDimensions: boolean) => void;
60
60
  getDimension: (name: string) => WMJSDimension;
61
61
  dimensions?: WMJSDimension[];