@opengeoweb/webmap 9.3.1 → 9.4.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/index.esm.js +188 -160
- package/package.json +1 -1
- package/src/lib/components/WMAnimate.d.ts +2 -0
- package/src/lib/components/WMCanvasBuffer.d.ts +4 -0
- package/src/lib/components/WMConstants.d.ts +1 -0
- package/src/lib/components/WMImageStore.d.ts +2 -2
- package/src/lib/components/WMJSMap.d.ts +4 -9
- package/src/lib/components/WMJSMapHelpers.d.ts +2 -1
- package/src/lib/components/WMJSTools.d.ts +1 -1
- package/src/lib/components/WMPrefetch.d.ts +1 -1
- package/src/lib/components/index.d.ts +1 -2
- package/src/lib/utils/tilesettings.d.ts +2 -1
package/index.esm.js
CHANGED
|
@@ -490,7 +490,7 @@ var WMSVersion = {
|
|
|
490
490
|
version111: '1.1.1',
|
|
491
491
|
version130: '1.3.0'
|
|
492
492
|
};
|
|
493
|
-
var WMProj4Defs = [['EPSG:4326', '+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees'], ['EPSG:4269', '+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees'], ['EPSG:3575', '+proj=laea +lat_0=90 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'], ['EPSG:3785', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'], ['EPSG:3857', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'], ['EPSG:3411', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'], ['EPSG:3412', '+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'], ['EPSG:28992', '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs <>'], ['EPSG:32661', '+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'], ['EPSG:102100', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs']];
|
|
493
|
+
var WMProj4Defs = [['EPSG:4326', '+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees'], ['EPSG:4269', '+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees'], ['EPSG:3575', '+proj=laea +lat_0=90 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'], ['EPSG:3785', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'], ['EPSG:3857', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'], ['EPSG:3411', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'], ['EPSG:3412', '+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'], ['EPSG:28992', '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs <>'], ['EPSG:32661', '+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'], ['EPSG:102100', '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'], ['EPSG:3067', '+proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs']];
|
|
494
494
|
var mapImageStoreLength = 1000;
|
|
495
495
|
var bgImageStoreLength = 360;
|
|
496
496
|
var legendImageStoreLength = 500;
|
|
@@ -675,10 +675,14 @@ var getCorrectWMSDimName = function getCorrectWMSDimName(origDimName) {
|
|
|
675
675
|
return "DIM_".concat(upperCaseDimName);
|
|
676
676
|
};
|
|
677
677
|
/* Returns all dimensions with its current values as URL */
|
|
678
|
-
var getMapDimURL = function getMapDimURL(layer) {
|
|
678
|
+
var getMapDimURL = function getMapDimURL(layer, dimensionOverride) {
|
|
679
679
|
var request = '';
|
|
680
|
-
layer.dimensions.forEach(function (
|
|
681
|
-
var
|
|
680
|
+
layer.dimensions.forEach(function (layerDimension) {
|
|
681
|
+
var overrideDim = dimensionOverride && dimensionOverride.find(function (d) {
|
|
682
|
+
return d.name === layerDimension.name;
|
|
683
|
+
});
|
|
684
|
+
var dimension = layerDimension;
|
|
685
|
+
var currentValue = overrideDim && dimension.getClosestValue(overrideDim.currentValue, true) || dimension.currentValue;
|
|
682
686
|
request += "&".concat(getCorrectWMSDimName(dimension.name));
|
|
683
687
|
request += "=".concat(URLEncode(currentValue));
|
|
684
688
|
if (currentValue === WMDateOutSideRange || currentValue === WMDateTooEarlyString || currentValue === WMDateTooLateString) {
|
|
@@ -1303,7 +1307,7 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1303
1307
|
*/
|
|
1304
1308
|
function WMImageStore(maxNumberOfImages, options) {
|
|
1305
1309
|
_classCallCheck(this, WMImageStore);
|
|
1306
|
-
this.imagesbysrc =
|
|
1310
|
+
this.imagesbysrc = new Map();
|
|
1307
1311
|
this.imageLife = 0;
|
|
1308
1312
|
this._imageLifeCounter = 0;
|
|
1309
1313
|
this._loadEventCallbackList = []; // Array of callbacks, as multiple instances can register listeners
|
|
@@ -1337,18 +1341,15 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1337
1341
|
}, {
|
|
1338
1342
|
key: "getImageForSrc",
|
|
1339
1343
|
value: function getImageForSrc(src) {
|
|
1340
|
-
|
|
1341
|
-
return this.imagesbysrc[src];
|
|
1342
|
-
}
|
|
1343
|
-
return undefined;
|
|
1344
|
+
return this.imagesbysrc.get(src);
|
|
1344
1345
|
}
|
|
1345
1346
|
}, {
|
|
1346
1347
|
key: "clear",
|
|
1347
1348
|
value: function clear() {
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
_this.imagesbysrc[property].clear();
|
|
1349
|
+
this.imagesbysrc.forEach(function (wmImage) {
|
|
1350
|
+
wmImage.clear();
|
|
1351
1351
|
});
|
|
1352
|
+
this.imagesbysrc.clear();
|
|
1352
1353
|
}
|
|
1353
1354
|
}, {
|
|
1354
1355
|
key: "addImageEventCallback",
|
|
@@ -1383,10 +1384,9 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1383
1384
|
}, {
|
|
1384
1385
|
key: "getNumImagesLoading",
|
|
1385
1386
|
value: function getNumImagesLoading() {
|
|
1386
|
-
var _this2 = this;
|
|
1387
1387
|
var numLoading = 0;
|
|
1388
|
-
|
|
1389
|
-
if (
|
|
1388
|
+
this.imagesbysrc.forEach(function (value) {
|
|
1389
|
+
if (value._isLoading) {
|
|
1390
1390
|
numLoading += 1;
|
|
1391
1391
|
}
|
|
1392
1392
|
});
|
|
@@ -1400,7 +1400,7 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1400
1400
|
}, {
|
|
1401
1401
|
key: "getImage",
|
|
1402
1402
|
value: function getImage(src, loadOptions) {
|
|
1403
|
-
var
|
|
1403
|
+
var _this = this;
|
|
1404
1404
|
if (!src) {
|
|
1405
1405
|
return null;
|
|
1406
1406
|
}
|
|
@@ -1411,13 +1411,13 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1411
1411
|
image.imageLife = this._imageLifeCounter;
|
|
1412
1412
|
return image;
|
|
1413
1413
|
}
|
|
1414
|
-
|
|
1415
|
-
if (
|
|
1414
|
+
// Create image
|
|
1415
|
+
if (this.imagesbysrc.size < this._maxNumberOfImages) {
|
|
1416
1416
|
image = new WMImage(src, function (img) {
|
|
1417
|
-
|
|
1417
|
+
_this.imageLoadEventCallback(img, WMImageEventType.Loaded);
|
|
1418
1418
|
});
|
|
1419
1419
|
image.setSource(src, loadOptions);
|
|
1420
|
-
this.imagesbysrc
|
|
1420
|
+
this.imagesbysrc.set(src, image);
|
|
1421
1421
|
this._imageLifeCounter += 1;
|
|
1422
1422
|
image.imageLife = this._imageLifeCounter;
|
|
1423
1423
|
return image;
|
|
@@ -1425,28 +1425,29 @@ var WMImageStore = /*#__PURE__*/function () {
|
|
|
1425
1425
|
/* We have to reuse an image */
|
|
1426
1426
|
var imageId = '';
|
|
1427
1427
|
var minImageLife = this._imageLifeCounter;
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
if (img.isLoading() === false) {
|
|
1431
|
-
// && img.isLoaded() === true) {
|
|
1428
|
+
this.imagesbysrc.forEach(function (img, url) {
|
|
1429
|
+
if (img && img.isLoading() === false || img && img.hasError() === true) {
|
|
1432
1430
|
if (minImageLife >= img.imageLife) {
|
|
1433
1431
|
minImageLife = img.imageLife;
|
|
1434
|
-
imageId =
|
|
1432
|
+
imageId = url;
|
|
1435
1433
|
}
|
|
1436
1434
|
}
|
|
1437
1435
|
});
|
|
1438
1436
|
if (imageId === '') {
|
|
1439
1437
|
return this.emptyImage;
|
|
1440
1438
|
}
|
|
1441
|
-
image = this.imagesbysrc
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1439
|
+
image = this.imagesbysrc.get(imageId);
|
|
1440
|
+
if (image) {
|
|
1441
|
+
this.imagesbysrc["delete"](imageId);
|
|
1442
|
+
this.imageLoadEventCallback(image, WMImageEventType.Deleted);
|
|
1443
|
+
image.clear();
|
|
1444
|
+
image.setSource(src, loadOptions);
|
|
1445
|
+
this.imagesbysrc.set(src, image);
|
|
1446
|
+
this._imageLifeCounter += 1;
|
|
1447
|
+
image.imageLife = this._imageLifeCounter;
|
|
1448
|
+
return image;
|
|
1449
|
+
}
|
|
1450
|
+
return null;
|
|
1450
1451
|
}
|
|
1451
1452
|
}]);
|
|
1452
1453
|
return WMImageStore;
|
|
@@ -1710,51 +1711,9 @@ var WMListener = /*#__PURE__*/function () {
|
|
|
1710
1711
|
return WMListener;
|
|
1711
1712
|
}();
|
|
1712
1713
|
|
|
1713
|
-
/* *
|
|
1714
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1715
|
-
* you may not use this file except in compliance with the License.
|
|
1716
|
-
* You may obtain a copy of the License at
|
|
1717
|
-
*
|
|
1718
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1719
|
-
*
|
|
1720
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1721
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1722
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1723
|
-
* See the License for the specific language governing permissions and
|
|
1724
|
-
* limitations under the License.
|
|
1725
|
-
*
|
|
1726
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1727
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
1728
|
-
* */
|
|
1729
|
-
/**
|
|
1730
|
-
* Set the length of the timer, in milli seconds, after time has elapsed function is called
|
|
1731
|
-
* @param secstime Time in milli seconds
|
|
1732
|
-
* @param functionhandler Function to call after time is elapsed
|
|
1733
|
-
*/
|
|
1734
|
-
var WMTimer = /*#__PURE__*/function () {
|
|
1735
|
-
function WMTimer() {
|
|
1736
|
-
_classCallCheck(this, WMTimer);
|
|
1737
|
-
this.timer = null;
|
|
1738
|
-
}
|
|
1739
|
-
_createClass(WMTimer, [{
|
|
1740
|
-
key: "init",
|
|
1741
|
-
value: function init(delayInMiliseconds, callback) {
|
|
1742
|
-
this.stop();
|
|
1743
|
-
this.timer = setTimeout(callback, delayInMiliseconds);
|
|
1744
|
-
}
|
|
1745
|
-
}, {
|
|
1746
|
-
key: "stop",
|
|
1747
|
-
value: function stop() {
|
|
1748
|
-
if (this.timer) {
|
|
1749
|
-
clearTimeout(this.timer);
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
}]);
|
|
1753
|
-
return WMTimer;
|
|
1754
|
-
}();
|
|
1755
|
-
|
|
1756
1714
|
/* Global variable, shared across multiple WMCanvasBuffers */
|
|
1757
1715
|
var sharedImagesList = {};
|
|
1716
|
+
var ANIMATIONFRAMEREQUEST_DONE = -1;
|
|
1758
1717
|
/**
|
|
1759
1718
|
* Function to find image url's which are similar to other images, without taking width, height and bbox into account
|
|
1760
1719
|
* @param imageSource The source / url of the image to check
|
|
@@ -1897,6 +1856,7 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
1897
1856
|
}
|
|
1898
1857
|
}, 'WMCanvasBuffer');
|
|
1899
1858
|
this._errorList = [];
|
|
1859
|
+
this.animationFrameRequest = ANIMATIONFRAMEREQUEST_DONE;
|
|
1900
1860
|
}
|
|
1901
1861
|
_createClass(WMCanvasBuffer, [{
|
|
1902
1862
|
key: "getCanvasContext",
|
|
@@ -1971,7 +1931,26 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
1971
1931
|
key: "display",
|
|
1972
1932
|
value: function display() {
|
|
1973
1933
|
var _this2 = this;
|
|
1934
|
+
// Check if the response from window.requestAnimationFrame is set. If this is the case, debounce the next display.
|
|
1935
|
+
if (this.animationFrameRequest !== ANIMATIONFRAMEREQUEST_DONE) {
|
|
1936
|
+
clearTimeout(this.timerHandle);
|
|
1937
|
+
this.timerHandle = setTimeout(function () {
|
|
1938
|
+
_this2._display();
|
|
1939
|
+
}, 100);
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
// Display the next frame based on window.requestAnimationFrame, e.g. when the screen is ready to display.
|
|
1943
|
+
this.animationFrameRequest = window.requestAnimationFrame(function () {
|
|
1944
|
+
_this2._display();
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
}, {
|
|
1948
|
+
key: "_display",
|
|
1949
|
+
value: function _display() {
|
|
1950
|
+
var _this3 = this;
|
|
1974
1951
|
var _a, _b, _c, _d, _e, _f;
|
|
1952
|
+
// Frame is displayed, so reset animationFrameRequest back to default.
|
|
1953
|
+
this.animationFrameRequest = ANIMATIONFRAMEREQUEST_DONE;
|
|
1975
1954
|
this._ctx.globalAlpha = 1;
|
|
1976
1955
|
this._ctx.fillStyle = 'white';
|
|
1977
1956
|
this._ctx.beginPath();
|
|
@@ -1984,10 +1963,10 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
1984
1963
|
/* Reset errors */
|
|
1985
1964
|
this._errorList.length = 0;
|
|
1986
1965
|
this.layers.forEach(function (layer) {
|
|
1987
|
-
var imageToDisplay =
|
|
1966
|
+
var imageToDisplay = _this3._imageStore.getImageForSrc(layer.imageSource);
|
|
1988
1967
|
if (imageToDisplay === null || imageToDisplay === void 0 ? void 0 : imageToDisplay.isLoadedWithoutErrors()) {
|
|
1989
1968
|
// Draw this image, it is loaded and OK
|
|
1990
|
-
|
|
1969
|
+
_this3._drawImage(layer);
|
|
1991
1970
|
return;
|
|
1992
1971
|
}
|
|
1993
1972
|
/**
|
|
@@ -1998,9 +1977,9 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
1998
1977
|
imageToDisplay.forceReload();
|
|
1999
1978
|
}
|
|
2000
1979
|
/* Find closest alternative and display instead image */
|
|
2001
|
-
var im = getAlternativeImage(layer.imageSource,
|
|
1980
|
+
var im = getAlternativeImage(layer.imageSource, _this3._imageStore, _this3._currentnewbbox);
|
|
2002
1981
|
if (im) {
|
|
2003
|
-
|
|
1982
|
+
_this3._drawImage(im);
|
|
2004
1983
|
}
|
|
2005
1984
|
});
|
|
2006
1985
|
this._ctx.globalAlpha = 1;
|
|
@@ -2024,7 +2003,7 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
|
|
|
2024
2003
|
this.ready = true;
|
|
2025
2004
|
for (var j = 0; j < this.layers.length; j += 1) {
|
|
2026
2005
|
var image = this._imageStore.getImageForSrc(this.layers[j].imageSource);
|
|
2027
|
-
if (image.hasError()) {
|
|
2006
|
+
if (image && image.hasError()) {
|
|
2028
2007
|
debugLogger(DebugType.Error, "image error: ".concat(image.getSrc()));
|
|
2029
2008
|
}
|
|
2030
2009
|
}
|
|
@@ -2156,7 +2135,7 @@ function prefetchLayerImagesInOrderWithUrls(animationStepsInOrder, maxImagesToPr
|
|
|
2156
2135
|
_iterator.f();
|
|
2157
2136
|
}
|
|
2158
2137
|
}
|
|
2159
|
-
function prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPrefetch
|
|
2138
|
+
function prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPrefetch) {
|
|
2160
2139
|
var _iterator2 = _createForOfIteratorHelper(timesToPrefetchInOrder),
|
|
2161
2140
|
_step2;
|
|
2162
2141
|
try {
|
|
@@ -2167,7 +2146,7 @@ function prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPr
|
|
|
2167
2146
|
if (countImagesLoading > maxImagesToPrefetch - 1) {
|
|
2168
2147
|
break;
|
|
2169
2148
|
}
|
|
2170
|
-
var layersImageUrls = getLayersImageUrlsForTime(wmMap, timeToPrefetch
|
|
2149
|
+
var layersImageUrls = getLayersImageUrlsForTime(wmMap, timeToPrefetch);
|
|
2171
2150
|
prefetchLayerImagesForTime(layersImageUrls);
|
|
2172
2151
|
}
|
|
2173
2152
|
} catch (err) {
|
|
@@ -2176,12 +2155,11 @@ function prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPr
|
|
|
2176
2155
|
_iterator2.f();
|
|
2177
2156
|
}
|
|
2178
2157
|
}
|
|
2179
|
-
function getLayersImageUrlsForTime(wmMap, timeToPrefetch
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
wmMap.setTimeDimension(currentTime, false);
|
|
2158
|
+
function getLayersImageUrlsForTime(wmMap, timeToPrefetch) {
|
|
2159
|
+
var layersImageUrls = wmMap.getWMSRequests([{
|
|
2160
|
+
name: 'time',
|
|
2161
|
+
currentValue: timeToPrefetch
|
|
2162
|
+
}]);
|
|
2185
2163
|
return layersImageUrls;
|
|
2186
2164
|
}
|
|
2187
2165
|
function prefetchLayerImagesForTime(requests) {
|
|
@@ -2216,9 +2194,52 @@ function prefetchImagesForNonAnimation(wmMap) {
|
|
|
2216
2194
|
var previousTime = sub(currentTime, duration).toISOString();
|
|
2217
2195
|
return [nextTime, previousTime];
|
|
2218
2196
|
});
|
|
2219
|
-
prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPrefetch
|
|
2197
|
+
prefetchLayerImagesInOrder(wmMap, timesToPrefetchInOrder, maxImagesToPrefetch);
|
|
2220
2198
|
}
|
|
2221
2199
|
|
|
2200
|
+
/* *
|
|
2201
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2202
|
+
* you may not use this file except in compliance with the License.
|
|
2203
|
+
* You may obtain a copy of the License at
|
|
2204
|
+
*
|
|
2205
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2206
|
+
*
|
|
2207
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2208
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2209
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2210
|
+
* See the License for the specific language governing permissions and
|
|
2211
|
+
* limitations under the License.
|
|
2212
|
+
*
|
|
2213
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2214
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
2215
|
+
* */
|
|
2216
|
+
/**
|
|
2217
|
+
* Set the length of the timer, in milli seconds, after time has elapsed function is called
|
|
2218
|
+
* @param secstime Time in milli seconds
|
|
2219
|
+
* @param functionhandler Function to call after time is elapsed
|
|
2220
|
+
*/
|
|
2221
|
+
var WMTimer = /*#__PURE__*/function () {
|
|
2222
|
+
function WMTimer() {
|
|
2223
|
+
_classCallCheck(this, WMTimer);
|
|
2224
|
+
this.timer = null;
|
|
2225
|
+
}
|
|
2226
|
+
_createClass(WMTimer, [{
|
|
2227
|
+
key: "init",
|
|
2228
|
+
value: function init(delayInMiliseconds, callback) {
|
|
2229
|
+
this.stop();
|
|
2230
|
+
this.timer = setTimeout(callback, delayInMiliseconds);
|
|
2231
|
+
}
|
|
2232
|
+
}, {
|
|
2233
|
+
key: "stop",
|
|
2234
|
+
value: function stop() {
|
|
2235
|
+
if (this.timer) {
|
|
2236
|
+
clearTimeout(this.timer);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
}]);
|
|
2240
|
+
return WMTimer;
|
|
2241
|
+
}();
|
|
2242
|
+
|
|
2222
2243
|
/* *
|
|
2223
2244
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2224
2245
|
* you may not use this file except in compliance with the License.
|
|
@@ -2270,6 +2291,7 @@ var WMJSAnimate = /*#__PURE__*/function () {
|
|
|
2270
2291
|
this.loopAnimation = this.loopAnimation.bind(this);
|
|
2271
2292
|
this.stopAnimating = this.stopAnimating.bind(this);
|
|
2272
2293
|
_map.stopAnimating = this.stopAnimating;
|
|
2294
|
+
this.animationTimer = new WMTimer();
|
|
2273
2295
|
}
|
|
2274
2296
|
_createClass(WMJSAnimate, [{
|
|
2275
2297
|
key: "isCurrentAnimationTimeCloseToWallClockTime",
|
|
@@ -2313,7 +2335,7 @@ var WMJSAnimate = /*#__PURE__*/function () {
|
|
|
2313
2335
|
animationDelay *= 5;
|
|
2314
2336
|
}
|
|
2315
2337
|
// set up timer for next animation step
|
|
2316
|
-
this.
|
|
2338
|
+
this.animationTimer.init(animationDelay, this.loopAnimation);
|
|
2317
2339
|
prefetchImagesForAnimation(this._map);
|
|
2318
2340
|
if (this._map.mouseHoverAnimationBox !== false) {
|
|
2319
2341
|
return;
|
|
@@ -2324,7 +2346,7 @@ var WMJSAnimate = /*#__PURE__*/function () {
|
|
|
2324
2346
|
nextAnimationStepIndex = 0;
|
|
2325
2347
|
}
|
|
2326
2348
|
// get urls for images in next animation step
|
|
2327
|
-
var layersImageUrls = getLayersImageUrlsForTime(this._map, animationSteps[nextAnimationStepIndex].value
|
|
2349
|
+
var layersImageUrls = getLayersImageUrlsForTime(this._map, animationSteps[nextAnimationStepIndex].value);
|
|
2328
2350
|
// if images for next animation step is ready or haven't started loading
|
|
2329
2351
|
// change map animation step to next step
|
|
2330
2352
|
var numberOfImagesReadyForNextAnimationStep = 0;
|
|
@@ -2361,7 +2383,7 @@ var WMJSAnimate = /*#__PURE__*/function () {
|
|
|
2361
2383
|
this._map._animationList = undefined;
|
|
2362
2384
|
this._divAnimationInfo.style.display = 'none';
|
|
2363
2385
|
this._map.isAnimating = false;
|
|
2364
|
-
this.
|
|
2386
|
+
this.animateBusy = false;
|
|
2365
2387
|
this._map.rebuildMapDimensions();
|
|
2366
2388
|
this._callBack.triggerEvent('onstopanimation', this._map);
|
|
2367
2389
|
}
|
|
@@ -2372,7 +2394,7 @@ _WMJSAnimate_instances = new WeakSet(), _WMJSAnimate_animate = function _WMJSAni
|
|
|
2372
2394
|
if (this._map.isAnimating === false) {
|
|
2373
2395
|
return;
|
|
2374
2396
|
}
|
|
2375
|
-
if (this.
|
|
2397
|
+
if (this.animateBusy === true) {
|
|
2376
2398
|
return;
|
|
2377
2399
|
}
|
|
2378
2400
|
var animationStep = this._map.animationList[this._map.currentAnimationStep];
|
|
@@ -2384,7 +2406,7 @@ _WMJSAnimate_instances = new WeakSet(), _WMJSAnimate_animate = function _WMJSAni
|
|
|
2384
2406
|
this._callBack.triggerEvent('ondimchange');
|
|
2385
2407
|
this._callBack.triggerEvent('onnextanimationstep', this._map);
|
|
2386
2408
|
this._map.addLayersToCanvasAndDisplayThem();
|
|
2387
|
-
this.
|
|
2409
|
+
this.animateBusy = false;
|
|
2388
2410
|
};
|
|
2389
2411
|
|
|
2390
2412
|
var WMTileRenderer = /*#__PURE__*/function () {
|
|
@@ -3103,7 +3125,7 @@ var ParseISOTimeRangeDuration = /*#__PURE__*/function () {
|
|
|
3103
3125
|
_classCallCheck(this, ParseISOTimeRangeDuration);
|
|
3104
3126
|
this.initialized = false;
|
|
3105
3127
|
var times = isoTimeRangeDuration.split('/');
|
|
3106
|
-
//
|
|
3128
|
+
// Add safety checks for undefined elements
|
|
3107
3129
|
if (times[2] === undefined) {
|
|
3108
3130
|
times[2] = 'PT1M';
|
|
3109
3131
|
}
|
|
@@ -3437,7 +3459,6 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
3437
3459
|
this._type = 'timestartstopres';
|
|
3438
3460
|
this._timeRangeDurationDate = new ParseISOTimeRangeDuration(ogcdimvalues);
|
|
3439
3461
|
} else {
|
|
3440
|
-
// TODO Parse 2007-03-27T00:00:00.000Z/2007-03-31T00:00:00.000Z/PT1H,2007-04-07T00:00:00.000Z/2007-04-11T00:00:00.000Z/PT1H
|
|
3441
3462
|
this._type = 'timevalues';
|
|
3442
3463
|
}
|
|
3443
3464
|
} else {
|
|
@@ -4035,7 +4056,7 @@ var getBBOXandProjString = function getBBOXandProjString(map, layer) {
|
|
|
4035
4056
|
return request;
|
|
4036
4057
|
};
|
|
4037
4058
|
// Build a valid WMS request for a certain layer
|
|
4038
|
-
var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
|
|
4059
|
+
var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer, dimensionOverride) {
|
|
4039
4060
|
var _a;
|
|
4040
4061
|
if (!isDefined(layer.name) || layer.name.length < 1) {
|
|
4041
4062
|
return undefined;
|
|
@@ -4111,7 +4132,7 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
|
|
|
4111
4132
|
}
|
|
4112
4133
|
// Handle dimensions
|
|
4113
4134
|
try {
|
|
4114
|
-
request += getMapDimURL(layer);
|
|
4135
|
+
request += getMapDimURL(layer, dimensionOverride);
|
|
4115
4136
|
} catch (e) {
|
|
4116
4137
|
return undefined;
|
|
4117
4138
|
}
|
|
@@ -4344,10 +4365,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4344
4365
|
this.canvasErrors = [];
|
|
4345
4366
|
this.resizeWidth = -1;
|
|
4346
4367
|
this.resizeHeight = -1;
|
|
4347
|
-
this._resizeTimerBusy = false;
|
|
4348
|
-
this._resizeTimer = new WMTimer();
|
|
4349
4368
|
this.wmAnimate = undefined;
|
|
4350
|
-
this.loadingDivTimer = new WMTimer();
|
|
4351
4369
|
this.mouseWheelBusy = 0;
|
|
4352
4370
|
this.wMFlyToBBox = new WMFlyToBBox(this);
|
|
4353
4371
|
this.mouseWheelEventBBOXCurrent = new WMBBOX();
|
|
@@ -4368,7 +4386,10 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4368
4386
|
this.resizingBBOXCursor = '';
|
|
4369
4387
|
this.resizingBBOXEnabled = '';
|
|
4370
4388
|
this.mouseGeoCoordXY = undefined;
|
|
4371
|
-
this.mouseUpdateCoordinates =
|
|
4389
|
+
this.mouseUpdateCoordinates = {
|
|
4390
|
+
x: -1,
|
|
4391
|
+
y: -1
|
|
4392
|
+
};
|
|
4372
4393
|
this.mapPanning = 0;
|
|
4373
4394
|
this.mapPanStartGeoCoords = undefined;
|
|
4374
4395
|
this.mapZooming = 0;
|
|
@@ -4506,6 +4527,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
4506
4527
|
this.mapPin = new MapPin(this);
|
|
4507
4528
|
this.loadingDiv = document.createElement('div');
|
|
4508
4529
|
this.loadingDiv.className = 'WMJSDivBuffer-loading';
|
|
4530
|
+
this.enableAutoPrefetching = true;
|
|
4509
4531
|
this.init();
|
|
4510
4532
|
}
|
|
4511
4533
|
_createClass(WMJSMap, [{
|
|
@@ -5321,27 +5343,14 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5321
5343
|
}, {
|
|
5322
5344
|
key: "setSize",
|
|
5323
5345
|
value: function setSize(w, h) {
|
|
5324
|
-
var _this7 = this;
|
|
5325
5346
|
debugLogger(DebugType.Log, 'setSize', w, h, this.initialized);
|
|
5326
5347
|
if (w < 4 || h < 4 || this.initialized === false) {
|
|
5327
5348
|
return;
|
|
5328
5349
|
}
|
|
5329
5350
|
this.resizeWidth = w;
|
|
5330
5351
|
this.resizeHeight = h;
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
this._setSize((this.resizeWidth) | 0, (this.resizeHeight) | 0);
|
|
5334
|
-
*/
|
|
5335
|
-
if (this._resizeTimerBusy === false) {
|
|
5336
|
-
this._resizeTimerBusy = true;
|
|
5337
|
-
this._setSize(this.resizeWidth, this.resizeHeight);
|
|
5338
|
-
return;
|
|
5339
|
-
}
|
|
5340
|
-
this._resizeTimer.init(200, function () {
|
|
5341
|
-
_this7._resizeTimerBusy = false;
|
|
5342
|
-
_this7._setSize(_this7.resizeWidth, _this7.resizeHeight);
|
|
5343
|
-
_this7.draw('resizeTimer');
|
|
5344
|
-
});
|
|
5352
|
+
this._setSize(this.resizeWidth, this.resizeHeight);
|
|
5353
|
+
this.draw('setSize');
|
|
5345
5354
|
}
|
|
5346
5355
|
}, {
|
|
5347
5356
|
key: "_setSize",
|
|
@@ -5542,7 +5551,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5542
5551
|
}, {
|
|
5543
5552
|
key: "_drawAndLoad",
|
|
5544
5553
|
value: function _drawAndLoad(inputAnimationList) {
|
|
5545
|
-
var
|
|
5554
|
+
var _this7 = this;
|
|
5546
5555
|
if (this.width < 4 || this.height < 4) {
|
|
5547
5556
|
this._drawReady();
|
|
5548
5557
|
return;
|
|
@@ -5562,19 +5571,18 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5562
5571
|
this.mouseHoverAnimationBox = false;
|
|
5563
5572
|
inputAnimationList.forEach(function (animationStepWithoutRequests, j) {
|
|
5564
5573
|
if (selectedTime && animationStepWithoutRequests.value === selectedTime) {
|
|
5565
|
-
|
|
5574
|
+
_this7.currentAnimationStep = j;
|
|
5566
5575
|
}
|
|
5567
5576
|
var animationStep = {
|
|
5568
5577
|
name: animationStepWithoutRequests.name,
|
|
5569
5578
|
value: animationStepWithoutRequests.value,
|
|
5570
5579
|
requests: []
|
|
5571
5580
|
};
|
|
5572
|
-
|
|
5573
|
-
animationStep.requests =
|
|
5574
|
-
|
|
5581
|
+
_this7.setDimension(animationStepWithoutRequests.name, animationStepWithoutRequests.value, false);
|
|
5582
|
+
animationStep.requests = _this7.getWMSRequests();
|
|
5583
|
+
_this7.animationList.push(animationStep);
|
|
5575
5584
|
});
|
|
5576
5585
|
this.setDimension(this.animationList[this.currentAnimationStep].name, this.animationList[this.currentAnimationStep].value, false);
|
|
5577
|
-
this.animationTimer = new WMTimer();
|
|
5578
5586
|
this.wmAnimate.loopAnimation();
|
|
5579
5587
|
}
|
|
5580
5588
|
this.addLayersToCanvasAndDisplayThem();
|
|
@@ -5597,12 +5605,12 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5597
5605
|
}
|
|
5598
5606
|
}, {
|
|
5599
5607
|
key: "getWMSRequests",
|
|
5600
|
-
value: function getWMSRequests() {
|
|
5601
|
-
var
|
|
5608
|
+
value: function getWMSRequests(dimensionOverride) {
|
|
5609
|
+
var _this8 = this;
|
|
5602
5610
|
var requests = [];
|
|
5603
5611
|
this.layers.forEach(function (layer) {
|
|
5604
5612
|
if (layer.service && layer.enabled) {
|
|
5605
|
-
var request = buildWMSGetMapRequest(
|
|
5613
|
+
var request = buildWMSGetMapRequest(_this8, layer, dimensionOverride);
|
|
5606
5614
|
if (request === null || request === void 0 ? void 0 : request.url) {
|
|
5607
5615
|
requests.push(request);
|
|
5608
5616
|
}
|
|
@@ -5613,49 +5621,48 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5613
5621
|
}, {
|
|
5614
5622
|
key: "addLayersToCanvasAndDisplayThem",
|
|
5615
5623
|
value: function addLayersToCanvasAndDisplayThem() {
|
|
5616
|
-
var
|
|
5617
|
-
var _a, _b, _c;
|
|
5624
|
+
var _this9 = this;
|
|
5618
5625
|
debugLogger(DebugType.Log);
|
|
5619
5626
|
this.divBuffer.reset();
|
|
5620
5627
|
var currentLayerIndex = 0;
|
|
5621
5628
|
this.numBaseLayers = 0;
|
|
5622
|
-
|
|
5629
|
+
this.baseLayers && this.baseLayers.forEach(function (baseLayer) {
|
|
5623
5630
|
var _a;
|
|
5624
5631
|
if (baseLayer.enabled && baseLayer.keepOnTop === false && baseLayer.type && baseLayer.type !== 'twms') {
|
|
5625
|
-
|
|
5626
|
-
var requestURL = (_a = buildWMSGetMapRequest(
|
|
5632
|
+
_this9.numBaseLayers += 1;
|
|
5633
|
+
var requestURL = (_a = buildWMSGetMapRequest(_this9, baseLayer)) === null || _a === void 0 ? void 0 : _a.url;
|
|
5627
5634
|
if (requestURL) {
|
|
5628
|
-
|
|
5635
|
+
_this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
|
|
5629
5636
|
layer: baseLayer
|
|
5630
|
-
}, baseLayer.opacity,
|
|
5637
|
+
}, baseLayer.opacity, _this9.getDrawBBOX());
|
|
5631
5638
|
currentLayerIndex += 1;
|
|
5632
5639
|
}
|
|
5633
5640
|
}
|
|
5634
5641
|
});
|
|
5635
|
-
if (!this.isAnimating) {
|
|
5642
|
+
if (!this.isAnimating && this.enableAutoPrefetching) {
|
|
5636
5643
|
prefetchImagesForNonAnimation(this);
|
|
5637
5644
|
}
|
|
5638
5645
|
/* Loop through all layers */
|
|
5639
|
-
|
|
5646
|
+
this.layers && this.layers.forEach(function (layer) {
|
|
5640
5647
|
var _a;
|
|
5641
5648
|
if (layer.service && layer.enabled && layer.isConfigured) {
|
|
5642
|
-
var requestURL = (_a = buildWMSGetMapRequest(
|
|
5649
|
+
var requestURL = (_a = buildWMSGetMapRequest(_this9, layer)) === null || _a === void 0 ? void 0 : _a.url;
|
|
5643
5650
|
if (requestURL) {
|
|
5644
|
-
|
|
5651
|
+
_this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
|
|
5645
5652
|
layer: layer
|
|
5646
|
-
}, layer.opacity,
|
|
5653
|
+
}, layer.opacity, _this9.getDrawBBOX());
|
|
5647
5654
|
currentLayerIndex += 1;
|
|
5648
5655
|
}
|
|
5649
5656
|
}
|
|
5650
5657
|
});
|
|
5651
|
-
|
|
5658
|
+
this.baseLayers && this.baseLayers.forEach(function (baseLayer) {
|
|
5652
5659
|
var _a;
|
|
5653
5660
|
if (baseLayer.enabled && baseLayer.keepOnTop === true) {
|
|
5654
|
-
var requestURL = (_a = buildWMSGetMapRequest(
|
|
5661
|
+
var requestURL = (_a = buildWMSGetMapRequest(_this9, baseLayer)) === null || _a === void 0 ? void 0 : _a.url;
|
|
5655
5662
|
if (requestURL) {
|
|
5656
|
-
|
|
5663
|
+
_this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
|
|
5657
5664
|
layer: baseLayer
|
|
5658
|
-
}, baseLayer.opacity,
|
|
5665
|
+
}, baseLayer.opacity, _this9.getDrawBBOX());
|
|
5659
5666
|
currentLayerIndex += 1;
|
|
5660
5667
|
}
|
|
5661
5668
|
}
|
|
@@ -5849,20 +5856,20 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
5849
5856
|
}, {
|
|
5850
5857
|
key: "_buildLayerDims",
|
|
5851
5858
|
value: function _buildLayerDims() {
|
|
5852
|
-
var
|
|
5859
|
+
var _this10 = this;
|
|
5853
5860
|
if (this.buildLayerDimsBusy === true) {
|
|
5854
5861
|
return;
|
|
5855
5862
|
}
|
|
5856
5863
|
this.mapdimensions.forEach(function (mapDim) {
|
|
5857
|
-
|
|
5864
|
+
_this10.layers.forEach(function (layer) {
|
|
5858
5865
|
layer.dimensions.forEach(function (layerDim) {
|
|
5859
5866
|
if (layerDim.linked === true && layerDim.name === mapDim.name) {
|
|
5860
5867
|
if (mapDim.currentValue === 'current' || mapDim.currentValue === 'default' || mapDim.currentValue === '' || mapDim.currentValue === 'earliest' || mapDim.currentValue === 'middle' || mapDim.currentValue === 'latest') {
|
|
5861
5868
|
mapDim.currentValue = layerDim.getClosestValue(mapDim.currentValue);
|
|
5862
5869
|
}
|
|
5863
|
-
|
|
5870
|
+
_this10.buildLayerDimsBusy = true;
|
|
5864
5871
|
layerDim.setClosestValue(mapDim.currentValue);
|
|
5865
|
-
|
|
5872
|
+
_this10.buildLayerDimsBusy = false;
|
|
5866
5873
|
}
|
|
5867
5874
|
});
|
|
5868
5875
|
});
|
|
@@ -6076,7 +6083,11 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
6076
6083
|
}, {
|
|
6077
6084
|
key: "updateMouseCursorCoordinates",
|
|
6078
6085
|
value: function updateMouseCursorCoordinates(coordinates) {
|
|
6079
|
-
this.mouseUpdateCoordinates
|
|
6086
|
+
if (!coordinates || this.mouseUpdateCoordinates.x === coordinates.x && this.mouseUpdateCoordinates.y === coordinates.y) {
|
|
6087
|
+
return;
|
|
6088
|
+
}
|
|
6089
|
+
this.mouseUpdateCoordinates.x = coordinates.x;
|
|
6090
|
+
this.mouseUpdateCoordinates.y = coordinates.y;
|
|
6080
6091
|
this.mouseGeoCoordXY = this.getGeoCoordFromPixelCoord(coordinates);
|
|
6081
6092
|
this.display();
|
|
6082
6093
|
}
|
|
@@ -6587,7 +6598,7 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
6587
6598
|
}, {
|
|
6588
6599
|
key: "zoomTo",
|
|
6589
6600
|
value: function zoomTo(_newbbox) {
|
|
6590
|
-
var
|
|
6601
|
+
var _this11 = this;
|
|
6591
6602
|
debugLogger(DebugType.Log);
|
|
6592
6603
|
var setOrigBox = false;
|
|
6593
6604
|
var newbbox = new WMBBOX(_newbbox);
|
|
@@ -6628,14 +6639,14 @@ var WMJSMap = /*#__PURE__*/function () {
|
|
|
6628
6639
|
this._updateBoundingBox(this.bbox);
|
|
6629
6640
|
this.drawnBBOX.setBBOX(this.bbox);
|
|
6630
6641
|
var resetMapPinAndDialogs = function resetMapPinAndDialogs() {
|
|
6631
|
-
for (var j = 0; j <
|
|
6632
|
-
var newpos =
|
|
6633
|
-
x:
|
|
6634
|
-
y:
|
|
6642
|
+
for (var j = 0; j < _this11.gfiDialogList.length; j += 1) {
|
|
6643
|
+
var newpos = _this11.getPixelCoordFromGeoCoord({
|
|
6644
|
+
x: _this11.gfiDialogList[j].geoPosX,
|
|
6645
|
+
y: _this11.gfiDialogList[j].geoPosY
|
|
6635
6646
|
});
|
|
6636
|
-
if (
|
|
6637
|
-
if (
|
|
6638
|
-
|
|
6647
|
+
if (_this11.gfiDialogList[j].hasBeenDragged === false) {
|
|
6648
|
+
if (_this11.gfiDialogList[j].moveToMouseCursor === true) {
|
|
6649
|
+
_this11.gfiDialogList[j].setXY(_this11.gfiDialogList[j].origX + newpos.x, _this11.gfiDialogList[j].origY + newpos.y);
|
|
6639
6650
|
}
|
|
6640
6651
|
}
|
|
6641
6652
|
}
|
|
@@ -8018,7 +8029,9 @@ var addDimsForLayer = function addDimsForLayer(layerProps, layer, layerDimNamesT
|
|
|
8018
8029
|
unitSymbol: layerDimension.unitSymbol || '',
|
|
8019
8030
|
value: layerDimension.values || '',
|
|
8020
8031
|
"default": layerDimension.currentValue,
|
|
8021
|
-
|
|
8032
|
+
/* If presets with other dimensions, like elevation, cause
|
|
8033
|
+
problems, try to add the dimension here */
|
|
8034
|
+
linkDimensionToMap: dimName !== 'reference_time' && dimName !== 'interval_start' && dimName !== 'interval_end'
|
|
8022
8035
|
};
|
|
8023
8036
|
/* Flag that this dim should not be removed from the layer */
|
|
8024
8037
|
layerDimNamesToRemove["delete"](layerDim.name);
|
|
@@ -8035,7 +8048,7 @@ var addDimsForLayer = function addDimsForLayer(layerProps, layer, layerDimNamesT
|
|
|
8035
8048
|
values: layerDim.value,
|
|
8036
8049
|
currentValue: layerDim["default"],
|
|
8037
8050
|
defaultValue: layerDim["default"],
|
|
8038
|
-
linked:
|
|
8051
|
+
linked: layerDim.linkDimensionToMap,
|
|
8039
8052
|
unitSymbol: layerDim.unitSymbol
|
|
8040
8053
|
});
|
|
8041
8054
|
/* Check if the dimension should take the value from the map */
|
|
@@ -9370,6 +9383,7 @@ var EPSGCode;
|
|
|
9370
9383
|
EPSGCode["EPSG4258"] = "EPSG:4258";
|
|
9371
9384
|
EPSGCode["EPSG3412"] = "EPSG:3412";
|
|
9372
9385
|
EPSGCode["EPSG3575"] = "EPSG:3575";
|
|
9386
|
+
EPSGCode["EPSG3067"] = "EPSG:3067";
|
|
9373
9387
|
})(EPSGCode || (EPSGCode = {}));
|
|
9374
9388
|
var tilesettings = {
|
|
9375
9389
|
WorldMap_Light_Grey_Canvas: {
|
|
@@ -9388,6 +9402,13 @@ var tilesettings = {
|
|
|
9388
9402
|
maxLevel: 16,
|
|
9389
9403
|
tileServerType: 'osm',
|
|
9390
9404
|
copyRight: 'OpenStreetMap - contributors | Ingmapping'
|
|
9405
|
+
},
|
|
9406
|
+
'EPSG:28992': {
|
|
9407
|
+
home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
|
|
9408
|
+
minLevel: 0,
|
|
9409
|
+
maxLevel: 16,
|
|
9410
|
+
tileServerType: 'osm',
|
|
9411
|
+
copyRight: 'Natural Earth II | Ingmapping'
|
|
9391
9412
|
}
|
|
9392
9413
|
},
|
|
9393
9414
|
OpenStreets_NL: {
|
|
@@ -9542,6 +9563,13 @@ var tilesettings = {
|
|
|
9542
9563
|
resolution: 3440.64,
|
|
9543
9564
|
tileServerType: 'arcgisonline',
|
|
9544
9565
|
copyRight: 'Basiskaart bronnen: ESRI Nederland, ESRI, Kadaster, CBS en Rijkswaterstaat'
|
|
9566
|
+
},
|
|
9567
|
+
'EPSG:3067': {
|
|
9568
|
+
home: '',
|
|
9569
|
+
minLevel: -1,
|
|
9570
|
+
maxLevel: -1,
|
|
9571
|
+
tileServerType: 'arcgisonline',
|
|
9572
|
+
copyRight: ''
|
|
9545
9573
|
}
|
|
9546
9574
|
},
|
|
9547
9575
|
arcGisTopo: {
|
|
@@ -10046,4 +10074,4 @@ var getCapabilities = /*#__PURE__*/Object.freeze({
|
|
|
10046
10074
|
getLayersFlattenedFromService: getLayersFlattenedFromService
|
|
10047
10075
|
});
|
|
10048
10076
|
|
|
10049
|
-
export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer,
|
|
10077
|
+
export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, buildWMSGetMapRequest, clearImageCache, debugLogger, generateLayerId, generateMapId, generateTimesliderId, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, getUriWithParam, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSMapIds, getWMJSTimeDimensionForLayerId, getWMLayerById, handleMomentISOString, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, utils as webmapUtils };
|
package/package.json
CHANGED
|
@@ -6,6 +6,8 @@ export default class WMJSAnimate {
|
|
|
6
6
|
private _callBack;
|
|
7
7
|
private _imageStore;
|
|
8
8
|
private isNextTimeCloseToWallClockTime;
|
|
9
|
+
private animationTimer;
|
|
10
|
+
private animateBusy;
|
|
9
11
|
constructor(_map: WMJSMap);
|
|
10
12
|
isCurrentAnimationTimeCloseToWallClockTime(): boolean;
|
|
11
13
|
loopAnimation(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import WMImage from './WMImage';
|
|
2
3
|
import WMImageStore from './WMImageStore';
|
|
3
4
|
import WMBBOX from './WMBBOX';
|
|
@@ -80,6 +81,8 @@ export default class WMCanvasBuffer {
|
|
|
80
81
|
_internalCallbacks: InternalCallback;
|
|
81
82
|
srs: string;
|
|
82
83
|
bbox: WMBBOX;
|
|
84
|
+
animationFrameRequest: number;
|
|
85
|
+
timerHandle: NodeJS.Timeout;
|
|
83
86
|
_errorList: LinkedInfo[];
|
|
84
87
|
constructor(webmapJSCallback: WMListener, _imageStore: WMImageStore, w: number, h: number, internalCallbacks: InternalCallback);
|
|
85
88
|
getCanvasContext(): CanvasRenderingContext2D;
|
|
@@ -96,6 +99,7 @@ export default class WMCanvasBuffer {
|
|
|
96
99
|
reset(): void;
|
|
97
100
|
_drawImage(canvasLayer: CanvasGeoLayer): void;
|
|
98
101
|
display(): void;
|
|
102
|
+
_display(): void;
|
|
99
103
|
finishedLoading(): void;
|
|
100
104
|
resize(w: string, h: string): void;
|
|
101
105
|
/**
|
|
@@ -4,7 +4,7 @@ export declare enum WMImageEventType {
|
|
|
4
4
|
Deleted = 1
|
|
5
5
|
}
|
|
6
6
|
export default class WMImageStore {
|
|
7
|
-
imagesbysrc:
|
|
7
|
+
imagesbysrc: Map<string, WMImage>;
|
|
8
8
|
imageLife: number;
|
|
9
9
|
_imageLifeCounter: number;
|
|
10
10
|
_loadEventCallbackList: Array<{
|
|
@@ -29,7 +29,7 @@ export default class WMImageStore {
|
|
|
29
29
|
/**
|
|
30
30
|
* Check if we have similar images with the same source in the pipeline
|
|
31
31
|
*/
|
|
32
|
-
getImageForSrc(src: string): WMImage;
|
|
32
|
+
getImageForSrc(src: string): WMImage | undefined;
|
|
33
33
|
clear(): void;
|
|
34
34
|
addImageEventCallback(callback: (image: WMImage, id: string, imageEventType: WMImageEventType) => void, id: string): void;
|
|
35
35
|
removeAllEventCallbacks(): void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import WMBBOX from './WMBBOX';
|
|
2
2
|
import WMListener from './WMListener';
|
|
3
|
-
import WMTimer from './WMTimer';
|
|
4
3
|
import { proj4 } from './WMJSExternalDependencies';
|
|
5
4
|
import WMJSDimension from './WMJSDimension';
|
|
6
5
|
import MapPin from './WMMapPin';
|
|
7
6
|
import WMLayer from './WMLayer';
|
|
8
|
-
import { AnimationStep, LinkedInfo } from './types';
|
|
7
|
+
import { AnimationStep, Dimension, LinkedInfo } from './types';
|
|
9
8
|
export declare const detectLeftButton: (evt: MouseEvent) => boolean;
|
|
10
9
|
export declare const detectRightButton: (evt: MouseEvent) => boolean;
|
|
11
10
|
export declare const getErrorsToDisplay: (canvasErrors: LinkedInfo[], getLayerByServiceAndName: (layerservice: string, layername: string) => WMLayer) => string[];
|
|
@@ -19,6 +18,7 @@ export default class WMJSMap {
|
|
|
19
18
|
mapdimensions: WMJSDimension[];
|
|
20
19
|
timestepInMinutes: number | undefined;
|
|
21
20
|
stopAnimating: () => void;
|
|
21
|
+
enableAutoPrefetching: boolean;
|
|
22
22
|
showLayerInfo: boolean;
|
|
23
23
|
isAnimating: boolean;
|
|
24
24
|
animationDelay: number;
|
|
@@ -27,8 +27,6 @@ export default class WMJSMap {
|
|
|
27
27
|
currentAnimationStep: number;
|
|
28
28
|
initialAnimationStep: number;
|
|
29
29
|
setAnimationDelay: (delay: number) => void;
|
|
30
|
-
animateBusy: boolean;
|
|
31
|
-
animationTimer: WMTimer;
|
|
32
30
|
mouseHoverAnimationBox: boolean;
|
|
33
31
|
loadingDiv: HTMLElement;
|
|
34
32
|
baseDiv: HTMLElement;
|
|
@@ -86,11 +84,8 @@ export default class WMJSMap {
|
|
|
86
84
|
private canvasErrors;
|
|
87
85
|
private resizeWidth;
|
|
88
86
|
private resizeHeight;
|
|
89
|
-
private _resizeTimerBusy;
|
|
90
|
-
private _resizeTimer;
|
|
91
87
|
private wmAnimate;
|
|
92
88
|
private wmTileRenderer;
|
|
93
|
-
private loadingDivTimer?;
|
|
94
89
|
private mouseWheelBusy;
|
|
95
90
|
private wMFlyToBBox;
|
|
96
91
|
private mouseWheelEventBBOXCurrent;
|
|
@@ -151,7 +146,7 @@ export default class WMJSMap {
|
|
|
151
146
|
/**
|
|
152
147
|
* @param layer of type WMLayer
|
|
153
148
|
*/
|
|
154
|
-
addLayer(layer: WMLayer): Promise<
|
|
149
|
+
addLayer(layer: WMLayer): Promise<WMJSMap>;
|
|
155
150
|
getActiveLayer(): WMLayer;
|
|
156
151
|
/**
|
|
157
152
|
* setProjection
|
|
@@ -196,7 +191,7 @@ export default class WMJSMap {
|
|
|
196
191
|
_onLayersReadyCallbackFunction(): void;
|
|
197
192
|
_onMapReadyCallbackFunction(): void;
|
|
198
193
|
_onResumeSuspendCallbackFunction(): void;
|
|
199
|
-
getWMSRequests(): {
|
|
194
|
+
getWMSRequests(dimensionOverride?: Dimension[]): {
|
|
200
195
|
url: string;
|
|
201
196
|
headers: Headers[];
|
|
202
197
|
}[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type WMJSMap from './WMJSMap';
|
|
2
2
|
import type WMLayer from './WMLayer';
|
|
3
|
+
import type { Dimension } from './types';
|
|
3
4
|
export declare const getBBOXandProjString: (map: WMJSMap, layer: WMLayer) => string;
|
|
4
|
-
export declare const buildWMSGetMapRequest: (map: WMJSMap, layer: WMLayer) => {
|
|
5
|
+
export declare const buildWMSGetMapRequest: (map: WMJSMap, layer: WMLayer, dimensionOverride?: Dimension[]) => {
|
|
5
6
|
url: string;
|
|
6
7
|
headers: Headers[];
|
|
7
8
|
} | undefined;
|
|
@@ -38,7 +38,7 @@ export declare const getMouseYCoordinate: (event: MouseEvent) => number;
|
|
|
38
38
|
export declare const URLDecode: (encodedURL: string) => string;
|
|
39
39
|
export declare const URLEncode: (plaintext: string) => string;
|
|
40
40
|
export declare const getCorrectWMSDimName: (origDimName: string) => string;
|
|
41
|
-
export declare const getMapDimURL: (layer: WMLayer) => string;
|
|
41
|
+
export declare const getMapDimURL: (layer: WMLayer, dimensionOverride?: Dimension[]) => string;
|
|
42
42
|
/**
|
|
43
43
|
* Parses url and then it it allows for setting / changing key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
|
|
44
44
|
* @param baseUrl
|
|
@@ -4,6 +4,6 @@ type PrefetchRequest = {
|
|
|
4
4
|
url: string;
|
|
5
5
|
headers: Headers[];
|
|
6
6
|
};
|
|
7
|
-
export declare function getLayersImageUrlsForTime(wmMap: WMJSMap, timeToPrefetch: string
|
|
7
|
+
export declare function getLayersImageUrlsForTime(wmMap: WMJSMap, timeToPrefetch: string): PrefetchRequest[];
|
|
8
8
|
export declare function prefetchImagesForNonAnimation(wmMap: WMJSMap, maxImagesToPrefetch?: number): void;
|
|
9
9
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import WMJSMap, { clearImageCache } from './WMJSMap';
|
|
2
2
|
import { isDefined, WMJScheckURL, URLDecode, URLEncode, toArray, debugLogger, DebugType, getUriWithParam } from './WMJSTools';
|
|
3
|
-
import WMTimer from './WMTimer';
|
|
4
3
|
import WMGetServiceFromStore from './WMGetServiceFromStore';
|
|
5
4
|
import { WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle } from './WMConstants';
|
|
6
5
|
import { parseISO8601DateToDate, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration } from './WMTime';
|
|
@@ -15,6 +14,6 @@ export { default as WMLayer, LayerType } from './WMLayer';
|
|
|
15
14
|
export type { LayerOptions, LayerFoundation } from './WMLayer';
|
|
16
15
|
export { default as WMBBOX } from './WMBBOX';
|
|
17
16
|
export type { Bbox } from './WMBBOX';
|
|
18
|
-
export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined,
|
|
17
|
+
export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService, getMapImageStore, clearImageCache, buildWMSGetMapRequest, getUriWithParam, };
|
|
19
18
|
export * from './types';
|
|
20
19
|
export * from './WMTimeTypes';
|
|
@@ -20,7 +20,8 @@ export declare enum EPSGCode {
|
|
|
20
20
|
EPSG4326 = "EPSG:4326",
|
|
21
21
|
EPSG4258 = "EPSG:4258",
|
|
22
22
|
EPSG3412 = "EPSG:3412",
|
|
23
|
-
EPSG3575 = "EPSG:3575"
|
|
23
|
+
EPSG3575 = "EPSG:3575",
|
|
24
|
+
EPSG3067 = "EPSG:3067"
|
|
24
25
|
}
|
|
25
26
|
type EPSGSettings = {
|
|
26
27
|
[code in EPSGCode]?: TileSettings;
|