@opengeoweb/webmap 6.1.1 → 8.0.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.esm.d.ts +0 -0
- package/index.esm.js +472 -79
- 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 +1 -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 +0 -0
- 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 +1 -1
- 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 +3 -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 +0 -0
- 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/index.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/getCapabilities/getCapabilities.d.ts +0 -0
- package/src/lib/utils/getCapabilities/getCapabilities.spec.d.ts +0 -0
- package/src/lib/utils/getCapabilities/index.d.ts +0 -0
- package/src/lib/utils/getCapabilities/mocks/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +0 -0
- package/src/lib/utils/getCapabilities/mocks/index.d.ts +0 -0
- package/src/lib/utils/getCapabilities/mocks/mockGetCapabilities.d.ts +0 -0
- package/src/lib/utils/index.d.ts +1 -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/testSettings.d.ts +3 -19
- package/src/lib/utils/testUtils.d.ts +2 -16
- package/src/lib/utils/tilesettings.d.ts +0 -0
- package/src/lib/utils/utils.d.ts +0 -0
- package/src/lib/utils/utils.spec.d.ts +0 -0
package/README.md
CHANGED
|
File without changes
|
package/index.esm.d.ts
CHANGED
|
File without changes
|
package/index.esm.js
CHANGED
|
@@ -529,6 +529,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
533
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
534
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
535
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
536
|
+
}
|
|
537
|
+
|
|
532
538
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
533
539
|
var e = new Error(message);
|
|
534
540
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -18272,6 +18278,11 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
18272
18278
|
value: function isLoadedWithoutErrors() {
|
|
18273
18279
|
return this.isLoaded() && !this.hasError();
|
|
18274
18280
|
}
|
|
18281
|
+
}, {
|
|
18282
|
+
key: "hasNotStartedLoading",
|
|
18283
|
+
value: function hasNotStartedLoading() {
|
|
18284
|
+
return !this._isLoaded && !this._isLoading;
|
|
18285
|
+
}
|
|
18275
18286
|
/**
|
|
18276
18287
|
* Returns true if the image is still loading
|
|
18277
18288
|
*/
|
|
@@ -19178,7 +19189,7 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
19178
19189
|
* Check if this image has an error.
|
|
19179
19190
|
* If the error has occured some time ago, and the amount of retries is low, just retry to load the image.
|
|
19180
19191
|
*/
|
|
19181
|
-
if (imageToDisplay.hasError() && imageToDisplay.isLoading() === false && imageToDisplay.getLastErrorMSecondsAgo() > 5000 && imageToDisplay.getNumFailedAttempts() < 10) {
|
|
19192
|
+
if ((imageToDisplay === null || imageToDisplay === void 0 ? void 0 : imageToDisplay.hasError()) && imageToDisplay.isLoading() === false && imageToDisplay.getLastErrorMSecondsAgo() > 5000 && imageToDisplay.getNumFailedAttempts() < 10) {
|
|
19182
19193
|
imageToDisplay.forceReload();
|
|
19183
19194
|
}
|
|
19184
19195
|
/* Find closest alternative and display instead image */
|
|
@@ -19321,7 +19332,7 @@ var prefetch = function prefetch(requests) {
|
|
|
19321
19332
|
var image = getMapImageStore.getImage(request.url, {
|
|
19322
19333
|
headers: request.headers
|
|
19323
19334
|
});
|
|
19324
|
-
if (image.
|
|
19335
|
+
if (image.hasNotStartedLoading()) {
|
|
19325
19336
|
prefetching.push(image);
|
|
19326
19337
|
image.load();
|
|
19327
19338
|
}
|
|
@@ -25586,6 +25597,17 @@ function _typeof(o) {
|
|
|
25586
25597
|
}, _typeof(o);
|
|
25587
25598
|
}
|
|
25588
25599
|
|
|
25600
|
+
function toInteger(dirtyNumber) {
|
|
25601
|
+
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
25602
|
+
return NaN;
|
|
25603
|
+
}
|
|
25604
|
+
var number = Number(dirtyNumber);
|
|
25605
|
+
if (isNaN(number)) {
|
|
25606
|
+
return number;
|
|
25607
|
+
}
|
|
25608
|
+
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
25609
|
+
}
|
|
25610
|
+
|
|
25589
25611
|
function requiredArgs(required, args) {
|
|
25590
25612
|
if (args.length < required) {
|
|
25591
25613
|
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
@@ -25643,6 +25665,112 @@ function toDate(argument) {
|
|
|
25643
25665
|
}
|
|
25644
25666
|
}
|
|
25645
25667
|
|
|
25668
|
+
/**
|
|
25669
|
+
* Days in 1 week.
|
|
25670
|
+
*
|
|
25671
|
+
* @name daysInWeek
|
|
25672
|
+
* @constant
|
|
25673
|
+
* @type {number}
|
|
25674
|
+
* @default
|
|
25675
|
+
*/
|
|
25676
|
+
|
|
25677
|
+
/**
|
|
25678
|
+
* Milliseconds in 1 minute
|
|
25679
|
+
*
|
|
25680
|
+
* @name millisecondsInMinute
|
|
25681
|
+
* @constant
|
|
25682
|
+
* @type {number}
|
|
25683
|
+
* @default
|
|
25684
|
+
*/
|
|
25685
|
+
var millisecondsInMinute = 60000;
|
|
25686
|
+
|
|
25687
|
+
/**
|
|
25688
|
+
* Milliseconds in 1 hour
|
|
25689
|
+
*
|
|
25690
|
+
* @name millisecondsInHour
|
|
25691
|
+
* @constant
|
|
25692
|
+
* @type {number}
|
|
25693
|
+
* @default
|
|
25694
|
+
*/
|
|
25695
|
+
var millisecondsInHour = 3600000;
|
|
25696
|
+
|
|
25697
|
+
/**
|
|
25698
|
+
* @name isDate
|
|
25699
|
+
* @category Common Helpers
|
|
25700
|
+
* @summary Is the given value a date?
|
|
25701
|
+
*
|
|
25702
|
+
* @description
|
|
25703
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
25704
|
+
*
|
|
25705
|
+
* @param {*} value - the value to check
|
|
25706
|
+
* @returns {boolean} true if the given value is a date
|
|
25707
|
+
* @throws {TypeError} 1 arguments required
|
|
25708
|
+
*
|
|
25709
|
+
* @example
|
|
25710
|
+
* // For a valid date:
|
|
25711
|
+
* const result = isDate(new Date())
|
|
25712
|
+
* //=> true
|
|
25713
|
+
*
|
|
25714
|
+
* @example
|
|
25715
|
+
* // For an invalid date:
|
|
25716
|
+
* const result = isDate(new Date(NaN))
|
|
25717
|
+
* //=> true
|
|
25718
|
+
*
|
|
25719
|
+
* @example
|
|
25720
|
+
* // For some value:
|
|
25721
|
+
* const result = isDate('2014-02-31')
|
|
25722
|
+
* //=> false
|
|
25723
|
+
*
|
|
25724
|
+
* @example
|
|
25725
|
+
* // For an object:
|
|
25726
|
+
* const result = isDate({})
|
|
25727
|
+
* //=> false
|
|
25728
|
+
*/
|
|
25729
|
+
function isDate(value) {
|
|
25730
|
+
requiredArgs(1, arguments);
|
|
25731
|
+
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
25732
|
+
}
|
|
25733
|
+
|
|
25734
|
+
/**
|
|
25735
|
+
* @name isValid
|
|
25736
|
+
* @category Common Helpers
|
|
25737
|
+
* @summary Is the given date valid?
|
|
25738
|
+
*
|
|
25739
|
+
* @description
|
|
25740
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
|
25741
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
25742
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
25743
|
+
*
|
|
25744
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
25745
|
+
*
|
|
25746
|
+
* @param {*} date - the date to check
|
|
25747
|
+
* @returns {Boolean} the date is valid
|
|
25748
|
+
* @throws {TypeError} 1 argument required
|
|
25749
|
+
*
|
|
25750
|
+
* @example
|
|
25751
|
+
* // For the valid date:
|
|
25752
|
+
* const result = isValid(new Date(2014, 1, 31))
|
|
25753
|
+
* //=> true
|
|
25754
|
+
*
|
|
25755
|
+
* @example
|
|
25756
|
+
* // For the value, convertable into a date:
|
|
25757
|
+
* const result = isValid(1393804800000)
|
|
25758
|
+
* //=> true
|
|
25759
|
+
*
|
|
25760
|
+
* @example
|
|
25761
|
+
* // For the invalid date:
|
|
25762
|
+
* const result = isValid(new Date(''))
|
|
25763
|
+
* //=> false
|
|
25764
|
+
*/
|
|
25765
|
+
function isValid(dirtyDate) {
|
|
25766
|
+
requiredArgs(1, arguments);
|
|
25767
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
25768
|
+
return false;
|
|
25769
|
+
}
|
|
25770
|
+
var date = toDate(dirtyDate);
|
|
25771
|
+
return !isNaN(Number(date));
|
|
25772
|
+
}
|
|
25773
|
+
|
|
25646
25774
|
/**
|
|
25647
25775
|
* @name isWithinInterval
|
|
25648
25776
|
* @category Interval Helpers
|
|
@@ -25695,6 +25823,232 @@ function isWithinInterval(dirtyDate, interval) {
|
|
|
25695
25823
|
return time >= startTime && time <= endTime;
|
|
25696
25824
|
}
|
|
25697
25825
|
|
|
25826
|
+
/**
|
|
25827
|
+
* @name parseISO
|
|
25828
|
+
* @category Common Helpers
|
|
25829
|
+
* @summary Parse ISO string
|
|
25830
|
+
*
|
|
25831
|
+
* @description
|
|
25832
|
+
* Parse the given string in ISO 8601 format and return an instance of Date.
|
|
25833
|
+
*
|
|
25834
|
+
* Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
25835
|
+
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
25836
|
+
*
|
|
25837
|
+
* If the argument isn't a string, the function cannot parse the string or
|
|
25838
|
+
* the values are invalid, it returns Invalid Date.
|
|
25839
|
+
*
|
|
25840
|
+
* @param {String} argument - the value to convert
|
|
25841
|
+
* @param {Object} [options] - an object with options.
|
|
25842
|
+
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
|
|
25843
|
+
* @returns {Date} the parsed date in the local time zone
|
|
25844
|
+
* @throws {TypeError} 1 argument required
|
|
25845
|
+
* @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
|
|
25846
|
+
*
|
|
25847
|
+
* @example
|
|
25848
|
+
* // Convert string '2014-02-11T11:30:30' to date:
|
|
25849
|
+
* const result = parseISO('2014-02-11T11:30:30')
|
|
25850
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
25851
|
+
*
|
|
25852
|
+
* @example
|
|
25853
|
+
* // Convert string '+02014101' to date,
|
|
25854
|
+
* // if the additional number of digits in the extended year format is 1:
|
|
25855
|
+
* const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
25856
|
+
* //=> Fri Apr 11 2014 00:00:00
|
|
25857
|
+
*/
|
|
25858
|
+
function parseISO(argument, options) {
|
|
25859
|
+
var _options$additionalDi;
|
|
25860
|
+
requiredArgs(1, arguments);
|
|
25861
|
+
var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
25862
|
+
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
25863
|
+
throw new RangeError('additionalDigits must be 0, 1 or 2');
|
|
25864
|
+
}
|
|
25865
|
+
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
|
|
25866
|
+
return new Date(NaN);
|
|
25867
|
+
}
|
|
25868
|
+
var dateStrings = splitDateString(argument);
|
|
25869
|
+
var date;
|
|
25870
|
+
if (dateStrings.date) {
|
|
25871
|
+
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
25872
|
+
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
25873
|
+
}
|
|
25874
|
+
if (!date || isNaN(date.getTime())) {
|
|
25875
|
+
return new Date(NaN);
|
|
25876
|
+
}
|
|
25877
|
+
var timestamp = date.getTime();
|
|
25878
|
+
var time = 0;
|
|
25879
|
+
var offset;
|
|
25880
|
+
if (dateStrings.time) {
|
|
25881
|
+
time = parseTime(dateStrings.time);
|
|
25882
|
+
if (isNaN(time)) {
|
|
25883
|
+
return new Date(NaN);
|
|
25884
|
+
}
|
|
25885
|
+
}
|
|
25886
|
+
if (dateStrings.timezone) {
|
|
25887
|
+
offset = parseTimezone(dateStrings.timezone);
|
|
25888
|
+
if (isNaN(offset)) {
|
|
25889
|
+
return new Date(NaN);
|
|
25890
|
+
}
|
|
25891
|
+
} else {
|
|
25892
|
+
var dirtyDate = new Date(timestamp + time);
|
|
25893
|
+
// js parsed string assuming it's in UTC timezone
|
|
25894
|
+
// but we need it to be parsed in our timezone
|
|
25895
|
+
// so we use utc values to build date in our timezone.
|
|
25896
|
+
// Year values from 0 to 99 map to the years 1900 to 1999
|
|
25897
|
+
// so set year explicitly with setFullYear.
|
|
25898
|
+
var result = new Date(0);
|
|
25899
|
+
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
25900
|
+
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
25901
|
+
return result;
|
|
25902
|
+
}
|
|
25903
|
+
return new Date(timestamp + time + offset);
|
|
25904
|
+
}
|
|
25905
|
+
var patterns = {
|
|
25906
|
+
dateTimeDelimiter: /[T ]/,
|
|
25907
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
25908
|
+
timezone: /([Z+-].*)$/
|
|
25909
|
+
};
|
|
25910
|
+
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
25911
|
+
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
25912
|
+
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
25913
|
+
function splitDateString(dateString) {
|
|
25914
|
+
var dateStrings = {};
|
|
25915
|
+
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
25916
|
+
var timeString;
|
|
25917
|
+
|
|
25918
|
+
// The regex match should only return at maximum two array elements.
|
|
25919
|
+
// [date], [time], or [date, time].
|
|
25920
|
+
if (array.length > 2) {
|
|
25921
|
+
return dateStrings;
|
|
25922
|
+
}
|
|
25923
|
+
if (/:/.test(array[0])) {
|
|
25924
|
+
timeString = array[0];
|
|
25925
|
+
} else {
|
|
25926
|
+
dateStrings.date = array[0];
|
|
25927
|
+
timeString = array[1];
|
|
25928
|
+
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
25929
|
+
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
25930
|
+
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
25931
|
+
}
|
|
25932
|
+
}
|
|
25933
|
+
if (timeString) {
|
|
25934
|
+
var token = patterns.timezone.exec(timeString);
|
|
25935
|
+
if (token) {
|
|
25936
|
+
dateStrings.time = timeString.replace(token[1], '');
|
|
25937
|
+
dateStrings.timezone = token[1];
|
|
25938
|
+
} else {
|
|
25939
|
+
dateStrings.time = timeString;
|
|
25940
|
+
}
|
|
25941
|
+
}
|
|
25942
|
+
return dateStrings;
|
|
25943
|
+
}
|
|
25944
|
+
function parseYear(dateString, additionalDigits) {
|
|
25945
|
+
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
|
|
25946
|
+
var captures = dateString.match(regex);
|
|
25947
|
+
// Invalid ISO-formatted year
|
|
25948
|
+
if (!captures) return {
|
|
25949
|
+
year: NaN,
|
|
25950
|
+
restDateString: ''
|
|
25951
|
+
};
|
|
25952
|
+
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
25953
|
+
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
25954
|
+
|
|
25955
|
+
// either year or century is null, not both
|
|
25956
|
+
return {
|
|
25957
|
+
year: century === null ? year : century * 100,
|
|
25958
|
+
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
25959
|
+
};
|
|
25960
|
+
}
|
|
25961
|
+
function parseDate(dateString, year) {
|
|
25962
|
+
// Invalid ISO-formatted year
|
|
25963
|
+
if (year === null) return new Date(NaN);
|
|
25964
|
+
var captures = dateString.match(dateRegex);
|
|
25965
|
+
// Invalid ISO-formatted string
|
|
25966
|
+
if (!captures) return new Date(NaN);
|
|
25967
|
+
var isWeekDate = !!captures[4];
|
|
25968
|
+
var dayOfYear = parseDateUnit(captures[1]);
|
|
25969
|
+
var month = parseDateUnit(captures[2]) - 1;
|
|
25970
|
+
var day = parseDateUnit(captures[3]);
|
|
25971
|
+
var week = parseDateUnit(captures[4]);
|
|
25972
|
+
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
25973
|
+
if (isWeekDate) {
|
|
25974
|
+
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
25975
|
+
return new Date(NaN);
|
|
25976
|
+
}
|
|
25977
|
+
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
25978
|
+
} else {
|
|
25979
|
+
var date = new Date(0);
|
|
25980
|
+
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
25981
|
+
return new Date(NaN);
|
|
25982
|
+
}
|
|
25983
|
+
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
25984
|
+
return date;
|
|
25985
|
+
}
|
|
25986
|
+
}
|
|
25987
|
+
function parseDateUnit(value) {
|
|
25988
|
+
return value ? parseInt(value) : 1;
|
|
25989
|
+
}
|
|
25990
|
+
function parseTime(timeString) {
|
|
25991
|
+
var captures = timeString.match(timeRegex);
|
|
25992
|
+
if (!captures) return NaN; // Invalid ISO-formatted time
|
|
25993
|
+
|
|
25994
|
+
var hours = parseTimeUnit(captures[1]);
|
|
25995
|
+
var minutes = parseTimeUnit(captures[2]);
|
|
25996
|
+
var seconds = parseTimeUnit(captures[3]);
|
|
25997
|
+
if (!validateTime(hours, minutes, seconds)) {
|
|
25998
|
+
return NaN;
|
|
25999
|
+
}
|
|
26000
|
+
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
|
|
26001
|
+
}
|
|
26002
|
+
function parseTimeUnit(value) {
|
|
26003
|
+
return value && parseFloat(value.replace(',', '.')) || 0;
|
|
26004
|
+
}
|
|
26005
|
+
function parseTimezone(timezoneString) {
|
|
26006
|
+
if (timezoneString === 'Z') return 0;
|
|
26007
|
+
var captures = timezoneString.match(timezoneRegex);
|
|
26008
|
+
if (!captures) return 0;
|
|
26009
|
+
var sign = captures[1] === '+' ? -1 : 1;
|
|
26010
|
+
var hours = parseInt(captures[2]);
|
|
26011
|
+
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
26012
|
+
if (!validateTimezone(hours, minutes)) {
|
|
26013
|
+
return NaN;
|
|
26014
|
+
}
|
|
26015
|
+
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
26016
|
+
}
|
|
26017
|
+
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
26018
|
+
var date = new Date(0);
|
|
26019
|
+
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
26020
|
+
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
26021
|
+
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
26022
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
26023
|
+
return date;
|
|
26024
|
+
}
|
|
26025
|
+
|
|
26026
|
+
// Validation functions
|
|
26027
|
+
|
|
26028
|
+
// February is null to handle the leap year (using ||)
|
|
26029
|
+
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
26030
|
+
function isLeapYearIndex(year) {
|
|
26031
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
26032
|
+
}
|
|
26033
|
+
function validateDate(year, month, date) {
|
|
26034
|
+
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
26035
|
+
}
|
|
26036
|
+
function validateDayOfYearDate(year, dayOfYear) {
|
|
26037
|
+
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
26038
|
+
}
|
|
26039
|
+
function validateWeekDate(_year, week, day) {
|
|
26040
|
+
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
26041
|
+
}
|
|
26042
|
+
function validateTime(hours, minutes, seconds) {
|
|
26043
|
+
if (hours === 24) {
|
|
26044
|
+
return minutes === 0 && seconds === 0;
|
|
26045
|
+
}
|
|
26046
|
+
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
26047
|
+
}
|
|
26048
|
+
function validateTimezone(_hours, minutes) {
|
|
26049
|
+
return minutes >= 0 && minutes <= 59;
|
|
26050
|
+
}
|
|
26051
|
+
|
|
25698
26052
|
/** ************************************************ */
|
|
25699
26053
|
/* Object to store a time duration / time interval */
|
|
25700
26054
|
/** ************************************************ */
|
|
@@ -28560,6 +28914,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
28560
28914
|
(_b = this.layers) === null || _b === void 0 ? void 0 : _b.forEach(function (layer) {
|
|
28561
28915
|
var _a;
|
|
28562
28916
|
if (layer.service && layer.enabled && layer.isConfigured) {
|
|
28917
|
+
layer.prefetchImages();
|
|
28563
28918
|
var requestURL = (_a = buildWMSGetMapRequest(_this9, layer)) === null || _a === void 0 ? void 0 : _a.url;
|
|
28564
28919
|
if (requestURL) {
|
|
28565
28920
|
_this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
|
|
@@ -30895,6 +31250,23 @@ var WMGetServiceFromStore = function WMGetServiceFromStore(serviceName) {
|
|
|
30895
31250
|
return service;
|
|
30896
31251
|
};
|
|
30897
31252
|
|
|
31253
|
+
/* *
|
|
31254
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
31255
|
+
* you may not use this file except in compliance with the License.
|
|
31256
|
+
* You may obtain a copy of the License at
|
|
31257
|
+
*
|
|
31258
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
31259
|
+
*
|
|
31260
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
31261
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
31262
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31263
|
+
* See the License for the specific language governing permissions and
|
|
31264
|
+
* limitations under the License.
|
|
31265
|
+
*
|
|
31266
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
31267
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
31268
|
+
* */
|
|
31269
|
+
var _WMLayer_instances, _WMLayer_prefetchImage;
|
|
30898
31270
|
var LayerType;
|
|
30899
31271
|
(function (LayerType) {
|
|
30900
31272
|
LayerType["mapLayer"] = "mapLayer";
|
|
@@ -30909,18 +31281,17 @@ var LayerType;
|
|
|
30909
31281
|
* @param layerDimNamesToRemove A set of dimensions names which are flagged for removal, this function removes the dimension from the set if found in the layer.
|
|
30910
31282
|
*/
|
|
30911
31283
|
var addDimsForLayer = function addDimsForLayer(layerProps, layer, layerDimNamesToRemove) {
|
|
30912
|
-
|
|
30913
|
-
var layerDims = layerProps.dimensions || [];
|
|
31284
|
+
var _a;
|
|
30914
31285
|
/* Loop through all the dims from the WMS GetCapabilities document for this layer */
|
|
30915
|
-
|
|
31286
|
+
(_a = layerProps.dimensions) === null || _a === void 0 ? void 0 : _a.forEach(function (layerDimension) {
|
|
30916
31287
|
/* Obtain layerDim info from the GetCapabilities document and put into a WMSLayerDimInfo object */
|
|
30917
|
-
var dimName = (
|
|
31288
|
+
var dimName = (layerDimension.name || '').toLowerCase();
|
|
30918
31289
|
var layerDim = {
|
|
30919
31290
|
name: dimName,
|
|
30920
|
-
units:
|
|
30921
|
-
unitSymbol:
|
|
30922
|
-
value:
|
|
30923
|
-
"default":
|
|
31291
|
+
units: layerDimension.units || '',
|
|
31292
|
+
unitSymbol: layerDimension.unitSymbol || '',
|
|
31293
|
+
value: layerDimension.values || '',
|
|
31294
|
+
"default": layerDimension.currentValue,
|
|
30924
31295
|
isRefTimeDimension: dimName === 'reference_time'
|
|
30925
31296
|
};
|
|
30926
31297
|
/* Flag that this dim should not be removed from the layer */
|
|
@@ -30961,10 +31332,7 @@ var addDimsForLayer = function addDimsForLayer(layerProps, layer, layerDimNamesT
|
|
|
30961
31332
|
dimensionToUpdate.reInitializeValues(dimensionToUpdate.values);
|
|
30962
31333
|
dimensionToUpdate.setClosestValue(currentValue);
|
|
30963
31334
|
}
|
|
30964
|
-
};
|
|
30965
|
-
for (var d = 0; d < layerDims.length; d += 1) {
|
|
30966
|
-
_loop();
|
|
30967
|
-
}
|
|
31335
|
+
});
|
|
30968
31336
|
};
|
|
30969
31337
|
/**
|
|
30970
31338
|
* Helper function to configure the WMS Styles from the WMS GetCapabilities document.
|
|
@@ -31036,7 +31404,10 @@ var configureGeographicBoundingBox = function configureGeographicBoundingBox(lay
|
|
|
31036
31404
|
};
|
|
31037
31405
|
var WMLayer = /*#__PURE__*/function () {
|
|
31038
31406
|
function WMLayer(options) {
|
|
31407
|
+
var _this = this;
|
|
31039
31408
|
_classCallCheck(this, WMLayer);
|
|
31409
|
+
var _a;
|
|
31410
|
+
_WMLayer_instances.add(this);
|
|
31040
31411
|
this.init = this.init.bind(this);
|
|
31041
31412
|
this.getLayerName = this.getLayerName.bind(this);
|
|
31042
31413
|
this.toggleAutoUpdate = this.toggleAutoUpdate.bind(this);
|
|
@@ -31117,10 +31488,10 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31117
31488
|
if (options.transparent === false) {
|
|
31118
31489
|
this.transparent = false;
|
|
31119
31490
|
}
|
|
31120
|
-
if (options.dimensions
|
|
31121
|
-
|
|
31122
|
-
|
|
31123
|
-
}
|
|
31491
|
+
if ((_a = options.dimensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
31492
|
+
options.dimensions.forEach(function (dimension) {
|
|
31493
|
+
_this.dimensions.push(new WMJSDimension(dimension));
|
|
31494
|
+
});
|
|
31124
31495
|
}
|
|
31125
31496
|
if (isDefined(options.onReady)) {
|
|
31126
31497
|
this.onReady = options.onReady;
|
|
@@ -31182,12 +31553,12 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31182
31553
|
}, {
|
|
31183
31554
|
key: "toggleAutoUpdate",
|
|
31184
31555
|
value: function toggleAutoUpdate() {
|
|
31185
|
-
var
|
|
31556
|
+
var _this2 = this;
|
|
31186
31557
|
this.autoupdate = !this.autoupdate;
|
|
31187
31558
|
if (this.autoupdate) {
|
|
31188
31559
|
var numDeltaMS = 60000;
|
|
31189
31560
|
this.timer = setInterval(function () {
|
|
31190
|
-
|
|
31561
|
+
_this2.parseLayer(undefined, true, 'WMLayer toggleAutoUpdate');
|
|
31191
31562
|
}, numDeltaMS);
|
|
31192
31563
|
} else {
|
|
31193
31564
|
clearInterval(this.timer);
|
|
@@ -31196,14 +31567,14 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31196
31567
|
}, {
|
|
31197
31568
|
key: "setAutoUpdate",
|
|
31198
31569
|
value: function setAutoUpdate(val, interval, callback) {
|
|
31199
|
-
var
|
|
31570
|
+
var _this3 = this;
|
|
31200
31571
|
if (val !== this.autoupdate) {
|
|
31201
31572
|
this.autoupdate = val;
|
|
31202
31573
|
if (!val) {
|
|
31203
31574
|
clearInterval(this.timer);
|
|
31204
31575
|
} else {
|
|
31205
31576
|
this.timer = setInterval(function () {
|
|
31206
|
-
|
|
31577
|
+
_this3.parseLayer(callback, true, 'WMLayer setAutoUpdate');
|
|
31207
31578
|
}, interval);
|
|
31208
31579
|
}
|
|
31209
31580
|
}
|
|
@@ -31262,18 +31633,15 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31262
31633
|
key: "handleReferenceTime",
|
|
31263
31634
|
value: function handleReferenceTime(name, value) {
|
|
31264
31635
|
var updateMapDimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
31265
|
-
if (name
|
|
31266
|
-
|
|
31267
|
-
|
|
31268
|
-
|
|
31269
|
-
|
|
31270
|
-
|
|
31271
|
-
|
|
31272
|
-
|
|
31273
|
-
|
|
31274
|
-
}
|
|
31275
|
-
}
|
|
31276
|
-
}
|
|
31636
|
+
if (name !== 'reference_time') {
|
|
31637
|
+
return;
|
|
31638
|
+
}
|
|
31639
|
+
var timeDim = this.getDimension('time');
|
|
31640
|
+
var referenceTimeDim = this.getDimension(name);
|
|
31641
|
+
if (timeDim) {
|
|
31642
|
+
timeDim.setTimeValuesForReferenceTime(value, referenceTimeDim);
|
|
31643
|
+
if (updateMapDimensions && this.parentMap && this.enabled !== false) {
|
|
31644
|
+
this.parentMap.getListener().triggerEvent('ondimchange', 'time');
|
|
31277
31645
|
}
|
|
31278
31646
|
}
|
|
31279
31647
|
}
|
|
@@ -31289,27 +31657,20 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31289
31657
|
if (!isDefined(value)) {
|
|
31290
31658
|
return;
|
|
31291
31659
|
}
|
|
31292
|
-
var
|
|
31293
|
-
|
|
31294
|
-
});
|
|
31295
|
-
if (dimIndex < 0) {
|
|
31660
|
+
var dim = this.getDimension(name);
|
|
31661
|
+
if (!dim) {
|
|
31296
31662
|
return;
|
|
31297
31663
|
}
|
|
31298
|
-
var dim = this.dimensions[dimIndex];
|
|
31299
31664
|
dim.setValue(value);
|
|
31300
31665
|
this.handleReferenceTime(name, value, updateMapDimensions);
|
|
31301
|
-
if (updateMapDimensions) {
|
|
31302
|
-
|
|
31303
|
-
if (this.parentMap) {
|
|
31304
|
-
this.parentMap.setDimension(name, dim.getValue());
|
|
31305
|
-
}
|
|
31306
|
-
}
|
|
31666
|
+
if (updateMapDimensions && dim.linked === true && this.parentMap) {
|
|
31667
|
+
this.parentMap.setDimension(name, dim.getValue());
|
|
31307
31668
|
}
|
|
31308
31669
|
}
|
|
31309
31670
|
}, {
|
|
31310
31671
|
key: "__parseGetCapForLayer",
|
|
31311
31672
|
value: function __parseGetCapForLayer(getcapabilitiesjson, layerDoneCallback, fail) {
|
|
31312
|
-
var
|
|
31673
|
+
var _this4 = this;
|
|
31313
31674
|
if (!getcapabilitiesjson) {
|
|
31314
31675
|
this.title = I18n.service_has_error.text;
|
|
31315
31676
|
this["abstract"] = I18n.not_available_message.text;
|
|
@@ -31399,36 +31760,36 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31399
31760
|
this.path = '';
|
|
31400
31761
|
// Function will be called when the layer with the right name is found in the getcap doc
|
|
31401
31762
|
var populateLayerFromTreeElement = function populateLayerFromTreeElement(jsonlayer) {
|
|
31402
|
-
|
|
31403
|
-
|
|
31404
|
-
|
|
31763
|
+
_this4.title = jsonlayer.title || jsonlayer.name || '';
|
|
31764
|
+
_this4["abstract"] = jsonlayer["abstract"] || I18n.not_available_message.text;
|
|
31765
|
+
_this4.path = jsonlayer.path.join('/');
|
|
31405
31766
|
/** ***************** Go through styles **************** */
|
|
31406
|
-
configureStyles(jsonlayer,
|
|
31767
|
+
configureStyles(jsonlayer, _this4);
|
|
31407
31768
|
/** ***************** Go through Dimensions **************** */
|
|
31408
|
-
configureDimensions(jsonlayer,
|
|
31769
|
+
configureDimensions(jsonlayer, _this4);
|
|
31409
31770
|
/** ***************** Go through geographicBoundingBox **************** */
|
|
31410
|
-
configureGeographicBoundingBox(jsonlayer,
|
|
31411
|
-
|
|
31771
|
+
configureGeographicBoundingBox(jsonlayer, _this4);
|
|
31772
|
+
_this4.queryable = jsonlayer.queryable || false;
|
|
31412
31773
|
if (jsonlayer.crs) {
|
|
31413
31774
|
jsonlayer.crs.forEach(function (p) {
|
|
31414
31775
|
var wmProjection = new WMProjection();
|
|
31415
31776
|
wmProjection.srs = p.name || '';
|
|
31416
31777
|
if (p.bbox) {
|
|
31417
|
-
var swapBBOX =
|
|
31778
|
+
var swapBBOX = _this4.version === WMSVersion.version130 && wmProjection.srs === 'EPSG:4326' && _this4.wms130bboxcompatibilitymode === false;
|
|
31418
31779
|
if (swapBBOX) {
|
|
31419
31780
|
wmProjection.bbox.setBBOX(p.bbox.bottom, p.bbox.left, p.bbox.top, p.bbox.right);
|
|
31420
31781
|
} else {
|
|
31421
31782
|
wmProjection.bbox.setBBOX(p.bbox.left, p.bbox.bottom, p.bbox.right, p.bbox.top);
|
|
31422
31783
|
}
|
|
31423
31784
|
}
|
|
31424
|
-
|
|
31785
|
+
_this4.projectionProperties.push(wmProjection);
|
|
31425
31786
|
});
|
|
31426
31787
|
}
|
|
31427
31788
|
};
|
|
31428
31789
|
var layerTreeStructure = buildLayerTreeFromNestedWMSLayer(rootLayer);
|
|
31429
31790
|
/* Recursively walk the layertree until a child is found with the corresponding name */
|
|
31430
31791
|
var findTreeNode = function findTreeNode(tree) {
|
|
31431
|
-
if (tree.name ===
|
|
31792
|
+
if (tree.name === _this4.name) {
|
|
31432
31793
|
return tree;
|
|
31433
31794
|
}
|
|
31434
31795
|
if (tree.children) {
|
|
@@ -31473,7 +31834,7 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31473
31834
|
value: function parseLayer(_layerDoneCallback, forceReload,
|
|
31474
31835
|
// eslint-disable-next-line no-unused-vars
|
|
31475
31836
|
origin) {
|
|
31476
|
-
var
|
|
31837
|
+
var _this5 = this;
|
|
31477
31838
|
this.hasError = false;
|
|
31478
31839
|
var layerDoneCallback = function layerDoneCallback(__layer) {
|
|
31479
31840
|
if (isDefined(_layerDoneCallback)) {
|
|
@@ -31488,19 +31849,19 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31488
31849
|
}
|
|
31489
31850
|
};
|
|
31490
31851
|
var fail = function fail(_layer, message) {
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31852
|
+
_this5.hasError = true;
|
|
31853
|
+
_this5.lastError = message;
|
|
31854
|
+
_this5.title = I18n.service_has_error.text;
|
|
31494
31855
|
layerDoneCallback(_layer);
|
|
31495
|
-
if (isDefined(
|
|
31496
|
-
|
|
31856
|
+
if (isDefined(_this5._options.failure)) {
|
|
31857
|
+
_this5._options.failure(_layer, message);
|
|
31497
31858
|
}
|
|
31498
31859
|
};
|
|
31499
31860
|
var callback = function callback(data) {
|
|
31500
|
-
|
|
31861
|
+
_this5.__parseGetCapForLayer(data, layerDoneCallback, fail);
|
|
31501
31862
|
};
|
|
31502
31863
|
var requestfail = function requestfail() {
|
|
31503
|
-
fail(
|
|
31864
|
+
fail(_this5, I18n.no_capability_element_found.text);
|
|
31504
31865
|
};
|
|
31505
31866
|
var options = {
|
|
31506
31867
|
headers: {}
|
|
@@ -31523,10 +31884,10 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31523
31884
|
}, {
|
|
31524
31885
|
key: "parseLayerPromise",
|
|
31525
31886
|
value: function parseLayerPromise() {
|
|
31526
|
-
var
|
|
31887
|
+
var _this6 = this;
|
|
31527
31888
|
var forceReload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
31528
31889
|
return new Promise(function (resolve, reject) {
|
|
31529
|
-
|
|
31890
|
+
_this6.parseLayer(function (layer) {
|
|
31530
31891
|
if (layer.hasError === true) {
|
|
31531
31892
|
debug(DebugType.Error, "[ERROR] Parse layer failed, Reason [".concat(layer.lastError, "]"));
|
|
31532
31893
|
reject(layer);
|
|
@@ -31631,13 +31992,9 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31631
31992
|
}, {
|
|
31632
31993
|
key: "getDimension",
|
|
31633
31994
|
value: function getDimension(name) {
|
|
31634
|
-
|
|
31995
|
+
return this.dimensions.find(function (dim) {
|
|
31635
31996
|
return dim.name === name;
|
|
31636
31997
|
});
|
|
31637
|
-
if (dimIndex < 0) {
|
|
31638
|
-
return undefined;
|
|
31639
|
-
}
|
|
31640
|
-
return this.dimensions[dimIndex];
|
|
31641
31998
|
}
|
|
31642
31999
|
/**
|
|
31643
32000
|
* Returns the Coordinate Reference Systems for this layer
|
|
@@ -31707,9 +32064,51 @@ var WMLayer = /*#__PURE__*/function () {
|
|
|
31707
32064
|
this.parentMap.displayLayer(this, this.enabled);
|
|
31708
32065
|
}
|
|
31709
32066
|
}
|
|
32067
|
+
}, {
|
|
32068
|
+
key: "prefetchImages",
|
|
32069
|
+
value: function prefetchImages() {
|
|
32070
|
+
var _this7 = this;
|
|
32071
|
+
var timeDimension = this.getDimension('time');
|
|
32072
|
+
if (!timeDimension) {
|
|
32073
|
+
return;
|
|
32074
|
+
}
|
|
32075
|
+
var currentTime = timeDimension.currentValue;
|
|
32076
|
+
var currentTimeIndex = timeDimension.getIndexForValue(currentTime);
|
|
32077
|
+
var lastIndex = timeDimension.size();
|
|
32078
|
+
if (currentTimeIndex < 0 || lastIndex <= 0) {
|
|
32079
|
+
return;
|
|
32080
|
+
}
|
|
32081
|
+
var COUNT_IMAGES_TO_PRELOAD_BEFORE_AND_AFTER_CURRENT_TIME = 10;
|
|
32082
|
+
lodash.exports.range(1, COUNT_IMAGES_TO_PRELOAD_BEFORE_AND_AFTER_CURRENT_TIME).forEach(function (offset) {
|
|
32083
|
+
var nextImageIndex = currentTimeIndex + offset;
|
|
32084
|
+
if (nextImageIndex < lastIndex) {
|
|
32085
|
+
__classPrivateFieldGet(_this7, _WMLayer_instances, "m", _WMLayer_prefetchImage).call(_this7, timeDimension, nextImageIndex, currentTime);
|
|
32086
|
+
}
|
|
32087
|
+
var previousImageIndex = currentTimeIndex - offset;
|
|
32088
|
+
if (previousImageIndex >= 0) {
|
|
32089
|
+
__classPrivateFieldGet(_this7, _WMLayer_instances, "m", _WMLayer_prefetchImage).call(_this7, timeDimension, previousImageIndex, currentTime);
|
|
32090
|
+
}
|
|
32091
|
+
});
|
|
32092
|
+
}
|
|
31710
32093
|
}]);
|
|
31711
32094
|
return WMLayer;
|
|
31712
32095
|
}();
|
|
32096
|
+
_WMLayer_instances = new WeakSet(), _WMLayer_prefetchImage = function _WMLayer_prefetchImage(timeDimension, index, currentTime) {
|
|
32097
|
+
var time = timeDimension.getValueForIndex(index);
|
|
32098
|
+
var timeIsNotAValidIsoString = typeof time !== 'string' || !isValid(parseISO(time));
|
|
32099
|
+
if (timeIsNotAValidIsoString) {
|
|
32100
|
+
return;
|
|
32101
|
+
}
|
|
32102
|
+
timeDimension.setValue(time);
|
|
32103
|
+
var request = buildWMSGetMapRequest(this.parentMap, this);
|
|
32104
|
+
if (request) {
|
|
32105
|
+
var image = getMapImageStore.getImage(request.url);
|
|
32106
|
+
if (image.hasNotStartedLoading()) {
|
|
32107
|
+
image.load();
|
|
32108
|
+
}
|
|
32109
|
+
}
|
|
32110
|
+
timeDimension.setValue(currentTime);
|
|
32111
|
+
};
|
|
31713
32112
|
|
|
31714
32113
|
/* *
|
|
31715
32114
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -31888,13 +32287,7 @@ var defaultReduxLayerRadarColor = {
|
|
|
31888
32287
|
enabled: true,
|
|
31889
32288
|
layerType: LayerType.mapLayer,
|
|
31890
32289
|
dimensions: [],
|
|
31891
|
-
|
|
31892
|
-
title: 'rainbow/nearest',
|
|
31893
|
-
name: 'rainbow/nearest',
|
|
31894
|
-
legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RAD_NL25_PCP_CM&format=image/png&STYLE=precip-rainbow/nearest',
|
|
31895
|
-
"abstract": 'No abstract available'
|
|
31896
|
-
}],
|
|
31897
|
-
id: 'layerid_1'
|
|
32290
|
+
id: generateLayerId()
|
|
31898
32291
|
};
|
|
31899
32292
|
var multiDimensionLayer = {
|
|
31900
32293
|
service: 'https://testservice',
|
|
@@ -32931,4 +33324,4 @@ var getCapabilities = /*#__PURE__*/Object.freeze({
|
|
|
32931
33324
|
getLayersFlattenedFromService: getLayersFlattenedFromService
|
|
32932
33325
|
});
|
|
32933
33326
|
|
|
32934
|
-
export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, clearImageCache, debug, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, tilesettings, toArray, testSettings as webmapTestSettings, utils as webmapUtils };
|
|
33327
|
+
export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, clearImageCache, debug, generateLayerId, generateMapId, generateTimesliderId, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, utils as webmapUtils };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "GeoWeb webmap library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
"main": "./index.esm.js",
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@opengeoweb/shared": "
|
|
15
|
+
"@opengeoweb/shared": "8.0.0",
|
|
16
16
|
"date-fns": "2.30.0",
|
|
17
|
+
"immer": "9.0.21",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type WMJSMap from './WMJSMap';
|
|
2
|
-
import WMLayer from './WMLayer';
|
|
2
|
+
import type WMLayer from './WMLayer';
|
|
3
3
|
export declare const getBBOXandProjString: (map: WMJSMap, layer: WMLayer) => string;
|
|
4
4
|
export declare const buildWMSGetMapRequest: (map: WMJSMap, layer: WMLayer) => {
|
|
5
5
|
url: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -65,6 +65,7 @@ export declare const configureStyles: (layerProps: LayerProps, wmLayer: WMLayer)
|
|
|
65
65
|
export declare const configureDimensions: (layerProps: LayerProps, wmLayer: WMLayer) => void;
|
|
66
66
|
export declare const configureGeographicBoundingBox: (layerProps: LayerProps, wmLayer: WMLayer) => void;
|
|
67
67
|
export default class WMLayer {
|
|
68
|
+
#private;
|
|
68
69
|
id: string;
|
|
69
70
|
name?: string;
|
|
70
71
|
ReactWMJSLayerId?: string;
|
|
@@ -162,7 +163,7 @@ export default class WMLayer {
|
|
|
162
163
|
*/
|
|
163
164
|
getStyleObject(styleName: string, nextPrev: number): Style;
|
|
164
165
|
getStyle(): string;
|
|
165
|
-
getDimension(name: string): WMJSDimension;
|
|
166
|
+
getDimension(name: string): WMJSDimension | undefined;
|
|
166
167
|
/**
|
|
167
168
|
* Returns the Coordinate Reference Systems for this layer
|
|
168
169
|
* @returns List of WMProjection objects
|
|
@@ -184,4 +185,5 @@ export default class WMLayer {
|
|
|
184
185
|
getProjection(srsName: string): WMProjection;
|
|
185
186
|
setSLDURL(url: string): void;
|
|
186
187
|
display(displayornot: boolean): void;
|
|
188
|
+
prefetchImages(): void;
|
|
187
189
|
}
|
|
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
|
package/src/lib/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
|
package/src/lib/utils/index.d.ts
CHANGED
|
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
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
import { CoordinateReferenceSystem, Dimension, LayerFoundation, LayerOptions,
|
|
2
|
-
export declare const defaultReduxLayerRadarColor:
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
title: string;
|
|
6
|
-
format: string;
|
|
7
|
-
style: string;
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
layerType: LayerType;
|
|
10
|
-
dimensions: never[];
|
|
11
|
-
styles: {
|
|
12
|
-
title: string;
|
|
13
|
-
name: string;
|
|
14
|
-
legendURL: string;
|
|
15
|
-
abstract: string;
|
|
16
|
-
}[];
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const multiDimensionLayer: LayerFoundation;
|
|
1
|
+
import { CoordinateReferenceSystem, Dimension, LayerFoundation, LayerOptions, Style, WMLayer } from '../components';
|
|
2
|
+
export declare const defaultReduxLayerRadarColor: LayerOptions;
|
|
3
|
+
export declare const multiDimensionLayer: LayerOptions;
|
|
20
4
|
export declare const WmdefaultReduxLayerRadarKNMI: WMLayer;
|
|
21
5
|
export declare const defaultReduxLayerRadarKNMI: LayerFoundation & {
|
|
22
6
|
styles: Style[];
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import { LayerType } from '../components/WMLayer';
|
|
2
|
-
export declare const defaultReduxLayerRadarKNMI:
|
|
3
|
-
service: string;
|
|
4
|
-
name: string;
|
|
5
|
-
title: string;
|
|
6
|
-
format: string;
|
|
7
|
-
style: string;
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
layerType: LayerType;
|
|
10
|
-
dimensions: {
|
|
11
|
-
name: string;
|
|
12
|
-
units: string;
|
|
13
|
-
currentValue: string;
|
|
14
|
-
}[];
|
|
15
|
-
id: string;
|
|
16
|
-
};
|
|
1
|
+
import { LayerOptions, LayerType } from '../components/WMLayer';
|
|
2
|
+
export declare const defaultReduxLayerRadarKNMI: LayerOptions;
|
|
17
3
|
export declare const multiDimensionLayer: {
|
|
18
4
|
service: string;
|
|
19
5
|
id: string;
|
|
File without changes
|
package/src/lib/utils/utils.d.ts
CHANGED
|
File without changes
|
|
File without changes
|