@opengeoweb/webmap 5.0.0 → 5.1.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/README.md +0 -0
- package/index.js +180 -67
- package/package.json +3 -2
- package/src/index.d.ts +0 -0
- package/src/lib/components/WMAnimate.d.ts +0 -0
- package/src/lib/components/WMAnimate.spec.d.ts +0 -0
- package/src/lib/components/WMBBOX.d.ts +0 -0
- package/src/lib/components/WMBBOX.spec.d.ts +0 -0
- package/src/lib/components/WMCanvasBuffer.d.ts +0 -0
- package/src/lib/components/WMCanvasBuffer.spec.d.ts +0 -0
- package/src/lib/components/WMConstants.d.ts +0 -0
- package/src/lib/components/WMDrawMarker.d.ts +0 -0
- package/src/lib/components/WMDrawMarker.spec.d.ts +0 -0
- package/src/lib/components/WMFlyToBBox.d.ts +0 -0
- package/src/lib/components/WMFlyToBBox.spec.d.ts +0 -0
- package/src/lib/components/WMGetServiceFromStore.d.ts +0 -0
- package/src/lib/components/WMGlobals.d.ts +0 -0
- package/src/lib/components/WMImage.d.ts +0 -0
- package/src/lib/components/WMImage.spec.d.ts +0 -0
- package/src/lib/components/WMImageStore.d.ts +0 -0
- package/src/lib/components/WMImageStore.spec.d.ts +0 -0
- package/src/lib/components/WMJSDimension.d.ts +3 -2
- package/src/lib/components/WMJSDimension.spec.d.ts +0 -0
- package/src/lib/components/WMJSExternalDependencies.d.ts +0 -0
- package/src/lib/components/WMJSMap.d.ts +0 -0
- package/src/lib/components/WMJSMap.spec.d.ts +0 -0
- package/src/lib/components/WMJSMapHelpers.d.ts +0 -0
- package/src/lib/components/WMJSMapHelpers.spec.d.ts +0 -0
- package/src/lib/components/WMJSService.d.ts +0 -0
- package/src/lib/components/WMJSService.spec.d.ts +0 -0
- package/src/lib/components/WMJSTools.d.ts +0 -0
- package/src/lib/components/WMJSTools.spec.d.ts +0 -0
- package/src/lib/components/WMLayer.d.ts +1 -1
- package/src/lib/components/WMLayer.spec.d.ts +0 -0
- package/src/lib/components/WMLegend.d.ts +0 -0
- package/src/lib/components/WMLegend.spec.d.ts +0 -0
- package/src/lib/components/WMListener.d.ts +0 -0
- package/src/lib/components/WMMapPin.d.ts +0 -0
- package/src/lib/components/WMProjection.d.ts +0 -0
- package/src/lib/components/WMTileRenderer.d.ts +0 -0
- package/src/lib/components/WMTileRenderer.spec.d.ts +0 -0
- package/src/lib/components/WMTime.d.ts +1 -1
- package/src/lib/components/WMTime.spec.d.ts +0 -0
- package/src/lib/components/WMTimeTypes.d.ts +0 -0
- package/src/lib/components/WMTimer.d.ts +0 -0
- package/src/lib/components/WMTimer.spec.d.ts +0 -0
- package/src/lib/components/WMXMLParser.d.ts +0 -0
- package/src/lib/components/WMXMLParser.spec.d.ts +0 -0
- package/src/lib/components/index.d.ts +0 -0
- package/src/lib/components/types.d.ts +0 -0
- package/src/lib/utils/I18n/lang.en.d.ts +0 -0
- package/src/lib/utils/I18n/lang.nl.d.ts +0 -0
- package/src/lib/utils/specs/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +0 -0
- package/src/lib/utils/specs/WMS130GetCapabilitiesHarmN25.d.ts +0 -0
- package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts +0 -0
- package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritLayerprops.d.ts +0 -0
- package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithoutInheritLayerprops.d.ts +0 -0
- package/src/lib/utils/specs/WMSSmartMet.d.ts +0 -0
- package/src/lib/utils/testUtils.d.ts +0 -0
- package/src/lib/utils/tilesettings.d.ts +0 -0
package/README.md
CHANGED
|
File without changes
|
package/index.js
CHANGED
|
@@ -29,14 +29,14 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
29
29
|
return _arr;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function _typeof(obj) {
|
|
32
|
+
function _typeof$1(obj) {
|
|
33
33
|
"@babel/helpers - typeof";
|
|
34
34
|
|
|
35
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
35
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
36
36
|
return typeof obj;
|
|
37
37
|
} : function (obj) {
|
|
38
38
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39
|
-
}, _typeof(obj);
|
|
39
|
+
}, _typeof$1(obj);
|
|
40
40
|
}
|
|
41
41
|
function _classCallCheck(instance, Constructor) {
|
|
42
42
|
if (!(instance instanceof Constructor)) {
|
|
@@ -17764,7 +17764,7 @@ var flattenLayerTree = function flattenLayerTree(layerTree) {
|
|
|
17764
17764
|
var omit = function omit(prop, _a) {
|
|
17765
17765
|
var _b = prop;
|
|
17766
17766
|
_a[_b];
|
|
17767
|
-
var rest = __rest(_a, [_typeof(_b) === "symbol" ? _b : _b + ""]);
|
|
17767
|
+
var rest = __rest(_a, [_typeof$1(_b) === "symbol" ? _b : _b + ""]);
|
|
17768
17768
|
return rest;
|
|
17769
17769
|
};
|
|
17770
17770
|
var recurseLayerTree = function recurseLayerTree(data) {
|
|
@@ -18390,7 +18390,7 @@ var WMBBOX = /*#__PURE__*/function () {
|
|
|
18390
18390
|
/* Check if we recieve more than one parameter by checking the second bottom parameter. */
|
|
18391
18391
|
if (bottom === undefined) {
|
|
18392
18392
|
/* Otherwise it can be a bbox object or a string in the form "left,bottom,right,top" */
|
|
18393
|
-
if (_typeof(left) === 'object') {
|
|
18393
|
+
if (_typeof$1(left) === 'object') {
|
|
18394
18394
|
/* A bbox object is given, so it is not a string */
|
|
18395
18395
|
var a = left;
|
|
18396
18396
|
this.left = a.left;
|
|
@@ -25258,6 +25258,117 @@ var moment$1 = {exports: {}};
|
|
|
25258
25258
|
|
|
25259
25259
|
var moment = moment$1.exports;
|
|
25260
25260
|
|
|
25261
|
+
function requiredArgs(required, args) {
|
|
25262
|
+
if (args.length < required) {
|
|
25263
|
+
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
25264
|
+
}
|
|
25265
|
+
}
|
|
25266
|
+
|
|
25267
|
+
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); }
|
|
25268
|
+
/**
|
|
25269
|
+
* @name toDate
|
|
25270
|
+
* @category Common Helpers
|
|
25271
|
+
* @summary Convert the given argument to an instance of Date.
|
|
25272
|
+
*
|
|
25273
|
+
* @description
|
|
25274
|
+
* Convert the given argument to an instance of Date.
|
|
25275
|
+
*
|
|
25276
|
+
* If the argument is an instance of Date, the function returns its clone.
|
|
25277
|
+
*
|
|
25278
|
+
* If the argument is a number, it is treated as a timestamp.
|
|
25279
|
+
*
|
|
25280
|
+
* If the argument is none of the above, the function returns Invalid Date.
|
|
25281
|
+
*
|
|
25282
|
+
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
25283
|
+
*
|
|
25284
|
+
* @param {Date|Number} argument - the value to convert
|
|
25285
|
+
* @returns {Date} the parsed date in the local time zone
|
|
25286
|
+
* @throws {TypeError} 1 argument required
|
|
25287
|
+
*
|
|
25288
|
+
* @example
|
|
25289
|
+
* // Clone the date:
|
|
25290
|
+
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
25291
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
25292
|
+
*
|
|
25293
|
+
* @example
|
|
25294
|
+
* // Convert the timestamp to date:
|
|
25295
|
+
* const result = toDate(1392098430000)
|
|
25296
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
25297
|
+
*/
|
|
25298
|
+
|
|
25299
|
+
function toDate(argument) {
|
|
25300
|
+
requiredArgs(1, arguments);
|
|
25301
|
+
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
25302
|
+
|
|
25303
|
+
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
25304
|
+
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
25305
|
+
return new Date(argument.getTime());
|
|
25306
|
+
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
25307
|
+
return new Date(argument);
|
|
25308
|
+
} else {
|
|
25309
|
+
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
25310
|
+
// eslint-disable-next-line no-console
|
|
25311
|
+
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
|
|
25312
|
+
|
|
25313
|
+
console.warn(new Error().stack);
|
|
25314
|
+
}
|
|
25315
|
+
|
|
25316
|
+
return new Date(NaN);
|
|
25317
|
+
}
|
|
25318
|
+
}
|
|
25319
|
+
|
|
25320
|
+
/**
|
|
25321
|
+
* @name isWithinInterval
|
|
25322
|
+
* @category Interval Helpers
|
|
25323
|
+
* @summary Is the given date within the interval?
|
|
25324
|
+
*
|
|
25325
|
+
* @description
|
|
25326
|
+
* Is the given date within the interval? (Including start and end.)
|
|
25327
|
+
*
|
|
25328
|
+
* @param {Date|Number} date - the date to check
|
|
25329
|
+
* @param {Interval} interval - the interval to check
|
|
25330
|
+
* @returns {Boolean} the date is within the interval
|
|
25331
|
+
* @throws {TypeError} 2 arguments required
|
|
25332
|
+
* @throws {RangeError} The start of an interval cannot be after its end
|
|
25333
|
+
* @throws {RangeError} Date in interval cannot be `Invalid Date`
|
|
25334
|
+
*
|
|
25335
|
+
* @example
|
|
25336
|
+
* // For the date within the interval:
|
|
25337
|
+
* isWithinInterval(new Date(2014, 0, 3), {
|
|
25338
|
+
* start: new Date(2014, 0, 1),
|
|
25339
|
+
* end: new Date(2014, 0, 7)
|
|
25340
|
+
* })
|
|
25341
|
+
* //=> true
|
|
25342
|
+
*
|
|
25343
|
+
* @example
|
|
25344
|
+
* // For the date outside of the interval:
|
|
25345
|
+
* isWithinInterval(new Date(2014, 0, 10), {
|
|
25346
|
+
* start: new Date(2014, 0, 1),
|
|
25347
|
+
* end: new Date(2014, 0, 7)
|
|
25348
|
+
* })
|
|
25349
|
+
* //=> false
|
|
25350
|
+
*
|
|
25351
|
+
* @example
|
|
25352
|
+
* // For date equal to interval start:
|
|
25353
|
+
* isWithinInterval(date, { start, end: date }) // => true
|
|
25354
|
+
*
|
|
25355
|
+
* @example
|
|
25356
|
+
* // For date equal to interval end:
|
|
25357
|
+
* isWithinInterval(date, { start: date, end }) // => true
|
|
25358
|
+
*/
|
|
25359
|
+
function isWithinInterval(dirtyDate, interval) {
|
|
25360
|
+
requiredArgs(2, arguments);
|
|
25361
|
+
var time = toDate(dirtyDate).getTime();
|
|
25362
|
+
var startTime = toDate(interval.start).getTime();
|
|
25363
|
+
var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`
|
|
25364
|
+
|
|
25365
|
+
if (!(startTime <= endTime)) {
|
|
25366
|
+
throw new RangeError('Invalid interval');
|
|
25367
|
+
}
|
|
25368
|
+
|
|
25369
|
+
return time >= startTime && time <= endTime;
|
|
25370
|
+
}
|
|
25371
|
+
|
|
25261
25372
|
/** ************************************************ */
|
|
25262
25373
|
/* Object to store a time duration / time interval */
|
|
25263
25374
|
/** ************************************************ */
|
|
@@ -25700,10 +25811,10 @@ var ParseISOTimeRangeDuration = /*#__PURE__*/function () {
|
|
|
25700
25811
|
/* Calculates the time step at the given date */
|
|
25701
25812
|
}, {
|
|
25702
25813
|
key: "getTimeStepFromDate",
|
|
25703
|
-
value: function getTimeStepFromDate(
|
|
25814
|
+
value: function getTimeStepFromDate(wantedDate) {
|
|
25704
25815
|
var throwIfOutsideRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
25705
|
-
var
|
|
25706
|
-
if (
|
|
25816
|
+
var wantedTime = wantedDate.getTime();
|
|
25817
|
+
if (wantedTime < this.startTime.getTime()) {
|
|
25707
25818
|
if (throwIfOutsideRange === true) {
|
|
25708
25819
|
throw new Error('0');
|
|
25709
25820
|
}
|
|
@@ -25711,30 +25822,38 @@ var ParseISOTimeRangeDuration = /*#__PURE__*/function () {
|
|
|
25711
25822
|
}
|
|
25712
25823
|
var myStopTime = this.stopTime.clone();
|
|
25713
25824
|
myStopTime.add(this.timeInterval);
|
|
25714
|
-
if (
|
|
25825
|
+
if (wantedTime >= myStopTime.getTime()) {
|
|
25715
25826
|
if (throwIfOutsideRange === true) {
|
|
25716
25827
|
throw new Error("".concat(this.timeSteps - 1));
|
|
25717
25828
|
}
|
|
25718
25829
|
return this.timeSteps - 1;
|
|
25719
25830
|
}
|
|
25720
|
-
if (
|
|
25831
|
+
if (wantedTime > this.stopTime.getTime()) {
|
|
25721
25832
|
return this.timeSteps - 1;
|
|
25722
25833
|
}
|
|
25723
25834
|
var timeStep = 0;
|
|
25724
25835
|
if (this.timeInterval.isRegularInterval === false) {
|
|
25725
|
-
var
|
|
25726
|
-
for (var
|
|
25727
|
-
var
|
|
25728
|
-
|
|
25729
|
-
var
|
|
25730
|
-
if (
|
|
25731
|
-
|
|
25836
|
+
var next = this.startTime.clone();
|
|
25837
|
+
for (var currentTimeStepIndex = 0; currentTimeStepIndex < this.timeSteps; currentTimeStepIndex += 1) {
|
|
25838
|
+
var currentTime = next.getTime();
|
|
25839
|
+
next.add(this.timeInterval);
|
|
25840
|
+
var nextTime = next.getTime();
|
|
25841
|
+
if (isWithinInterval(wantedTime, {
|
|
25842
|
+
start: currentTime,
|
|
25843
|
+
end: nextTime
|
|
25844
|
+
})) {
|
|
25845
|
+
var timeInTheMiddle = (currentTime + nextTime) / 2;
|
|
25846
|
+
if (wantedTime > timeInTheMiddle) {
|
|
25847
|
+
return currentTimeStepIndex + 1;
|
|
25848
|
+
}
|
|
25849
|
+
return currentTimeStepIndex;
|
|
25732
25850
|
}
|
|
25733
25851
|
}
|
|
25734
|
-
throw new Error("Date ".concat(
|
|
25852
|
+
throw new Error("Date ".concat(wantedDate.toISO8601(), " not found!"));
|
|
25735
25853
|
} else {
|
|
25736
|
-
timeStep = (
|
|
25737
|
-
|
|
25854
|
+
timeStep = (wantedDate.getTime() - this.startTime.getTime()) / this.timeInterval.getTime();
|
|
25855
|
+
// round 4.5 down to 4 by using this hack
|
|
25856
|
+
timeStep = -Math.round(-timeStep);
|
|
25738
25857
|
return timeStep;
|
|
25739
25858
|
}
|
|
25740
25859
|
}
|
|
@@ -25783,15 +25902,12 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
25783
25902
|
this.name = undefined; // Name of the dimension, e.g. 'time'
|
|
25784
25903
|
this.units = undefined; // Units of the dimension, e.g. 'ISO8601'
|
|
25785
25904
|
this.unitSymbol = undefined; // Unit symbol, eg: hPa
|
|
25786
|
-
this.values = undefined; // Values of the dimension, according to values defined in WMS specification, e.g. 2011-01-01T00:00:00Z/2012-01-01T00:00:00Z/P1M or list of values.
|
|
25787
|
-
this.timeRangeDuration = undefined;
|
|
25788
25905
|
this.linked = true;
|
|
25789
25906
|
this.synced = false;
|
|
25790
|
-
/* Private starts with _ */
|
|
25791
25907
|
this._initialized = false;
|
|
25792
25908
|
this._timeRangeDurationDate = null; // Used for timerange (start/stop/res)
|
|
25793
25909
|
this._allDates = []; // Used for individual timevalues
|
|
25794
|
-
this._type = null;
|
|
25910
|
+
this._type = null;
|
|
25795
25911
|
this._allValues = [];
|
|
25796
25912
|
this.setTimeValuesForReferenceTime = this.setTimeValuesForReferenceTime.bind(this);
|
|
25797
25913
|
this.generateAllValues = this.generateAllValues.bind(this);
|
|
@@ -25915,6 +26031,7 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
25915
26031
|
}, {
|
|
25916
26032
|
key: "initialize",
|
|
25917
26033
|
value: function initialize() {
|
|
26034
|
+
var _this = this;
|
|
25918
26035
|
var forceothervalues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
|
|
25919
26036
|
var forceReferenceTimeValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
25920
26037
|
if (this._initialized === true) {
|
|
@@ -25943,21 +26060,21 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
25943
26060
|
}
|
|
25944
26061
|
if (this._type !== 'timestartstopres') {
|
|
25945
26062
|
var values = ogcdimvalues.split(',');
|
|
25946
|
-
|
|
25947
|
-
var valuesRangedNoTrim =
|
|
26063
|
+
values.forEach(function (value) {
|
|
26064
|
+
var valuesRangedNoTrim = value.split('/');
|
|
25948
26065
|
if (valuesRangedNoTrim.length === 3) {
|
|
25949
26066
|
var valuesRanged = valuesRangedNoTrim.map(function (value) {
|
|
25950
26067
|
return value.trim();
|
|
25951
26068
|
});
|
|
25952
26069
|
/* Can be either time like '2021-03-17T06:00:00Z/2021-03-21T00:00:00Z/PT6H' or something else, like '0/24/2' */
|
|
25953
26070
|
if (valuesRanged[2].charAt(0) === 'P') {
|
|
25954
|
-
var partTimeRanges = new ParseISOTimeRangeDuration(
|
|
26071
|
+
var partTimeRanges = new ParseISOTimeRangeDuration(value);
|
|
25955
26072
|
for (var i = 0; i < partTimeRanges.getTimeSteps(); i += 1) {
|
|
25956
26073
|
var dataAtTimeStep = partTimeRanges.getDateAtTimeStep(i);
|
|
25957
26074
|
try {
|
|
25958
|
-
|
|
26075
|
+
_this._allValues.push(dataAtTimeStep.toISO8601());
|
|
25959
26076
|
} catch (e) {
|
|
25960
|
-
|
|
26077
|
+
_this._allValues.push(dataAtTimeStep.toString());
|
|
25961
26078
|
}
|
|
25962
26079
|
}
|
|
25963
26080
|
} else {
|
|
@@ -25972,18 +26089,18 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
25972
26089
|
res = 1;
|
|
25973
26090
|
}
|
|
25974
26091
|
for (var j2 = start; j2 < stop; j2 += res) {
|
|
25975
|
-
|
|
26092
|
+
_this._allValues.push(String(j2));
|
|
25976
26093
|
}
|
|
25977
26094
|
}
|
|
25978
26095
|
} else {
|
|
25979
|
-
|
|
26096
|
+
_this._allValues.push(String(value));
|
|
25980
26097
|
}
|
|
25981
|
-
}
|
|
26098
|
+
});
|
|
25982
26099
|
if (this._type === 'timevalues') {
|
|
25983
26100
|
this._allDates.length = 0;
|
|
25984
|
-
|
|
25985
|
-
|
|
25986
|
-
}
|
|
26101
|
+
this._allValues.forEach(function (value) {
|
|
26102
|
+
_this._allDates.push(parseISO8601DateToDate(value));
|
|
26103
|
+
});
|
|
25987
26104
|
}
|
|
25988
26105
|
}
|
|
25989
26106
|
/* If no default value is given, take the last / most recent one */
|
|
@@ -26196,10 +26313,7 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
26196
26313
|
}
|
|
26197
26314
|
return this._timeRangeDurationDate.getDateAtTimeStep(index);
|
|
26198
26315
|
}
|
|
26199
|
-
if (this._type === 'timevalues') {
|
|
26200
|
-
return this._allValues[index];
|
|
26201
|
-
}
|
|
26202
|
-
if (this._type === 'anyvalue') {
|
|
26316
|
+
if (this._type === 'timevalues' || this._type === 'anyvalue') {
|
|
26203
26317
|
return this._allValues[index];
|
|
26204
26318
|
}
|
|
26205
26319
|
return null;
|
|
@@ -26261,12 +26375,14 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
26261
26375
|
* Get index value for specified value. Returns the index in the store for the given time value, either a date or a iso8601 string can be passes as input.
|
|
26262
26376
|
* @param value Either a JS Date object or an ISO8601 String
|
|
26263
26377
|
* @return The index of the value. If outSideOfRangeFlag is false, a valid index will
|
|
26264
|
-
* always be returned. If outSideOfRangeFlag is true:
|
|
26265
|
-
*
|
|
26378
|
+
* always be returned. If outSideOfRangeFlag is true:
|
|
26379
|
+
* -1 if the value is not in the store, and is lower than available values,
|
|
26380
|
+
* -2 if the value is not in the store, and is higher than available values
|
|
26266
26381
|
*/
|
|
26267
26382
|
}, {
|
|
26268
26383
|
key: "getIndexForValue",
|
|
26269
26384
|
value: function getIndexForValue(value) {
|
|
26385
|
+
var _this2 = this;
|
|
26270
26386
|
var outSideOfRangeFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
26271
26387
|
this.initialize();
|
|
26272
26388
|
if (typeof value === 'string') {
|
|
@@ -26289,36 +26405,33 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
26289
26405
|
}
|
|
26290
26406
|
if (this._type === 'timevalues') {
|
|
26291
26407
|
try {
|
|
26292
|
-
var
|
|
26408
|
+
var wantedTime = parseISO8601DateToDate(value).getTime();
|
|
26293
26409
|
var minDistance = null;
|
|
26294
26410
|
var foundIndex = 0;
|
|
26295
|
-
var
|
|
26296
|
-
var
|
|
26297
|
-
|
|
26298
|
-
var
|
|
26299
|
-
if (
|
|
26300
|
-
|
|
26411
|
+
var startTime = null;
|
|
26412
|
+
var stopTime = null;
|
|
26413
|
+
this._allValues.forEach(function (_, valueIndex) {
|
|
26414
|
+
var currentTime = _this2._allDates[valueIndex].getTime();
|
|
26415
|
+
if (currentTime < startTime || startTime === null) {
|
|
26416
|
+
startTime = currentTime;
|
|
26301
26417
|
}
|
|
26302
|
-
if (
|
|
26303
|
-
|
|
26418
|
+
if (currentTime > stopTime || stopTime === null) {
|
|
26419
|
+
stopTime = currentTime;
|
|
26304
26420
|
}
|
|
26305
|
-
var distance =
|
|
26306
|
-
if (
|
|
26307
|
-
distance = -distance;
|
|
26308
|
-
}
|
|
26309
|
-
if (j === 0) {
|
|
26421
|
+
var distance = Math.abs(currentTime - wantedTime);
|
|
26422
|
+
if (valueIndex === 0) {
|
|
26310
26423
|
minDistance = distance;
|
|
26311
26424
|
}
|
|
26312
|
-
if (
|
|
26425
|
+
if (minDistance > distance) {
|
|
26313
26426
|
minDistance = distance;
|
|
26314
|
-
foundIndex =
|
|
26427
|
+
foundIndex = valueIndex;
|
|
26315
26428
|
}
|
|
26316
|
-
}
|
|
26429
|
+
});
|
|
26317
26430
|
if (outSideOfRangeFlag) {
|
|
26318
|
-
if (
|
|
26431
|
+
if (startTime > wantedTime) {
|
|
26319
26432
|
return -1;
|
|
26320
26433
|
}
|
|
26321
|
-
if (
|
|
26434
|
+
if (stopTime < wantedTime) {
|
|
26322
26435
|
return -2;
|
|
26323
26436
|
}
|
|
26324
26437
|
}
|
|
@@ -26329,9 +26442,9 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
26329
26442
|
}
|
|
26330
26443
|
}
|
|
26331
26444
|
if (this._type === 'anyvalue') {
|
|
26332
|
-
for (var
|
|
26333
|
-
if (this._allValues[
|
|
26334
|
-
return
|
|
26445
|
+
for (var j = 0; j < this._allValues.length; j += 1) {
|
|
26446
|
+
if (this._allValues[j] === value) {
|
|
26447
|
+
return j;
|
|
26335
26448
|
}
|
|
26336
26449
|
}
|
|
26337
26450
|
}
|
|
@@ -27760,7 +27873,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
27760
27873
|
if (!_srs) {
|
|
27761
27874
|
_srs = 'EPSG:4326';
|
|
27762
27875
|
}
|
|
27763
|
-
if (_typeof(_srs) === 'object') {
|
|
27876
|
+
if (_typeof$1(_srs) === 'object') {
|
|
27764
27877
|
_bbox = _srs.bbox;
|
|
27765
27878
|
_srs = _srs.srs;
|
|
27766
27879
|
}
|
|
@@ -28007,7 +28120,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
28007
28120
|
if (this.isDestroyed) {
|
|
28008
28121
|
return;
|
|
28009
28122
|
}
|
|
28010
|
-
if (_typeof(animationList) === 'object') {
|
|
28123
|
+
if (_typeof$1(animationList) === 'object') {
|
|
28011
28124
|
if (JSON.stringify(animationList) !== '{}') {
|
|
28012
28125
|
this._animationList = animationList;
|
|
28013
28126
|
}
|
|
@@ -28047,7 +28160,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
28047
28160
|
this.callBack.triggerEvent('beforedraw');
|
|
28048
28161
|
if (this.isAnimating === false) {
|
|
28049
28162
|
if (animationList !== undefined) {
|
|
28050
|
-
if (_typeof(animationList) === 'object') {
|
|
28163
|
+
if (_typeof$1(animationList) === 'object') {
|
|
28051
28164
|
if (animationList.length > 0) {
|
|
28052
28165
|
// Ensure the time dimension has been loaded for the map before starting animation
|
|
28053
28166
|
var timeDim = this.getDimension('time');
|
|
@@ -30793,7 +30906,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
30793
30906
|
}, {
|
|
30794
30907
|
key: "setOpacity",
|
|
30795
30908
|
value: function setOpacity(opacityValue) {
|
|
30796
|
-
this.opacity =
|
|
30909
|
+
this.opacity = opacityValue;
|
|
30797
30910
|
this.parentMap && this.parentMap.redrawBuffer();
|
|
30798
30911
|
}
|
|
30799
30912
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "GeoWeb webmap library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"types": "./src/index.d.ts",
|
|
14
14
|
"dependencies": {},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@opengeoweb/shared": "5.
|
|
16
|
+
"@opengeoweb/shared": "5.1.0",
|
|
17
|
+
"date-fns": "2.29.3",
|
|
17
18
|
"lodash": "4.17.21",
|
|
18
19
|
"moment": "2.29.4",
|
|
19
20
|
"proj4": "2.9.0",
|
package/src/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -85,8 +85,9 @@ export default class WMJSDimension {
|
|
|
85
85
|
* Get index value for specified value. Returns the index in the store for the given time value, either a date or a iso8601 string can be passes as input.
|
|
86
86
|
* @param value Either a JS Date object or an ISO8601 String
|
|
87
87
|
* @return The index of the value. If outSideOfRangeFlag is false, a valid index will
|
|
88
|
-
* always be returned. If outSideOfRangeFlag is true:
|
|
89
|
-
*
|
|
88
|
+
* always be returned. If outSideOfRangeFlag is true:
|
|
89
|
+
* -1 if the value is not in the store, and is lower than available values,
|
|
90
|
+
* -2 if the value is not in the store, and is higher than available values
|
|
90
91
|
*/
|
|
91
92
|
getIndexForValue(value: string, outSideOfRangeFlag?: boolean): number;
|
|
92
93
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -110,7 +110,7 @@ export default class WMLayer {
|
|
|
110
110
|
getLayerName(): string;
|
|
111
111
|
toggleAutoUpdate(): void;
|
|
112
112
|
setAutoUpdate(val: boolean, interval?: number, callback?: () => void): void;
|
|
113
|
-
setOpacity(opacityValue:
|
|
113
|
+
setOpacity(opacityValue: number): void;
|
|
114
114
|
getOpacity(): number;
|
|
115
115
|
remove(): void;
|
|
116
116
|
moveUp(): void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -35,7 +35,7 @@ export declare class ParseISOTimeRangeDuration {
|
|
|
35
35
|
getTimeSteps(): number;
|
|
36
36
|
getDateAtTimeStep(currentStep: number): CustomDate;
|
|
37
37
|
getTimeStepFromISODate(currentISODate: string, throwIfOutsideRange: boolean): number;
|
|
38
|
-
getTimeStepFromDate(
|
|
38
|
+
getTimeStepFromDate(wantedDate: CustomDate, throwIfOutsideRange?: boolean): number;
|
|
39
39
|
getTimeStepFromDateWithinRange(currentDate: CustomDate): number;
|
|
40
40
|
getTimeStepFromDateClipped(currentDate: CustomDate): number;
|
|
41
41
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|