@opengeoweb/webmap 12.9.1 → 12.10.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 +23 -88
- package/package.json +2 -3
- package/src/lib/components/WMConstants.d.ts +0 -2
- package/src/lib/components/WMJSTools.d.ts +0 -24
- package/src/lib/components/index.d.ts +2 -2
- package/src/lib/components/WMJSExternalDependencies.d.ts +0 -2
- package/src/lib/components/WMMemo.d.ts +0 -5
- package/src/lib/components/WMMemo.spec.d.ts +0 -1
- package/src/lib/components/WMTimer.d.ts +0 -11
- package/src/lib/components/WMTimer.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -471,8 +471,6 @@ var WMDateTooEarlyString = 'date too early';
|
|
|
471
471
|
var WMDateTooLateString = 'date too late';
|
|
472
472
|
var WMDateUnit = 'ISO8601';
|
|
473
473
|
var WMInvalidDateValues = new Set([WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString]);
|
|
474
|
-
var WMSJSMAP_MINIMUM_MAP_WIDTH = 4;
|
|
475
|
-
var WMSJSMAP_MINIMUM_MAP_HEIGHT = 4;
|
|
476
474
|
var WMSVersion = {
|
|
477
475
|
version100: '1.0.0',
|
|
478
476
|
version111: '1.1.1',
|
|
@@ -664,75 +662,12 @@ var toArray = function toArray(array) {
|
|
|
664
662
|
newArray[0] = array;
|
|
665
663
|
return newArray;
|
|
666
664
|
};
|
|
667
|
-
/**
|
|
668
|
-
* Function which checks wether URL contains a ? token. If not, it is assumed that this token was not provided by the user,
|
|
669
|
-
* manually add the token later.
|
|
670
|
-
* @param url The URL to check
|
|
671
|
-
* @return the fixed URL
|
|
672
|
-
*/
|
|
673
|
-
var WMJScheckURL = function WMJScheckURL(url) {
|
|
674
|
-
if (!isDefined(url)) {
|
|
675
|
-
return '?';
|
|
676
|
-
}
|
|
677
|
-
var trimmedUrl = url.trim();
|
|
678
|
-
if (trimmedUrl.indexOf('?') === -1) {
|
|
679
|
-
return trimmedUrl + "?";
|
|
680
|
-
}
|
|
681
|
-
return trimmedUrl;
|
|
682
|
-
};
|
|
683
|
-
var URLDecode = function URLDecode(encodedURL) {
|
|
684
|
-
if (!isDefined(encodedURL)) {
|
|
685
|
-
return '';
|
|
686
|
-
}
|
|
687
|
-
return encodedURL.replace('+', ' ').replace('%2B', '+').replace('%20', ' ').replace('%5E', '^').replace('%26', '&').replace('%3F', '?').replace('%3E', '>').replace('%3C', '<').replace('%5C', '\\').replace('%2F', '/').replace('%25', '%').replace('%3A', ':').replace('%27', "'").replace('%24', '$');
|
|
688
|
-
};
|
|
689
|
-
// Encodes plain text to URL encoding
|
|
690
|
-
var URLEncode = function URLEncode(plaintext) {
|
|
691
|
-
if (!plaintext) {
|
|
692
|
-
return plaintext;
|
|
693
|
-
}
|
|
694
|
-
if (plaintext === undefined) {
|
|
695
|
-
return plaintext;
|
|
696
|
-
}
|
|
697
|
-
if (plaintext === '') {
|
|
698
|
-
return plaintext;
|
|
699
|
-
}
|
|
700
|
-
var SAFECHARS = '0123456789' +
|
|
701
|
-
// Numeric
|
|
702
|
-
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
|
|
703
|
-
// Alphabetic
|
|
704
|
-
'abcdefghijklmnopqrstuvwxyz' + "%-_.!~*'()"; // RFC2396 Mark characters
|
|
705
|
-
var HEX = '0123456789ABCDEF';
|
|
706
|
-
var replacedText = plaintext.replace(/%/g, '%25').replace(/\+/g, '%2B').replace(/ /g, '%20').replace(/\^/g, '%5E').replace(/&/g, '%26').replace(/\?/g, '%3F').replace(/>/g, '%3E').replace(/</g, '%3C').replace(/\\/g, '%5C');
|
|
707
|
-
var encoded = '';
|
|
708
|
-
for (var i = 0; i < replacedText.length; i += 1) {
|
|
709
|
-
var ch = replacedText.charAt(i);
|
|
710
|
-
if (ch === ' ') {
|
|
711
|
-
encoded += '%20'; // x-www-urlencoded, rather than %20
|
|
712
|
-
} else if (SAFECHARS.indexOf(ch) !== -1) {
|
|
713
|
-
encoded += ch;
|
|
714
|
-
} else {
|
|
715
|
-
var charCode = ch.charCodeAt(0);
|
|
716
|
-
if (charCode > 255) {
|
|
717
|
-
debugLogger(DebugType.Warning);
|
|
718
|
-
encoded += '+';
|
|
719
|
-
} else {
|
|
720
|
-
encoded += '%';
|
|
721
|
-
// eslint-disable-next-line no-bitwise
|
|
722
|
-
encoded += HEX.charAt(charCode >> 4 & 0xf);
|
|
723
|
-
// eslint-disable-next-line no-bitwise
|
|
724
|
-
encoded += HEX.charAt(charCode & 0xf);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
return encoded;
|
|
729
|
-
};
|
|
730
665
|
/* Returns all dimensions with its current values as URL */
|
|
731
666
|
var getMapDimURL = function getMapDimURL(layer, dimensionOverride) {
|
|
732
667
|
var request = new URLSearchParams();
|
|
733
668
|
layer.dimensions.forEach(function (layerDimension) {
|
|
734
|
-
var overrideDim = dimensionOverride && dimensionOverride.find(function (
|
|
735
|
-
return
|
|
669
|
+
var overrideDim = dimensionOverride && dimensionOverride.find(function (dim) {
|
|
670
|
+
return dim.name === layerDimension.name;
|
|
736
671
|
});
|
|
737
672
|
var dimension = layerDimension;
|
|
738
673
|
var currentValue = overrideDim && dimension.getClosestValue(overrideDim.currentValue, true) || dimension.currentValue;
|
|
@@ -889,11 +824,11 @@ var addBoundingBoxForLayer = function addBoundingBoxForLayer(layerObjectFromWMS)
|
|
|
889
824
|
*/
|
|
890
825
|
function sortArrayOfObjectsByKey(array, key) {
|
|
891
826
|
var spreadArray = [].concat(array);
|
|
892
|
-
return spreadArray.sort(function (
|
|
827
|
+
return spreadArray.sort(function (arrayA, arrayB) {
|
|
893
828
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
894
|
-
var x =
|
|
829
|
+
var x = arrayA[key];
|
|
895
830
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
896
|
-
var y =
|
|
831
|
+
var y = arrayB[key];
|
|
897
832
|
if (x < y) {
|
|
898
833
|
return -1;
|
|
899
834
|
}
|
|
@@ -922,22 +857,22 @@ var makeNodeLayerFromWMSGetCapabilityLayer = function makeNodeLayerFromWMSGetCap
|
|
|
922
857
|
if (nestedLayerPath === void 0) {
|
|
923
858
|
nestedLayerPath = [];
|
|
924
859
|
}
|
|
925
|
-
var geographicBoundingBox = nestedLayerPath.reverse().reduce(function (
|
|
926
|
-
return
|
|
860
|
+
var geographicBoundingBox = nestedLayerPath.reverse().reduce(function (npath, lprops) {
|
|
861
|
+
return npath || lprops.geographicBoundingBox;
|
|
927
862
|
}, addBoundingBoxForLayer(layer));
|
|
928
863
|
var dimensions = nestedLayerPath.reverse().reduce(function (dims, props) {
|
|
929
864
|
var parentDims = (props.dimensions || []).filter(function (dim) {
|
|
930
|
-
return !dims.some(function (
|
|
931
|
-
return
|
|
865
|
+
return !dims.some(function (dimit) {
|
|
866
|
+
return dimit.name === dim.name;
|
|
932
867
|
});
|
|
933
868
|
});
|
|
934
869
|
return [].concat(parentDims, dims);
|
|
935
870
|
}, addDimensionsForLayer(layer));
|
|
936
|
-
var styles = nestedLayerPath.reverse().reduce(function (
|
|
937
|
-
if (
|
|
938
|
-
return
|
|
871
|
+
var styles = nestedLayerPath.reverse().reduce(function (npath, lprops) {
|
|
872
|
+
if (lprops.styles && Array.isArray(lprops.styles) && lprops.styles.length) {
|
|
873
|
+
return lprops.styles.concat(npath);
|
|
939
874
|
}
|
|
940
|
-
return
|
|
875
|
+
return npath;
|
|
941
876
|
}, addStylesForLayer(layer));
|
|
942
877
|
var queryable = layer != null && layer.attr ? parseInt(layer.attr.queryable, 10) === 1 : false;
|
|
943
878
|
var crs = layer != null && layer.BoundingBox && Array.isArray(layer.BoundingBox) && layer.BoundingBox.length ? compact(layer.BoundingBox.map(function (wmsBBOX) {
|
|
@@ -2158,7 +2093,7 @@ var getLegendGraphicURLForLayer = function getLegendGraphicURLForLayer(layer, wi
|
|
|
2158
2093
|
legendURL += "&" + mapDimURL;
|
|
2159
2094
|
}
|
|
2160
2095
|
if (layer.sldURL) {
|
|
2161
|
-
legendURL += "&SLD=" +
|
|
2096
|
+
legendURL += "&SLD=" + encodeURI(layer.sldURL);
|
|
2162
2097
|
}
|
|
2163
2098
|
legendURL += '&transparent=true';
|
|
2164
2099
|
// append width and height parameters when not present
|
|
@@ -2772,8 +2707,8 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
2772
2707
|
if (this._type === 'timestartstopres') {
|
|
2773
2708
|
// Compose a new dateString interval and re-initialize the time dimension if the
|
|
2774
2709
|
// calculated start and end values are valid for the time dimension interval
|
|
2775
|
-
var _this$values$split$ma = this.values.split('/').map(function (
|
|
2776
|
-
return
|
|
2710
|
+
var _this$values$split$ma = this.values.split('/').map(function (val) {
|
|
2711
|
+
return val.trim();
|
|
2777
2712
|
}),
|
|
2778
2713
|
start = _this$values$split$ma[0],
|
|
2779
2714
|
interval = _this$values$split$ma[2];
|
|
@@ -2792,11 +2727,11 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
2792
2727
|
return x >= _newValue;
|
|
2793
2728
|
});
|
|
2794
2729
|
var newValues = '';
|
|
2795
|
-
for (var
|
|
2796
|
-
if (
|
|
2730
|
+
for (var jIndex = 0; jIndex < newArray.length; jIndex += 1) {
|
|
2731
|
+
if (jIndex > 0) {
|
|
2797
2732
|
newValues += ',';
|
|
2798
2733
|
}
|
|
2799
|
-
newValues += newArray[
|
|
2734
|
+
newValues += newArray[jIndex].toISO8601();
|
|
2800
2735
|
}
|
|
2801
2736
|
this.reInitializeValues(newValues, true);
|
|
2802
2737
|
this.setClosestValue();
|
|
@@ -3283,9 +3218,9 @@ var WMJSDimension = /*#__PURE__*/function () {
|
|
|
3283
3218
|
}
|
|
3284
3219
|
}
|
|
3285
3220
|
if (this._type === 'anyvalue') {
|
|
3286
|
-
for (var
|
|
3287
|
-
if (this._allValues[
|
|
3288
|
-
return
|
|
3221
|
+
for (var jIndex = 0; jIndex < this._allValues.length; jIndex += 1) {
|
|
3222
|
+
if (this._allValues[jIndex] === value) {
|
|
3223
|
+
return jIndex;
|
|
3289
3224
|
}
|
|
3290
3225
|
}
|
|
3291
3226
|
}
|
|
@@ -6925,4 +6860,4 @@ var privateWebMapUtils = {
|
|
|
6925
6860
|
QUERYWMS_GETCAPABILITIES: QUERYWMS_GETCAPABILITIES
|
|
6926
6861
|
};
|
|
6927
6862
|
|
|
6928
|
-
export { DateInterval, DebugType, EVENT_GETCAPABILITIES_READY, EVENT_GETCAPABILITIES_START, LayerType, ParseISOTimeRangeDuration,
|
|
6863
|
+
export { DateInterval, DebugType, EVENT_GETCAPABILITIES_READY, EVENT_GETCAPABILITIES_START, LayerType, ParseISOTimeRangeDuration, WEBMAP_NAMESPACE, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMDateUnit, WMEmptyLayerName, WMEmptyLayerTitle, WMImage, WMImageEventType, WMImageStore, WMInvalidDateValues, WMJSDimension, WMJSMAP_LONLAT_EPSGCODE, WMLayer, WMListener, WMProj4Defs, WMProjection, WMSVersion, WMXMLStringToJson, bgImageStoreLength, debugLogger, generateLayerId, generateMapId, generateTimesliderId, getCorrectWMSDimName, getLegendGraphicURLForLayer, getMapDimURL, getUriWithParam, getWMJSDimensionForLayerAndDimension, getWMJSTimeDimensionForLayerId, getWMLayerById, getWMSServiceId, handleDateUtilsISOString, invalidateWMSGetCapabilities, isDefined, isProjectionSupported, legendImageStore, legendImageStoreLength, mapImageStoreLength, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, privateWebMapUtils, queryWMSGetCapabilities, queryWMSLayer, queryWMSLayers, queryWMSLayersTree, queryWMSServiceInfo, registerWMLayer, roundWithTimeStep, setWMSGetCapabilitiesFetcher, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, index as webmapTestSettings, webmapTranslations, utils as webmapUtils, wmServiceListener, wmsQueryClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.0",
|
|
4
4
|
"description": "GeoWeb webmap library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/shared": "12.
|
|
11
|
+
"@opengeoweb/shared": "12.10.0",
|
|
12
12
|
"@tanstack/query-core": "^5.69.2",
|
|
13
|
-
"proj4": "^2.9.2",
|
|
14
13
|
"lodash": "^4.17.21",
|
|
15
14
|
"i18next": "^25.0.1",
|
|
16
15
|
"@types/geojson": "^7946.0.14"
|
|
@@ -5,8 +5,6 @@ export declare const WMDateTooEarlyString = "date too early";
|
|
|
5
5
|
export declare const WMDateTooLateString = "date too late";
|
|
6
6
|
export declare const WMDateUnit = "ISO8601";
|
|
7
7
|
export declare const WMInvalidDateValues: Set<string>;
|
|
8
|
-
export declare const WMSJSMAP_MINIMUM_MAP_WIDTH = 4;
|
|
9
|
-
export declare const WMSJSMAP_MINIMUM_MAP_HEIGHT = 4;
|
|
10
8
|
export declare const WMSVersion: {
|
|
11
9
|
version100: string;
|
|
12
10
|
version111: string;
|
|
@@ -13,30 +13,12 @@ export declare const debugLogger: (type: DebugType, message: string, ...optional
|
|
|
13
13
|
* @returns true if variable is indeed defined, otherwise false.
|
|
14
14
|
*/
|
|
15
15
|
export declare const isDefined: <T>(variable?: T) => variable is T;
|
|
16
|
-
/**
|
|
17
|
-
* Checks if a variable is null or not
|
|
18
|
-
* @param variable The variable to check
|
|
19
|
-
* @returns true if variable is indeed null, otherwise false.
|
|
20
|
-
*/
|
|
21
|
-
export declare const isNull: (variable: any) => boolean;
|
|
22
16
|
/**
|
|
23
17
|
* Converts a variable to an array. If the variable is not an array it will be pushed as the first entry in a new array. If the variable is already an array, nothing will be done.
|
|
24
18
|
* @param array The variable to convert
|
|
25
19
|
* @returns Always an array
|
|
26
20
|
*/
|
|
27
21
|
export declare const toArray: (array: unknown | unknown[]) => any[];
|
|
28
|
-
/**
|
|
29
|
-
* Function which checks wether URL contains a ? token. If not, it is assumed that this token was not provided by the user,
|
|
30
|
-
* manually add the token later.
|
|
31
|
-
* @param url The URL to check
|
|
32
|
-
* @return the fixed URL
|
|
33
|
-
*/
|
|
34
|
-
export declare const WMJScheckURL: (url: string) => string;
|
|
35
|
-
export declare const preventdefaultEvent: (event: Event) => void;
|
|
36
|
-
export declare const getMouseXCoordinate: (event: MouseEvent) => number;
|
|
37
|
-
export declare const getMouseYCoordinate: (event: MouseEvent) => number;
|
|
38
|
-
export declare const URLDecode: (encodedURL: string) => string;
|
|
39
|
-
export declare const URLEncode: (plaintext: string) => string;
|
|
40
22
|
export declare const getMapDimURL: (layer: WMLayer, dimensionOverride?: Dimension[]) => URLSearchParams;
|
|
41
23
|
/**
|
|
42
24
|
* 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)
|
|
@@ -52,12 +34,6 @@ export declare const getUriWithParam: (baseUrl: string, params?: Record<string,
|
|
|
52
34
|
* @returns
|
|
53
35
|
*/
|
|
54
36
|
export declare const getUriAddParam: (baseUrl: string, params: Record<string, any>) => string;
|
|
55
|
-
/**
|
|
56
|
-
* Converts a JS date to a ISO8601 string
|
|
57
|
-
* @param date
|
|
58
|
-
* @returns ISO8601 string
|
|
59
|
-
*/
|
|
60
|
-
export declare const dateToISO8601: (date: Date) => string;
|
|
61
37
|
/**
|
|
62
38
|
* Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilities document
|
|
63
39
|
* @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDefined,
|
|
1
|
+
import { isDefined, toArray, debugLogger, DebugType, getUriWithParam, getMapDimURL } from './WMJSTools';
|
|
2
2
|
import { parseISO8601DateToDate, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration } from './WMTime';
|
|
3
3
|
import WMImage from './WMImage';
|
|
4
4
|
import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
|
|
@@ -15,7 +15,7 @@ export { default as WMBBOX } from './WMBBOX';
|
|
|
15
15
|
export type { Bbox } from './WMBBOX';
|
|
16
16
|
export type { WMProjectionWH } from './WMProjection';
|
|
17
17
|
export { WMProjection };
|
|
18
|
-
export { DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined,
|
|
18
|
+
export { DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, parseISO8601DateToDate, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, getUriWithParam, getMapDimURL, WMListener, WMXMLStringToJson, };
|
|
19
19
|
export * from './types';
|
|
20
20
|
export * from './WMTimeTypes';
|
|
21
21
|
export * from './WMConstants';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set the length of the timer, in milli seconds, after time has elapsed function is called
|
|
3
|
-
* @param secstime Time in milli seconds
|
|
4
|
-
* @param functionhandler Function to call after time is elapsed
|
|
5
|
-
*/
|
|
6
|
-
declare class WMTimer {
|
|
7
|
-
private timer;
|
|
8
|
-
init(delayInMiliseconds: number, callback: () => void): void;
|
|
9
|
-
stop(): void;
|
|
10
|
-
}
|
|
11
|
-
export default WMTimer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|