@masterportal/masterportalapi 2.31.0 → 2.33.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/CHANGELOG.md CHANGED
@@ -3,31 +3,64 @@
3
3
 
4
4
  The [Semantic Versioning](https://semver.org/spec/v2.0.0.html) is used.
5
5
 
6
- ### 2.31.0 - 2023-12-13
7
- ## Added
6
+ ## Unreleased - in development
7
+
8
+ ### Added
9
+ ### Changed
10
+ ### Deprecated
11
+ ### Removed
12
+ ### Fixed
13
+
14
+ ---
15
+
16
+ ## 2.33.0 - 2024-02-07
17
+
18
+ ### Changed
19
+ - createStyle: setting style to feature is limited to Point and MultiPoint geometries.
20
+
21
+ ### Fixed
22
+ - 3D: the options are set correctly again for terrain.
23
+
24
+ ---
25
+
26
+
27
+ ## 2.32.0 - 2024-01-17
28
+ ### Added
29
+
30
+ ### Changed
31
+ - The following package has been updated:
32
+ - dependencies:
33
+ - ol: 8.1.0 to 8.2.0
34
+ - peerDependencies:
35
+ - @cesium/engine 2.4.1 to 6.2.0
36
+
37
+ ---
38
+
39
+ ## 2.31.0 - 2023-12-13
40
+ ### Added
8
41
  - Added support for Node LTS version ^20.9.0 and npm Version ^10.1.0.
9
42
 
10
- ## Changed
43
+ ### Changed
11
44
  - WMS-Layer: the attribute extent of rawlayer is set at ol-layer.
12
45
 
13
- ## Fixed
46
+ ### Fixed
14
47
  - OAF-Layer: fix oaf layer in examples
15
48
 
16
49
  ---
17
50
 
18
- ### 2.30.0 - 2023-11-28
19
- ## Changed
51
+ ## 2.30.0 - 2023-11-28
52
+ ### Changed
20
53
  - WMS-Layer and WMTS-Layer: create Layer no longer evaluates the minScale and maxScale attributes, but instead minResolution and maxResolution can be transferred.
21
54
 
22
- ## Fixed
55
+ ### Fixed
23
56
  - Issue Masterportal #1052 VectorStyle: fixed blinking of initial loaded features on great amount of features with a lot of conditional styles.
24
57
  - Issue Masterportal #1088: gfiAttibutes with type=html are not displayed if there is no value in the data.
25
58
  - Issue Masterportal #1091: VectorStyle: read geometry type from geoserver featureTypeRequest
26
59
 
27
60
  ---
28
61
 
29
- ### 2.29.0 - 2023-10-27
30
- ## Added
62
+ ## 2.29.0 - 2023-10-27
63
+ ### Added
31
64
  - The following packages from parcel automatic were installed for node builtin:
32
65
  - dependencies:
33
66
  - assert": 2.1.0,
@@ -40,7 +73,7 @@
40
73
  - dependencies:
41
74
  - ol-mapbox-style: 12.0.0
42
75
 
43
- ## Changed
76
+ ### Changed
44
77
  - The following packages have been updated:
45
78
  - dependencies:
46
79
  - core-js: 3.32.0 to 3.33.1
@@ -60,35 +93,35 @@
60
93
  - sass: 1.64.2 to 1.69.4
61
94
  - Revert Cesium.Cesium3DTileset.fromUrl(url, options) adaptions in tileset.js for Cesium v1.107 deprecated warnings
62
95
 
63
- ## Fixed
96
+ ### Fixed
64
97
  - styleList: styles of type oaf are now also added to the stylelist
65
98
  - Issue Masterportal #1052 VectorStyle: path to an icon in the map or in the legend in style.json may be an icon name, a relative path to icon, a complete url or an svg.
66
99
 
67
100
  ---
68
101
 
69
- ### 2.28.0 - 2023-09-27
70
- ## Added
102
+ ## 2.28.0 - 2023-09-27
103
+ ### Added
71
104
  - GfiAttributes: GFI Attributes can now be configured as HTML tags, e.g <a>, <img> or <iframe>
72
105
 
73
- ## Changed
106
+ ### Changed
74
107
  - The following packages have been updated:
75
108
  - dependencies:
76
109
  - ol: 7.5.1 to 7.5.2 (This version fix a bug for vectorTiles with declutter: true)
77
- ## Fixed
110
+ ### Fixed
78
111
  - Issue Masterportal #1067 VectorStyle: if there is a ? in the services URL, no further one is added
79
112
  - Cesium tileset: set visibility and set opacity was fixed.
80
113
  - Webgl: set default style for feature and fix the opacity problem
81
114
 
82
115
  ---
83
116
 
84
- ### 2.27.0 - 2023-08-31
85
- ## Changed
117
+ ## 2.27.0 - 2023-08-31
118
+ ### Changed
86
119
  - VectorStyle: 'initializeStyleList' is asynchron, waits for loading finished and returns the loaded styles.
87
120
 
88
121
  ---
89
122
 
90
- ### 2.26.0 - 2023-08-23
91
- ## Changed
123
+ ## 2.26.0 - 2023-08-23
124
+ ### Changed
92
125
  - The following packages have been updated:
93
126
  - dependencies:
94
127
  - ol: 7.4.0 to 7.5.1
package/jest.config.js CHANGED
@@ -6,7 +6,7 @@ module.exports = {
6
6
  /** ol prints errors without HTMLCanvasElement being available in test environment */
7
7
  "setupFiles": ["jest-canvas-mock"],
8
8
  /** node_modules are usually ignored by babel-jest, but ol is published in ES6 */
9
- "transformIgnorePatterns": ["/node_modules/(?!(ol|olcs|ol-mapbox-style|geotiff|quick-lru)/).*/"],
9
+ "transformIgnorePatterns": ["/node_modules/(?!(ol|olcs|ol-mapbox-style|geotiff|quick-lru|color-space|color-rgba|color-parse)/).*/"],
10
10
  /** only consider files in src/ for coverage */
11
11
  "collectCoverageFrom": ["src/**/*.js"],
12
12
  /** coverage reporters */
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
- {
2
- "name": "@masterportal/masterportalapi",
3
- "author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
4
- "version": "2.31.0",
5
- "license": "MIT",
6
- "description": "Basic functions of the Masterportal as api",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git"
10
- },
11
- "main": "src/index.js",
12
- "scripts": {
13
- "test": "jest .test.js --config ./jest.config.js --collectCoverage",
14
- "test:trace": "node --trace-warnings node_modules/jest/bin/jest.js .test.js --config ./jest.config.js",
15
- "test:watch": "jest .test.js --config ./jest.config.js --watch",
16
- "example": "parcel example/index.html",
17
- "generate-jsdoc": "jsdoc ./src -r -d ./docs/ -R ./README.md -c jsdoc.json",
18
- "prePushHook": "eslint --max-warnings 0 \"./**/*.js\" && npm run test",
19
- "prepare": "husky install"
20
- },
21
- "dependencies": {
22
- "core-js": "^3.33.1",
23
- "dayjs": "^1.11.10",
24
- "ol": "8.1.0",
25
- "ol-mapbox-style": "12.0.0",
26
- "olcs": "2.16.0",
27
- "proj4": "^2.9.1",
28
- "xml2js": "^0.6.2"
29
- },
30
- "devDependencies": {
31
- "@babel/core": "^7.23.2",
32
- "@babel/plugin-transform-modules-commonjs": "^7.23.0",
33
- "@parcel/transformer-sass": "^2.10.0",
34
- "@swc/jest": "^0.2.29",
35
- "assert": "^2.1.0",
36
- "browserify-zlib": "^0.2.0",
37
- "buffer": "^6.0.3",
38
- "canvas": "^2.11.2",
39
- "eslint": "^8.52.0",
40
- "events": "^3.3.0",
41
- "https-browserify": "^1.0.0",
42
- "husky": "^8.0.3",
43
- "jest": "^29.7.0",
44
- "jest-canvas-mock": "^2.5.2",
45
- "jest-environment-jsdom": "^29.7.0",
46
- "jest-fetch-mock": "^3.0.3",
47
- "jsdoc": "^4.0.2",
48
- "parcel": "^2.10.0",
49
- "process": "^0.11.10",
50
- "sass": "^1.69.4",
51
- "stream-browserify": "^3.0.0",
52
- "stream-http": "^3.2.0",
53
- "timers-browserify": "^2.0.12",
54
- "url": "^0.11.3",
55
- "use-resize-observer": "^9.1.0",
56
- "util": "^0.12.5"
57
- },
58
- "peerDependencies": {
59
- "@cesium/engine": "^2.4.1"
60
- },
61
- "engines": {
62
- "node": "^16.13.2 || ^18.12.0 || ^20.9.0",
63
- "npm": "^8.1.2 || ^9.3.1 || ^10.1.0"
64
- },
65
- "homepage": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi#readme",
66
- "directories": {
67
- "example": "example",
68
- "test": "test"
69
- },
70
- "bugs": {
71
- "url": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/issues"
72
- }
73
- }
1
+ {
2
+ "name": "@masterportal/masterportalapi",
3
+ "author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
4
+ "version": "2.33.0",
5
+ "license": "MIT",
6
+ "description": "Basic functions of the Masterportal as api",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git"
10
+ },
11
+ "main": "src/index.js",
12
+ "scripts": {
13
+ "test": "jest .test.js --config ./jest.config.js --collectCoverage",
14
+ "test:trace": "node --trace-warnings node_modules/jest/bin/jest.js .test.js --config ./jest.config.js",
15
+ "test:watch": "jest .test.js --config ./jest.config.js --watch",
16
+ "example": "parcel example/index.html",
17
+ "generate-jsdoc": "jsdoc ./src -r -d ./docs/ -R ./README.md -c jsdoc.json",
18
+ "prePushHook": "eslint --max-warnings 0 \"./**/*.js\" && npm run test",
19
+ "prepare": "husky install"
20
+ },
21
+ "dependencies": {
22
+ "core-js": "^3.33.1",
23
+ "dayjs": "^1.11.10",
24
+ "ol": "8.2.0",
25
+ "ol-mapbox-style": "12.0.0",
26
+ "olcs": "2.16.0",
27
+ "proj4": "^2.9.1",
28
+ "xml2js": "^0.6.2"
29
+ },
30
+ "devDependencies": {
31
+ "@babel/core": "^7.23.2",
32
+ "@babel/plugin-transform-modules-commonjs": "^7.23.0",
33
+ "@parcel/transformer-sass": "^2.10.0",
34
+ "@swc/jest": "^0.2.29",
35
+ "assert": "^2.1.0",
36
+ "browserify-zlib": "^0.2.0",
37
+ "buffer": "^6.0.3",
38
+ "canvas": "^2.11.2",
39
+ "eslint": "^8.52.0",
40
+ "events": "^3.3.0",
41
+ "https-browserify": "^1.0.0",
42
+ "husky": "^8.0.3",
43
+ "jest": "^29.7.0",
44
+ "jest-canvas-mock": "^2.5.2",
45
+ "jest-environment-jsdom": "^29.7.0",
46
+ "jest-fetch-mock": "^3.0.3",
47
+ "jsdoc": "^4.0.2",
48
+ "parcel": "^2.10.0",
49
+ "process": "^0.11.10",
50
+ "sass": "^1.69.4",
51
+ "stream-browserify": "^3.0.0",
52
+ "stream-http": "^3.2.0",
53
+ "timers-browserify": "^2.0.12",
54
+ "url": "^0.11.3",
55
+ "use-resize-observer": "^9.1.0",
56
+ "util": "^0.12.5"
57
+ },
58
+ "peerDependencies": {
59
+ "@cesium/engine": "^6.2.0"
60
+ },
61
+ "engines": {
62
+ "node": "^16.13.2 || ^18.12.0 || ^20.9.0",
63
+ "npm": "^8.1.2 || ^9.3.1 || ^10.1.0"
64
+ },
65
+ "homepage": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi#readme",
66
+ "directories": {
67
+ "example": "example",
68
+ "test": "test"
69
+ },
70
+ "bugs": {
71
+ "url": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/issues"
72
+ }
73
+ }
@@ -6,12 +6,13 @@
6
6
  * @returns {void}
7
7
  */
8
8
  async function createTerrainProvider (rawLayer) {
9
- const options = {},
10
- terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl(rawLayer.url, options);
9
+ const options = {};
10
+ let terrainProvider = "";
11
11
 
12
12
  if (rawLayer.cesiumTerrainProviderOptions) {
13
13
  Object.assign(options, rawLayer.cesiumTerrainProviderOptions);
14
14
  }
15
+ terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl(rawLayer.url, options);
15
16
 
16
17
  return terrainProvider;
17
18
  }
@@ -261,7 +261,9 @@ function createStyle (styleObject, feature, isClustered, wfsImgPathFromConfig) {
261
261
  styleObjectGeometry.setText(getLabelStyle(feature, style, isClustered));
262
262
  }
263
263
  }
264
- feature.setStyle(styleObjectGeometry);
264
+ if (feature?.getGeometry().getType() === "Point" || feature?.getGeometry().getType() === "MultiPoint") {
265
+ feature.setStyle(styleObjectGeometry);
266
+ }
265
267
  return styleObjectGeometry;
266
268
  }
267
269
 
@@ -263,7 +263,6 @@ describe("createStyle", () => {
263
263
  style.forEach(aStyle => {
264
264
  expect(aStyle).toBeInstanceOf(Style);
265
265
  });
266
- expect(multiLineStringFeature.getStyle()).toEqual(style);
267
266
  });
268
267
 
269
268
  it("should return the correct style for a feature with geometry of type MultiPolygon ", () => {
@@ -297,7 +296,6 @@ describe("createStyle", () => {
297
296
  style.forEach(aStyle => {
298
297
  expect(aStyle).toBeInstanceOf(Style);
299
298
  });
300
- expect(multiPolygonFeature.getStyle()).toEqual(style);
301
299
  });
302
300
 
303
301
  it("should return the correct style for a feature with geometry of type GeometryCollection ", () => {
@@ -331,7 +329,6 @@ describe("createStyle", () => {
331
329
  style.forEach(aStyle => {
332
330
  expect(aStyle).toBeInstanceOf(Style);
333
331
  });
334
- expect(geometryCollectionFeature.getStyle()).toEqual(style);
335
332
  });
336
333
 
337
334
  it("should return the correct style for a feature with geometry of type MultiPoint ", () => {