@masterportal/masterportalapi 2.28.0 → 2.30.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,16 +3,53 @@
3
3
 
4
4
  The [Semantic Versioning](https://semver.org/spec/v2.0.0.html) is used.
5
5
 
6
- ### Unreleased - in development
7
- ## Added
8
-
6
+ ### 2.30.0 - 2023-11-28
9
7
  ## Changed
8
+ - WMS-Layer and WMTS-Layer: create Layer no longer evaluates the minScale and maxScale attributes, but instead minResolution and maxResolution can be transferred.
9
+
10
+ ## Fixed
11
+ - Issue Masterportal #1052 VectorStyle: fixed blinking of initial loaded features on great amount of features with a lot of conditional styles.
12
+ - Issue Masterportal #1088: gfiAttibutes with type=html are not displayed if there is no value in the data.
13
+ - Issue Masterportal #1091: VectorStyle: read geometry type from geoserver featureTypeRequest
14
+ ---
10
15
 
11
- ## Deprecated
16
+ ### 2.29.0 - 2023-10-27
17
+ ## Added
18
+ - The following packages from parcel automatic were installed for node builtin:
19
+ - dependencies:
20
+ - assert": 2.1.0,
21
+ - browserify-zlib: 0.2.0,
22
+ - https-browserify: 1.0.0
23
+ - stream-http: 3.2.0
24
+ - url: 0.11.3
25
+ - util: 0.12.5
26
+ - The following packages have been added:
27
+ - dependencies:
28
+ - ol-mapbox-style: 12.0.0
12
29
 
13
- ## Removed
30
+ ## Changed
31
+ - The following packages have been updated:
32
+ - dependencies:
33
+ - core-js: 3.32.0 to 3.33.1
34
+ - dayjs: 1.11.9 to 1.11.10
35
+ - ol: 7.5.2 to 8.1.0 (includes the change of the symbol style format in ol/layer/WebGLPointsLayer)
36
+ - olcs: 2.15.0 to 2.16.0
37
+ - proj4: 2.9.0 to 2.9.1
38
+ - devDependencies:
39
+ - @babel/core: 7.22.9 to 7.23.2
40
+ - @babel/plugin-transform-modules-commonjs: 7.22.5 to 7.23.2
41
+ - @parcel/transformer-sass: 2.9.3 to 2.10.0
42
+ - @swc/jest: 0.2.27 to 0.2.29
43
+ - eslint: 8.46.0 to 8.52.0
44
+ - jest: 29.6.2 to 29.7.0
45
+ - jest-environment-jsdom: 29.6.2 to 29.7.0
46
+ - parcel: 2.9.3 to 2.10.0
47
+ - sass: 1.64.2 to 1.69.4
48
+ - Revert Cesium.Cesium3DTileset.fromUrl(url, options) adaptions in tileset.js for Cesium v1.107 deprecated warnings
14
49
 
15
50
  ## Fixed
51
+ - styleList: styles of type oaf are now also added to the stylelist
52
+ - 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.
16
53
 
17
54
  ---
18
55
 
@@ -56,30 +56,11 @@
56
56
  "renderer": "webgl",
57
57
  "hitTolerance": 20,
58
58
  "isPointLayer": true,
59
- "style": {
60
- "symbol": {
61
- "symbolType": "circle",
62
- "size": [
63
- "interpolate",
64
- ["linear"],
65
- ["get", "Total_votes"],
66
- 0,
67
- 6,
68
- 18,
69
- 24
70
- ],
71
- "color": [
72
- "interpolate",
73
- ["linear"],
74
- ["get", "compound"],
75
- -1,
76
- [240, 40, 30],
77
- 1,
78
- [0, 200, 60]
79
- ],
80
- "opacity": 0.8,
81
- "rotateWithView": true
82
- }
59
+ "style":{
60
+ "circle-radius": [ "interpolate", ["linear"], ["get", "Total_votes"], 0, 3, 18, 12 ],
61
+ "circle-fill-color": [ "interpolate", ["linear"], ["get", "compound"], -1, [240, 40, 30], 1, [0, 200, 60] ],
62
+ "circle-rotate-with-view": true,
63
+ "circle-opacity": 0.8
83
64
  }
84
65
  }
85
66
  ],
@@ -32,7 +32,7 @@
32
32
  "id": "2001",
33
33
  "typ": "GeoJSON",
34
34
  "name": "Landesgrenze Hamburg",
35
- "url": "https://geoportal-hamburg.de/lgv-config/landesgrenze_hh.json"
35
+ "url": "https://geodienste.hamburg.de/lgv-config/landesgrenze_hh.json"
36
36
  },
37
37
  {
38
38
  "id": "3001",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@masterportal/masterportalapi",
3
3
  "author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
4
- "version": "2.28.0",
4
+ "version": "2.30.0",
5
5
  "license": "MIT",
6
6
  "description": "Basic functions of the Masterportal as api",
7
7
  "repository": {
@@ -19,34 +19,41 @@
19
19
  "prepare": "husky install"
20
20
  },
21
21
  "dependencies": {
22
- "core-js": "^3.32.0",
23
- "dayjs": "^1.11.9",
24
- "ol": "7.5.2",
25
- "olcs": "2.15.0",
26
- "proj4": "^2.9.0",
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",
27
28
  "xml2js": "^0.6.2"
28
29
  },
29
30
  "devDependencies": {
30
- "@babel/core": "^7.22.9",
31
- "@babel/plugin-transform-modules-commonjs": "^7.22.5",
32
- "@parcel/transformer-sass": "^2.9.3",
33
- "@swc/jest": "^0.2.27",
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",
34
37
  "buffer": "^6.0.3",
35
38
  "canvas": "^2.11.2",
36
- "eslint": "^8.46.0",
39
+ "eslint": "^8.52.0",
37
40
  "events": "^3.3.0",
41
+ "https-browserify": "^1.0.0",
38
42
  "husky": "^8.0.3",
39
- "jest": "^29.6.2",
43
+ "jest": "^29.7.0",
40
44
  "jest-canvas-mock": "^2.5.2",
41
- "jest-environment-jsdom": "^29.6.2",
45
+ "jest-environment-jsdom": "^29.7.0",
42
46
  "jest-fetch-mock": "^3.0.3",
43
47
  "jsdoc": "^4.0.2",
44
- "parcel": "^2.9.3",
48
+ "parcel": "^2.10.0",
45
49
  "process": "^0.11.10",
46
- "sass": "^1.64.2",
50
+ "sass": "^1.69.4",
47
51
  "stream-browserify": "^3.0.0",
52
+ "stream-http": "^3.2.0",
48
53
  "timers-browserify": "^2.0.12",
49
- "use-resize-observer": "^9.1.0"
54
+ "url": "^0.11.3",
55
+ "use-resize-observer": "^9.1.0",
56
+ "util": "^0.12.5"
50
57
  },
51
58
  "peerDependencies": {
52
59
  "@cesium/engine": "^2.4.1"
@@ -39,7 +39,6 @@ export default function Tileset (rawLayer) {
39
39
  tileset.layerReferenceId = rawLayer.id;
40
40
  }
41
41
  });
42
-
43
42
  }
44
43
  }
45
44
 
package/src/layer/wms.js CHANGED
@@ -74,6 +74,13 @@ export function makeParams (rawLayer) {
74
74
  return params;
75
75
  }
76
76
 
77
+ async function defaultTileLoadFunction (imageTile, src) {
78
+ const response = await fetch(src),
79
+ data = await response.blob();
80
+
81
+ imageTile.getImage().src = URL.createObjectURL(data);
82
+ }
83
+
77
84
  /**
78
85
  * Creates an ol/source element for the rawLayer.
79
86
  * @param {object} rawLayer - layer specification as in services.json
@@ -118,7 +125,8 @@ export function createLayerSource (rawLayer, options) {
118
125
  tileGrid: tileGrid,
119
126
  projection: projection,
120
127
  attributions: rawLayer.olAttribution,
121
- crossOrigin: rawLayer.crossOrigin
128
+ crossOrigin: rawLayer.crossOrigin,
129
+ tileLoadFunction: defaultTileLoadFunction
122
130
  });
123
131
  }
124
132
 
@@ -127,8 +135,8 @@ export function createLayerSource (rawLayer, options) {
127
135
  * @param {object} rawLayer - layer specification as in services.json
128
136
  * @param {string} [rawLayer.id] - optional id of the layer, passed to help identification in services.json
129
137
  * @param {string} [rawLayer.url] - WMS service URL
130
- * @param {string} [rawLayer.minScale] - optional the minimal resolution
131
- * @param {string} [rawLayer.maxScale] - optional the maximal resolution
138
+ * @param {string} [rawLayer.minResolution] - optional the minimal resolution
139
+ * @param {string} [rawLayer.maxResolution] - optional the maximal resolution
132
140
  * @param {string} [rawLayer.serverType] - optional servertype definition: "geoserver" or "mapserver" or "qgis"
133
141
  * @param {string} [rawLayer.gutter] - optional the size in pixels of the gutter around image tiles to ignore
134
142
  * @param {function} [rawLayer.olAttribution] - optional function that takes a module:ol/Map~FrameState and returns a string or an array of strings representing source attributions
@@ -148,8 +156,8 @@ export function createLayer (rawLayer, layerParams = {}, options) {
148
156
 
149
157
  return new Layer(Object.assign({
150
158
  source,
151
- minResolution: rawLayer.minScale,
152
- maxResolution: rawLayer.maxScale,
159
+ minResolution: typeof rawLayer.minResolution === "string" ? parseFloat(rawLayer.minResolution) : rawLayer.minResolution,
160
+ maxResolution: typeof rawLayer.maxResolution === "string" ? parseFloat(rawLayer.maxResolution) : rawLayer.maxResolution,
153
161
  id: rawLayer.id
154
162
  }, layerParams));
155
163
  }
package/src/layer/wmts.js CHANGED
@@ -176,8 +176,8 @@ function createLayer (rawLayer, layerParams = {}) {
176
176
  id: rawLayer.id,
177
177
  source: new WMTS({}),
178
178
  name: rawLayer.name,
179
- minResolution: rawLayer.minScale,
180
- maxResolution: rawLayer.maxScale,
179
+ minResolution: typeof rawLayer.minResolution === "string" ? parseFloat(rawLayer.minResolution) : rawLayer.minResolution,
180
+ maxResolution: typeof rawLayer.maxResolution === "string" ? parseFloat(rawLayer.maxResolution) : rawLayer.maxResolution,
181
181
  supported: ["2D", "3D"],
182
182
  showSettings: true,
183
183
  extent: null,
@@ -198,29 +198,27 @@ function prepareValueFromObject (key, mappingObj, properties) {
198
198
  break;
199
199
  }
200
200
  case "html": {
201
- // create tag
202
- if (mappingObj?.html?.tag) {
203
- htmltag = document.createElement(mappingObj?.html?.tag);
204
- }
205
- // create innerHTML
206
- if (mappingObj?.html?.innerHTML === "%value%") {
207
- htmltag.innerHTML = preparedValue;
208
- }
209
- else if (mappingObj?.html?.innerHTML) {
210
- htmltag.innerHTML = mappingObj?.html?.innerHTML;
211
- }
212
-
213
-
214
- if (htmltag) {
215
- if (mappingObj?.html?.properties) {
216
- htmltag = addPropertiesToHtmlTag(htmltag, mappingObj?.html?.properties, preparedValue);
201
+ if (preparedValue !== undefined) {
202
+ // create tag
203
+ if (mappingObj?.html?.tag) {
204
+ htmltag = document.createElement(mappingObj?.html?.tag);
205
+ }
206
+ // create innerHTML
207
+ if (mappingObj?.html?.innerHTML === "%value%") {
208
+ htmltag.innerHTML = preparedValue;
209
+ }
210
+ else if (mappingObj?.html?.innerHTML) {
211
+ htmltag.innerHTML = mappingObj?.html?.innerHTML;
212
+ }
213
+ if (htmltag) {
214
+ if (mappingObj?.html?.properties) {
215
+ htmltag = addPropertiesToHtmlTag(htmltag, mappingObj?.html?.properties, preparedValue);
216
+ }
217
+ preparedValue = serializer.serializeToString(htmltag);
218
+ // remove xmlns
219
+ preparedValue = preparedValue.replace(/ xmlns="(.*?)"/g, "");
217
220
  }
218
- preparedValue = serializer.serializeToString(htmltag);
219
- // remove xmlns
220
- preparedValue = preparedValue.replace(/ xmlns="(.*?)"/g, "");
221
-
222
221
  }
223
-
224
222
  break;
225
223
  }
226
224
  // default equals to mappingObj.type === "string"
@@ -6,8 +6,8 @@ import {getUid} from "olcs/util.js";
6
6
  import TileWMS from "ol/source/TileWMS.js";
7
7
  import ImageWMS from "ol/source/ImageWMS.js";
8
8
  import WMTS from "ol/source/WMTS.js";
9
- import olcsAbstractSynchronizer from "olcs/AbstractSynchronizer.ts";
10
- import {extentToRectangle, tileLayerToImageryLayer, updateCesiumLayerProperties} from "olcs/core.ts";
9
+ import olcsAbstractSynchronizer from "olcs/AbstractSynchronizer.js";
10
+ import {extentToRectangle, tileLayerToImageryLayer, updateCesiumLayerProperties} from "olcs/core.js";
11
11
  import {Tile, Image as ImageLayer} from "ol/layer.js";
12
12
  import {stableSort} from "ol/array.js";
13
13
  import {getBottomLeft, getBottomRight, getTopRight, getTopLeft} from "ol/extent.js";
@@ -1,6 +1,6 @@
1
- import OLCesium from "olcs/OLCesium.ts";
1
+ import OLCesium from "olcs/OLCesium.js";
2
2
  import {transform, get} from "ol/proj.js";
3
- import VectorSynchronizer from "olcs/VectorSynchronizer.ts";
3
+ import VectorSynchronizer from "olcs/VectorSynchronizer.js";
4
4
 
5
5
  import FixedOverlaySynchronizer from "./3dUtils/fixedOverlaySynchronizer.js";
6
6
  import WMSRasterSynchronizer from "./3dUtils/wmsRasterSynchronizer.js";
@@ -15,14 +15,11 @@ import {packColor, parseLiteralStyle} from "ol/webgl/styleparser.js";
15
15
  * @private
16
16
  */
17
17
  const defaultPointStyle = {
18
- symbol: {
19
- symbolType: "circle",
20
- size: 20,
21
- color: "#006688",
22
- rotateWithView: false,
23
- offset: [0, 0],
24
- opacity: 0.6
25
- }
18
+ "circle-radius": 10,
19
+ "circle-fill-color": "#006688",
20
+ "circle-rotate-with-view": false,
21
+ "circle-displacement": [0, 0],
22
+ "circle-opacity": 0.6
26
23
  },
27
24
 
28
25
  defaultPolygonStyle = {
@@ -33,14 +30,13 @@ const defaultPointStyle = {
33
30
  },
34
31
 
35
32
  /** @type {import('ol/style/literal.js').LiteralStyle} */
36
- style = {
33
+ style = Object.assign({
37
34
  "stroke-color": ["get", "strokeColor"],
38
35
  "stroke-width": ["get", "strokeWidth", "number"],
39
36
  "fill-color": ["get", "fillColor"],
40
37
  "opacity": ["get", "opacity", "number"],
41
- "size": ["get", "circleSize", "number"],
42
- symbol: defaultPointStyle.symbol
43
- };
38
+ "size": ["get", "circleSize", "number"]
39
+ }, defaultPointStyle);
44
40
 
45
41
  /**
46
42
  * Creates a vector layer with custom renderer.
@@ -194,14 +190,14 @@ export function formatFeatureStyles (feature, styleObject) {
194
190
  feature.set("strokeColor", strokeColor || defaultPolygonStyle.strokeColor);
195
191
  feature.set("strokeWidth", strokeWidth || defaultPolygonStyle.strokeWidth);
196
192
  feature.set("opacity", fillColor ? (rule.style.polygonFillColor || rule.style.circleFillColor)[3] : defaultPolygonStyle.opacity);
197
- feature.set("circleSize", size || defaultPointStyle.symbol.size);
193
+ feature.set("circleSize", size || defaultPointStyle["circle-radius"] * 2);
198
194
  }
199
195
  else {
200
196
  feature.set("fillColor", defaultPolygonStyle.fillColor);
201
197
  feature.set("strokeColor", defaultPolygonStyle.strokeColor);
202
198
  feature.set("strokeWidth", defaultPolygonStyle.strokeWidth);
203
199
  feature.set("opacity", defaultPolygonStyle.opacity);
204
- feature.set("circleSize", defaultPointStyle.symbol.size);
200
+ feature.set("circleSize", defaultPointStyle["circle-radius"] * 2);
205
201
  }
206
202
  }
207
203
 
@@ -216,7 +216,7 @@ function captureLegendFromFeature (styleId, legendInformation) {
216
216
  }
217
217
 
218
218
  /**
219
- * Function is called from layer models for each feature.
219
+ * Creates the style for the feature regarding the styleObject and sets style at feature.
220
220
  * @param {String} styleObject id of the style
221
221
  * @param {ol/feature} feature the feature to style
222
222
  * @param {Boolean} isClustered is feature clustered
@@ -261,6 +261,7 @@ function createStyle (styleObject, feature, isClustered, wfsImgPathFromConfig) {
261
261
  styleObjectGeometry.setText(getLabelStyle(feature, style, isClustered));
262
262
  }
263
263
  }
264
+ feature.setStyle(styleObjectGeometry);
264
265
  return styleObjectGeometry;
265
266
  }
266
267
 
@@ -1,5 +1,15 @@
1
1
  import {createLegendInfo} from "./createLegendInfo";
2
2
 
3
+ /**
4
+ * Returns true, if sibling element's tag name end with 'complexType' and its name contains the featureType.
5
+ * @param {String} sibling XML-Element to inspect
6
+ * @param {String } featureType wfs feature type from layer without namespace
7
+ * @returns {boolean} true, if sibling element's tag name end with 'complexType' and its name contains the featureType
8
+ */
9
+ function siblingContainsFeatureType (sibling, featureType) {
10
+ return sibling && sibling.tagName.endsWith("complexType") && sibling.hasAttribute("name") && sibling.getAttribute("name").includes(featureType);
11
+ }
12
+
3
13
  /**
4
14
  * Parses the xml with another structure to get the subelements from the layer
5
15
  * @param {string} xml response xml
@@ -12,11 +22,18 @@ function getSubelementsFromXMLOtherStructure (xml, featureType) {
12
22
 
13
23
  elements.forEach(element => {
14
24
  if (element.getAttribute("name") === featureType) {
15
- const sibling = element.nextElementSibling;
25
+ let sibling = element.nextElementSibling;
16
26
 
17
- if (sibling && sibling.tagName.endsWith("complexType") && sibling.hasAttribute("name")) {
27
+ if (siblingContainsFeatureType(sibling, featureType)) {
18
28
  subElements = Array.from(sibling.getElementsByTagNameNS("*", "element"));
19
29
  }
30
+ else if (element.previousElementSibling) {
31
+ sibling = element.previousElementSibling;
32
+
33
+ if (siblingContainsFeatureType(sibling, featureType)) {
34
+ subElements = Array.from(sibling.getElementsByTagNameNS("*", "element"));
35
+ }
36
+ }
20
37
  }
21
38
  });
22
39
  return subElements;
@@ -160,5 +177,7 @@ function getGeometryTypeFromOAF (rules, oafURL, collection, wfsImgPath, callback
160
177
 
161
178
  export default {
162
179
  getGeometryTypeFromWFS,
163
- getGeometryTypeFromOAF
180
+ getGeometryTypeFromOAF,
181
+ getSubelementsFromXML,
182
+ getTypeAttributesFromSubelements
164
183
  };
@@ -30,7 +30,7 @@ function getStyleIdsFromLayers () {
30
30
 
31
31
  if (configuredLayers) {
32
32
  configuredLayers.forEach(layer => {
33
- if (layer.typ === "WFS" || layer.typ === "GeoJSON" || layer.typ === "SensorThings" || layer.typ === "TileSet3D") {
33
+ if (layer.typ === "WFS" || layer.typ === "GeoJSON" || layer.typ === "SensorThings" || layer.typ === "TileSet3D" || layer.typ === "OAF") {
34
34
  if (layer?.styleId) {
35
35
  styleIds.push(layer.styleId);
36
36
  }
@@ -1,6 +1,5 @@
1
1
  import {Style, Icon} from "ol/style.js";
2
2
  import {prepareValue, isObjectPath} from "../../../lib/attributeMapper";
3
- import PointStyle from "./stylePoint";
4
3
 
5
4
  /**
6
5
  * Returns the rotation value and its corresponding value according to style.json.
@@ -33,21 +32,23 @@ export function getRotationValue (rotation, featureValues) {
33
32
  */
34
33
  export function createIconStyle (attributes, feature, isClustered) {
35
34
  const showCluster = isClustered && feature.get("features")?.length > 1,
36
-
37
- height = showCluster ? attributes.clusterImageHeight : attributes.imageHeight,
38
35
  imageName = showCluster ? attributes.clusterImageName : attributes.imageName,
39
36
  imageOffsetX = showCluster ? attributes.clusterImageOffsetY : attributes.imageOffsetX,
40
37
  imageOffsetY = showCluster ? attributes.clusterImageOffsetX : attributes.imageOffsetY,
41
38
  scale = showCluster ? attributes.clusterImageScale : attributes.imageScale,
42
- src = imageName.indexOf("/") === -1 ? attributes.imagePath + imageName : imageName,
43
- width = showCluster ? attributes.clusterImageWidth : attributes.imageWidth,
44
- iconOptions = {
45
- crossOrigin: "anonymous",
46
- src: src.startsWith("<svg") ? "data:image/svg+xml;charset=utf-8," + encodeURIComponent(src) : src,
47
- scale,
48
- anchor: [parseFloat(imageOffsetX), parseFloat(imageOffsetY)],
49
- imgSize: src.indexOf(".svg") > -1 ? [width, height] : ""
50
- };
39
+ wfsImgPath = attributes.imagePath;
40
+ let iconOptions = {},
41
+ src = imageName;
42
+
43
+ if (!imageName.startsWith("https:") && !imageName.startsWith("<svg")) {
44
+ src = wfsImgPath + imageName;
45
+ }
46
+ iconOptions = {
47
+ crossOrigin: "anonymous",
48
+ src: src.startsWith("<svg") ? "data:image/svg+xml;charset=utf-8," + encodeURIComponent(src) : src,
49
+ scale,
50
+ anchor: [parseFloat(imageOffsetX), parseFloat(imageOffsetY)]
51
+ };
51
52
 
52
53
  if (!showCluster) {
53
54
  iconOptions.anchorXUnits = attributes.imageOffsetXUnit;
@@ -67,13 +68,10 @@ export function createIconStyle (attributes, feature, isClustered) {
67
68
  * @return {ol.Style} style
68
69
  */
69
70
  export function createSVGStyle (svgPath) {
70
- const size = PointStyle.prototype.getSize();
71
-
72
71
  return new Style({
73
72
  image: new Icon({
74
73
  crossOrigin: "anonymous",
75
- src: "data:image/svg+xml;charset=utf-8," + encodeURIComponent(svgPath),
76
- imgSize: [size, size]
74
+ src: "data:image/svg+xml;charset=utf-8," + encodeURIComponent(svgPath)
77
75
  })
78
76
  });
79
77
  }
@@ -303,14 +303,13 @@ describe("src/utils/attributeMapper.js", () => {
303
303
  url: "<a href=\"http://random.url.de\"></a>"
304
304
  });
305
305
  });
306
- it("should map object with mapping object and type:html and tag a", () => {
306
+ it("should NOT map object with mapping object and type:html and tag a - value not defined", () => {
307
307
  const mappingObj = {
308
308
  random_url: {
309
309
  name: "url",
310
310
  type: "html",
311
311
  html: {
312
312
  tag: "a",
313
- innerHTML: "%value%",
314
313
  properties: {
315
314
  href: "%value%"
316
315
  }
@@ -319,9 +318,28 @@ describe("src/utils/attributeMapper.js", () => {
319
318
  };
320
319
 
321
320
  expect(mapAttributes(props, mappingObj)).toEqual({
322
- url: "<a href=\"http://random.url.de\">http://random.url.de</a>"
321
+ url: "<a href=\"http://random.url.de\"></a>"
323
322
  });
324
323
  });
324
+ it("should map object with mapping object and type:html and tag a", () => {
325
+ const mappingObj = {
326
+ random_url: {
327
+ name: "url",
328
+ type: "html",
329
+ html: {
330
+ tag: "a",
331
+ innerHTML: "%value%",
332
+ properties: {
333
+ href: "%value%"
334
+ }
335
+ }
336
+ }
337
+ },
338
+ properties = Object.assign({}, props);
339
+
340
+ properties.random_url = undefined;
341
+ expect(mapAttributes(properties, mappingObj)).toEqual({});
342
+ });
325
343
  it("should map object with mapping object and type:html and tag a without innerHTML and properties", () => {
326
344
  const mappingObj = {
327
345
  random_url: {
@@ -238,6 +238,7 @@ describe("createStyle", () => {
238
238
  style = createStyle.createStyle(styleObject, jsonObjects[0], isClustered, wfsImgPathFromConfig);
239
239
 
240
240
  expect(style).toBeInstanceOf(Style);
241
+ expect(jsonObjects[0].getStyle()).toEqual(style);
241
242
  });
242
243
 
243
244
  it("should return the correct style for a feature with geometry of type MultiLineString ", () => {
@@ -262,6 +263,7 @@ describe("createStyle", () => {
262
263
  style.forEach(aStyle => {
263
264
  expect(aStyle).toBeInstanceOf(Style);
264
265
  });
266
+ expect(multiLineStringFeature.getStyle()).toEqual(style);
265
267
  });
266
268
 
267
269
  it("should return the correct style for a feature with geometry of type MultiPolygon ", () => {
@@ -295,6 +297,7 @@ describe("createStyle", () => {
295
297
  style.forEach(aStyle => {
296
298
  expect(aStyle).toBeInstanceOf(Style);
297
299
  });
300
+ expect(multiPolygonFeature.getStyle()).toEqual(style);
298
301
  });
299
302
 
300
303
  it("should return the correct style for a feature with geometry of type GeometryCollection ", () => {
@@ -328,6 +331,7 @@ describe("createStyle", () => {
328
331
  style.forEach(aStyle => {
329
332
  expect(aStyle).toBeInstanceOf(Style);
330
333
  });
334
+ expect(geometryCollectionFeature.getStyle()).toEqual(style);
331
335
  });
332
336
 
333
337
  it("should return the correct style for a feature with geometry of type MultiPoint ", () => {
@@ -361,6 +365,7 @@ describe("createStyle", () => {
361
365
  style.forEach(aStyle => {
362
366
  expect(aStyle).toBeInstanceOf(Style);
363
367
  });
368
+ expect(multiPointFeature.getStyle()).toEqual(style);
364
369
  });
365
370
  });
366
371
 
@@ -0,0 +1,141 @@
1
+ import getGeometryTypeFromService from "../../../src/vectorStyle/lib/getGeometryTypeFromService";
2
+ const fs = require("fs");
3
+ /* eslint-disable no-sync */
4
+
5
+ describe("getGeometryTypeFromService", function () {
6
+ describe("getSubelementsFromXML and getTypeAttributesFromSubelements", function () {
7
+ it("desribeFeatureType response opengis schema contains Point", function () {
8
+ let attributes = null;
9
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_opengis_point.xml", "utf8"),
10
+ featureType = "bike_und_ride",
11
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
12
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
13
+
14
+ expect(subElements.length).toEqual(11);
15
+
16
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
17
+ expect(attributes.length).toEqual(1);
18
+ expect(attributes[0]).toEqual("Point");
19
+ });
20
+
21
+ it("desribeFeatureType response opengis schema contains 'Geometry'", function () {
22
+ let attributes = null;
23
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_opengis_geometry.xml", "utf8"),
24
+ featureType = "hamburgconvention",
25
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
26
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
27
+
28
+ expect(subElements.length).toEqual(56);
29
+
30
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
31
+ expect(attributes.length).toEqual(3);
32
+ expect(attributes[0]).toEqual("Point");
33
+ expect(attributes[1]).toEqual("Polygon");
34
+ expect(attributes[2]).toEqual("LineString");
35
+ });
36
+
37
+ it("desribeFeatureType response opengis schema with namespace contains 'Geometry'", function () {
38
+ let attributes = null;
39
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_xsd_opengis_geometry.xml", "utf8"),
40
+ featureType = "s_parkraumbewirt",
41
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
42
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
43
+
44
+ expect(subElements.length).toEqual(6);
45
+
46
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
47
+ expect(attributes.length).toEqual(3);
48
+ expect(attributes[0]).toEqual("Point");
49
+ expect(attributes[1]).toEqual("Polygon");
50
+ expect(attributes[2]).toEqual("LineString");
51
+ });
52
+
53
+ it("desribeFeatureType response opengis schema with namespace contains 'Geometry' use styleGeometryType", function () {
54
+ let attributes = null;
55
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_xsd_opengis_geometry.xml", "utf8"),
56
+ featureType = "s_parkraumbewirt",
57
+ styleGeometryType = "Point",
58
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
59
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
60
+
61
+ expect(subElements.length).toEqual(6);
62
+
63
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements, styleGeometryType);
64
+ expect(attributes.length).toEqual(1);
65
+ expect(attributes[0]).toEqual("Point");
66
+ });
67
+
68
+ it("desribeFeatureType response opengis schema contains 'MultiPolygon'", function () {
69
+ let attributes = null;
70
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_opengis_multi.xml", "utf8"),
71
+ featureType = "umring",
72
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
73
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
74
+
75
+ expect(subElements.length).toEqual(1);
76
+
77
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
78
+ expect(attributes.length).toEqual(1);
79
+ expect(attributes[0]).toEqual("MultiPolygon");
80
+ });
81
+
82
+ it("desribeFeatureType response opengis schema contains 'MultiLineString'", function () {
83
+ let attributes = null;
84
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_opengis_multi.xml", "utf8"),
85
+ featureType = "strecken",
86
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
87
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
88
+
89
+ expect(subElements.length).toEqual(3);
90
+
91
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
92
+ expect(attributes.length).toEqual(1);
93
+ expect(attributes[0]).toEqual("MultiLineString");
94
+ });
95
+
96
+ it("desribeFeatureType response opengis schema contains 'Polygon'", function () {
97
+ let attributes = null;
98
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_opengis_polygon.xml", "utf8"),
99
+ featureType = "nr_f_biosphaerenreservat",
100
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
101
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
102
+
103
+ expect(subElements.length).toEqual(9);
104
+
105
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
106
+ expect(attributes.length).toEqual(1);
107
+ expect(attributes[0]).toEqual("Polygon");
108
+ });
109
+
110
+ it("desribeFeatureType response geoserver schema contains 'Point'", function () {
111
+ let attributes = null;
112
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_geoserver.xml", "utf8"),
113
+ featureType = "nextbike_floating_berlin",
114
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
115
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
116
+
117
+ expect(subElements.length).toEqual(4);
118
+
119
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
120
+ expect(attributes.length).toEqual(1);
121
+ expect(attributes[0]).toEqual("Point");
122
+ });
123
+
124
+ it("desribeFeatureType response geoserver schema contains 'Point', nextbike_stations_berlin", function () {
125
+ let attributes = null;
126
+ const data = fs.readFileSync("test/vectorStyle/lib/resources/describeFeatureType_geoserver.xml", "utf8"),
127
+ featureType = "nextbike_stations_berlin",
128
+ xml = new window.DOMParser().parseFromString(data, "text/xml"),
129
+ subElements = getGeometryTypeFromService.getSubelementsFromXML(xml, featureType);
130
+
131
+ expect(subElements.length).toEqual(8);
132
+
133
+ attributes = getGeometryTypeFromService.getTypeAttributesFromSubelements(subElements);
134
+ expect(attributes.length).toEqual(1);
135
+ expect(attributes[0]).toEqual("Point");
136
+ });
137
+ });
138
+
139
+ });
140
+
141
+
@@ -0,0 +1,102 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:mdhwfs="mdhwfs" elementFormDefault="qualified" targetNamespace="mdhwfs">
2
+ <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://api.viz.berlin.de/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
3
+ <xsd:complexType name="baustellen_sperrungenType">
4
+ <xsd:complexContent>
5
+ <xsd:extension base="gml:AbstractFeatureType">
6
+ <xsd:sequence>
7
+ <xsd:element maxOccurs="1" minOccurs="0" name="id" nillable="true" type="xsd:string"/>
8
+ <xsd:element maxOccurs="1" minOccurs="0" name="tstore" nillable="true" type="xsd:dateTime"/>
9
+ <xsd:element maxOccurs="1" minOccurs="0" name="objectstate" nillable="true" type="xsd:string"/>
10
+ <xsd:element maxOccurs="1" minOccurs="0" name="subtype" nillable="true" type="xsd:string"/>
11
+ <xsd:element maxOccurs="1" minOccurs="0" name="severity" nillable="true" type="xsd:string"/>
12
+ <xsd:element maxOccurs="1" minOccurs="0" name="validity" nillable="true" type="xsd:string"/>
13
+ <xsd:element maxOccurs="1" minOccurs="0" name="direction" nillable="true" type="xsd:string"/>
14
+ <xsd:element maxOccurs="1" minOccurs="0" name="icon" nillable="true" type="xsd:string"/>
15
+ <xsd:element maxOccurs="1" minOccurs="0" name="is_future" nillable="true" type="xsd:boolean"/>
16
+ <xsd:element maxOccurs="1" minOccurs="0" name="street" nillable="true" type="xsd:string"/>
17
+ <xsd:element maxOccurs="1" minOccurs="0" name="section" nillable="true" type="xsd:string"/>
18
+ <xsd:element maxOccurs="1" minOccurs="0" name="content" nillable="true" type="xsd:string"/>
19
+ <xsd:element maxOccurs="1" minOccurs="0" name="wkb_geometry" nillable="true" type="gml:MultiGeometryPropertyType"/>
20
+ </xsd:sequence>
21
+ </xsd:extension>
22
+ </xsd:complexContent>
23
+ </xsd:complexType>
24
+ <xsd:element name="baustellen_sperrungen" substitutionGroup="gml:_Feature" type="mdhwfs:baustellen_sperrungenType"/>
25
+ <xsd:complexType name="nextbike_floating_berlinType">
26
+ <xsd:complexContent>
27
+ <xsd:extension base="gml:AbstractFeatureType">
28
+ <xsd:sequence>
29
+ <xsd:element maxOccurs="1" minOccurs="0" name="bike_id" nillable="true" type="xsd:string"/>
30
+ <xsd:element maxOccurs="1" minOccurs="0" name="lat" nillable="true" type="xsd:decimal"/>
31
+ <xsd:element maxOccurs="1" minOccurs="0" name="lon" nillable="true" type="xsd:decimal"/>
32
+ <xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:PointPropertyType"/>
33
+ </xsd:sequence>
34
+ </xsd:extension>
35
+ </xsd:complexContent>
36
+ </xsd:complexType>
37
+ <xsd:element name="nextbike_floating_berlin" substitutionGroup="gml:_Feature" type="mdhwfs:nextbike_floating_berlinType"/>
38
+ <xsd:complexType name="nextbike_stations_berlinType">
39
+ <xsd:complexContent>
40
+ <xsd:extension base="gml:AbstractFeatureType">
41
+ <xsd:sequence>
42
+ <xsd:element maxOccurs="1" minOccurs="0" name="station_name" nillable="true" type="xsd:string"/>
43
+ <xsd:element maxOccurs="1" minOccurs="0" name="station_id" nillable="true" type="xsd:int"/>
44
+ <xsd:element maxOccurs="1" minOccurs="0" name="short_name" nillable="true" type="xsd:int"/>
45
+ <xsd:element maxOccurs="1" minOccurs="0" name="lat" nillable="true" type="xsd:decimal"/>
46
+ <xsd:element maxOccurs="1" minOccurs="0" name="lon" nillable="true" type="xsd:decimal"/>
47
+ <xsd:element maxOccurs="1" minOccurs="0" name="capacity" nillable="true" type="xsd:int"/>
48
+ <xsd:element maxOccurs="1" minOccurs="0" name="bikes_avaílable" nillable="true" type="xsd:int"/>
49
+ <xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:PointPropertyType"/>
50
+ </xsd:sequence>
51
+ </xsd:extension>
52
+ </xsd:complexContent>
53
+ </xsd:complexType>
54
+ <xsd:element name="nextbike_stations_berlin" substitutionGroup="gml:_Feature" type="mdhwfs:nextbike_stations_berlinType"/>
55
+ <xsd:complexType name="parkdatenType">
56
+ <xsd:complexContent>
57
+ <xsd:extension base="gml:AbstractFeatureType">
58
+ <xsd:sequence>
59
+ <xsd:element maxOccurs="1" minOccurs="0" name="markierung_parkraum" nillable="true" type="xsd:string"/>
60
+ <xsd:element maxOccurs="1" minOccurs="0" name="beschraenkungen_variieren_ueber_wochentage" nillable="true" type="xsd:string"/>
61
+ <xsd:element maxOccurs="1" minOccurs="0" name="errechnete_anzahl_parkplaetze" nillable="true" type="xsd:int"/>
62
+ <xsd:element maxOccurs="1" minOccurs="0" name="polygon_id" nillable="true" type="xsd:string"/>
63
+ <xsd:element maxOccurs="1" minOccurs="0" name="ausrichtung" nillable="true" type="xsd:string"/>
64
+ <xsd:element maxOccurs="1" minOccurs="0" name="parkort" nillable="true" type="xsd:string"/>
65
+ <xsd:element maxOccurs="1" minOccurs="0" name="parkgebuehr" nillable="true" type="xsd:string"/>
66
+ <xsd:element maxOccurs="1" minOccurs="0" name="geltungszeit_der_beschraenkung" nillable="true" type="xsd:string"/>
67
+ <xsd:element maxOccurs="1" minOccurs="0" name="geltungszeit_der_hoechstparkdauer" nillable="true" type="xsd:string"/>
68
+ <xsd:element maxOccurs="1" minOccurs="0" name="strassenname" nillable="true" type="xsd:string"/>
69
+ <xsd:element maxOccurs="1" minOccurs="0" name="ladesaeule" nillable="true" type="xsd:string"/>
70
+ <xsd:element maxOccurs="1" minOccurs="0" name="hoechstparkdauer" nillable="true" type="xsd:string"/>
71
+ <xsd:element maxOccurs="1" minOccurs="0" name="carsharing" nillable="true" type="xsd:string"/>
72
+ <xsd:element maxOccurs="1" minOccurs="0" name="beschraenkung" nillable="true" type="xsd:string"/>
73
+ <xsd:element maxOccurs="1" minOccurs="0" name="grund_fuer_beschraenkung" nillable="true" type="xsd:string"/>
74
+ <xsd:element maxOccurs="1" minOccurs="0" name="nur_schwerbehinderte" nillable="true" type="xsd:string"/>
75
+ <xsd:element maxOccurs="1" minOccurs="0" name="bewirtschaftungszeit" nillable="true" type="xsd:string"/>
76
+ <xsd:element maxOccurs="1" minOccurs="0" name="zone" nillable="true" type="xsd:string"/>
77
+ <xsd:element maxOccurs="1" minOccurs="0" name="strassen_id" nillable="true" type="xsd:string"/>
78
+ <xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:SurfacePropertyType"/>
79
+ </xsd:sequence>
80
+ </xsd:extension>
81
+ </xsd:complexContent>
82
+ </xsd:complexType>
83
+ <xsd:element name="parkdaten" substitutionGroup="gml:_Feature" type="mdhwfs:parkdatenType"/>
84
+ <xsd:complexType name="sharenow_berlinType">
85
+ <xsd:complexContent>
86
+ <xsd:extension base="gml:AbstractFeatureType">
87
+ <xsd:sequence>
88
+ <xsd:element maxOccurs="1" minOccurs="0" name="v_id" nillable="true" type="xsd:string"/>
89
+ <xsd:element maxOccurs="1" minOccurs="0" name="address" nillable="true" type="xsd:string"/>
90
+ <xsd:element maxOccurs="1" minOccurs="0" name="buildseries" nillable="true" type="xsd:string"/>
91
+ <xsd:element maxOccurs="1" minOccurs="0" name="fueltype" nillable="true" type="xsd:string"/>
92
+ <xsd:element maxOccurs="1" minOccurs="0" name="fuellevel" nillable="true" type="xsd:int"/>
93
+ <xsd:element maxOccurs="1" minOccurs="0" name="plate" nillable="true" type="xsd:string"/>
94
+ <xsd:element maxOccurs="1" minOccurs="0" name="lat" nillable="true" type="xsd:decimal"/>
95
+ <xsd:element maxOccurs="1" minOccurs="0" name="lon" nillable="true" type="xsd:decimal"/>
96
+ <xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:PointPropertyType"/>
97
+ </xsd:sequence>
98
+ </xsd:extension>
99
+ </xsd:complexContent>
100
+ </xsd:complexType>
101
+ <xsd:element name="sharenow_berlin" substitutionGroup="gml:_Feature" type="mdhwfs:sharenow_berlinType"/>
102
+ </xsd:schema>
@@ -0,0 +1,69 @@
1
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:app="http://www.deegree.org/app" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.deegree.org/app" elementFormDefault="qualified" attributeFormDefault="unqualified">
2
+ <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
3
+ <element name="hamburgconvention" substitutionGroup="gml:_Feature">
4
+ <complexType>
5
+ <complexContent>
6
+ <extension base="gml:AbstractFeatureType">
7
+ <sequence>
8
+ <element name="flaechenname" minOccurs="0" type="string"/>
9
+ <element name="flaechenid" minOccurs="0" type="decimal"/>
10
+ <element name="bezirk" minOccurs="0" type="string"/>
11
+ <element name="stadtteil" minOccurs="0" type="string"/>
12
+ <element name="flaeche_gesamt_m" minOccurs="0" type="decimal"/>
13
+ <element name="flaeche_eventlotse_m" minOccurs="0" type="decimal"/>
14
+ <element name="dist_flghf_km" minOccurs="0" type="decimal"/>
15
+ <element name="dist_hbf_km" minOccurs="0" type="decimal"/>
16
+ <element name="dist_ubahn_m" minOccurs="0" type="decimal"/>
17
+ <element name="dist_sbahn_m" minOccurs="0" type="decimal"/>
18
+ <element name="dist_bus_m" minOccurs="0" type="decimal"/>
19
+ <element name="dist_faehre_m" minOccurs="0" type="decimal"/>
20
+ <element name="ubahn" minOccurs="0" type="string"/>
21
+ <element name="sbahn" minOccurs="0" type="string"/>
22
+ <element name="bus" minOccurs="0" type="string"/>
23
+ <element name="faehre" minOccurs="0" type="string"/>
24
+ <element name="plz" minOccurs="0" type="decimal"/>
25
+ <element name="anschluss" minOccurs="0" type="string"/>
26
+ <element name="anschluss_en" minOccurs="0" type="string"/>
27
+ <element name="hinweisstempel" minOccurs="0" type="string"/>
28
+ <element name="hinweisstempel_en" minOccurs="0" type="string"/>
29
+ <element name="bild" minOccurs="0" type="string"/>
30
+ <element name="video" minOccurs="0" type="string"/>
31
+ <element name="dokument" minOccurs="0" type="string"/>
32
+ <element name="flaechengeber" minOccurs="0" type="string"/>
33
+ <element name="flaechengeber_en" minOccurs="0" type="string"/>
34
+ <element name="premiumflaeche" minOccurs="0" type="boolean"/>
35
+ <element name="kontaktname" minOccurs="0" type="string"/>
36
+ <element name="kontakttel" minOccurs="0" type="string"/>
37
+ <element name="kontaktmail" minOccurs="0" type="string"/>
38
+ <element name="flaechengeber2" minOccurs="0" type="string"/>
39
+ <element name="flaechengeber2_en" minOccurs="0" type="string"/>
40
+ <element name="kontaktname2" minOccurs="0" type="string"/>
41
+ <element name="kontakttel2" minOccurs="0" type="string"/>
42
+ <element name="kontaktmail2" minOccurs="0" type="string"/>
43
+ <element name="beschreibung" minOccurs="0" type="string"/>
44
+ <element name="beschreibung_en" minOccurs="0" type="string"/>
45
+ <element name="nichtverfuegbarvon" minOccurs="0" type="string"/>
46
+ <element name="nichtverfuegbarbis" minOccurs="0" type="string"/>
47
+ <element name="strasse" minOccurs="0" type="string"/>
48
+ <element name="hausnr" minOccurs="0" type="string"/>
49
+ <element name="boden" minOccurs="0" type="string"/>
50
+ <element name="boden_en" minOccurs="0" type="string"/>
51
+ <element name="emission" minOccurs="0" type="string"/>
52
+ <element name="url" minOccurs="0" type="string"/>
53
+ <element name="url_en" minOccurs="0" type="string"/>
54
+ <element name="x_min" minOccurs="0" type="decimal"/>
55
+ <element name="x_max" minOccurs="0" type="decimal"/>
56
+ <element name="y_min" minOccurs="0" type="decimal"/>
57
+ <element name="y_max" minOccurs="0" type="decimal"/>
58
+ <element name="x_min_klein" minOccurs="0" type="decimal"/>
59
+ <element name="x_max_klein" minOccurs="0" type="decimal"/>
60
+ <element name="y_min_klein" minOccurs="0" type="decimal"/>
61
+ <element name="y_max_klein" minOccurs="0" type="decimal"/>
62
+ <element name="active" minOccurs="0" type="boolean"/>
63
+ <element name="the_geom" minOccurs="0" type="gml:GeometryPropertyType"/>
64
+ </sequence>
65
+ </extension>
66
+ </complexContent>
67
+ </complexType>
68
+ </element>
69
+ </schema>
@@ -0,0 +1,45 @@
1
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:app="http://www.deegree.org/app" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.deegree.org/app" elementFormDefault="qualified" attributeFormDefault="unqualified">
2
+ <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
3
+ <element name="umring" substitutionGroup="gml:_Feature">
4
+ <complexType>
5
+ <complexContent>
6
+ <extension base="gml:AbstractFeatureType">
7
+ <sequence>
8
+ <element name="geom" minOccurs="0" type="gml:MultiPolygonPropertyType"/>
9
+ </sequence>
10
+ </extension>
11
+ </complexContent>
12
+ </complexType>
13
+ </element>
14
+ <element name="strecken" substitutionGroup="gml:_Feature">
15
+ <complexType>
16
+ <complexContent>
17
+ <extension base="gml:AbstractFeatureType">
18
+ <sequence>
19
+ <element name="Name" minOccurs="0" type="string"/>
20
+ <element name="visual" minOccurs="0" type="string"/>
21
+ <element name="geom" minOccurs="0" type="gml:MultiLineStringPropertyType"/>
22
+ </sequence>
23
+ </extension>
24
+ </complexContent>
25
+ </complexType>
26
+ </element>
27
+ <element name="poi" substitutionGroup="gml:_Feature">
28
+ <complexType>
29
+ <complexContent>
30
+ <extension base="gml:AbstractFeatureType">
31
+ <sequence>
32
+ <element name="titel" minOccurs="0" type="string"/>
33
+ <element name="kurztext" minOccurs="0" type="string"/>
34
+ <element name="internet" minOccurs="0" type="string"/>
35
+ <element name="bild" minOccurs="0" type="string"/>
36
+ <element name="copyright" minOccurs="0" type="string"/>
37
+ <element name="kategorie" minOccurs="0" type="string"/>
38
+ <element name="icon_vi" minOccurs="0" type="string"/>
39
+ <element name="geom" minOccurs="0" type="gml:PointPropertyType"/>
40
+ </sequence>
41
+ </extension>
42
+ </complexContent>
43
+ </complexType>
44
+ </element>
45
+ </schema>
@@ -0,0 +1,24 @@
1
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:de.hh.up="https://registry.gdi-de.org/id/de.hh.up" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="https://registry.gdi-de.org/id/de.hh.up" elementFormDefault="qualified" attributeFormDefault="unqualified">
2
+ <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
3
+ <element name="bike_und_ride" substitutionGroup="gml:_Feature">
4
+ <complexType>
5
+ <complexContent>
6
+ <extension base="gml:AbstractFeatureType">
7
+ <sequence>
8
+ <element name="haltestelle" minOccurs="0" type="string"/>
9
+ <element name="symbol" minOccurs="0" type="string"/>
10
+ <element name="adresse" minOccurs="0" type="string"/>
11
+ <element name="davon_nicht_ueberdachte_stellplaetze" minOccurs="0" type="integer"/>
12
+ <element name="davon_ueberdachte_stellplaetze" minOccurs="0" type="integer"/>
13
+ <element name="davon_gesicherte_mietstellplaetze" minOccurs="0" type="integer"/>
14
+ <element name="schliessfaecher" minOccurs="0" type="integer"/>
15
+ <element name="internet" minOccurs="0" type="string"/>
16
+ <element name="email" minOccurs="0" type="string"/>
17
+ <element name="stand" minOccurs="0" type="string"/>
18
+ <element name="geom" minOccurs="0" type="gml:PointPropertyType"/>
19
+ </sequence>
20
+ </extension>
21
+ </complexContent>
22
+ </complexType>
23
+ </element>
24
+ </schema>
@@ -0,0 +1,22 @@
1
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:de.hh.up="https://registry.gdi-de.org/id/de.hh.up" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="https://registry.gdi-de.org/id/de.hh.up" elementFormDefault="qualified" attributeFormDefault="unqualified">
2
+ <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
3
+ <element name="nr_f_biosphaerenreservat" substitutionGroup="gml:_Feature">
4
+ <complexType>
5
+ <complexContent>
6
+ <extension base="gml:AbstractFeatureType">
7
+ <sequence>
8
+ <element name="gebietsname" minOccurs="0" type="string"/>
9
+ <element name="gebietsnummer" minOccurs="0" type="string"/>
10
+ <element name="rechtsgrundlage" minOccurs="0" type="string"/>
11
+ <element name="schutzzone" minOccurs="0" type="integer"/>
12
+ <element name="erfassungsgrundlage" minOccurs="0" type="string"/>
13
+ <element name="info_kontakt" minOccurs="0" type="string"/>
14
+ <element name="iucn_kategorie" minOccurs="0" type="string"/>
15
+ <element name="stand_bearbeitung" minOccurs="0" type="string"/>
16
+ <element name="geom" minOccurs="0" type="gml:PolygonPropertyType"/>
17
+ </sequence>
18
+ </extension>
19
+ </complexContent>
20
+ </complexType>
21
+ </element>
22
+ </schema>
@@ -0,0 +1,18 @@
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:fis="http://www.berlin.de/broker" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.berlin.de/broker">
2
+ <xsd:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
3
+ <xsd:element name="s_parkraumbewirt" substitutionGroup="gml:AbstractFeature" type="fis:s_parkraumbewirtType"/>
4
+ <xsd:complexType name="s_parkraumbewirtType">
5
+ <xsd:complexContent>
6
+ <xsd:extension base="gml:AbstractFeatureType">
7
+ <xsd:sequence>
8
+ <xsd:element minOccurs="0" name="parkzone" nillable="true" type="xsd:string"/>
9
+ <xsd:element minOccurs="0" name="bezirk" nillable="true" type="xsd:string"/>
10
+ <xsd:element minOccurs="0" name="zeiten" nillable="true" type="xsd:string"/>
11
+ <xsd:element minOccurs="0" name="gebuehr" nillable="true" type="xsd:string"/>
12
+ <xsd:element minOccurs="0" name="bemerkung" nillable="true" type="xsd:string"/>
13
+ <xsd:element minOccurs="0" name="geom" nillable="true" type="gml:GeometryPropertyType"/>
14
+ </xsd:sequence>
15
+ </xsd:extension>
16
+ </xsd:complexContent>
17
+ </xsd:complexType>
18
+ </xsd:schema>
@@ -34,7 +34,7 @@ describe("stylePointIcon.js", () => {
34
34
  clusterAttributes = {
35
35
  clusterImageName: "bild.svg",
36
36
  clusterImageWidth: 10,
37
- clusterImagePath: "/imagePath",
37
+ imagePath: "/imagePath",
38
38
  clusterImageHeight: 20,
39
39
  clusterImageScale: 1
40
40
  },
@@ -61,12 +61,87 @@ describe("stylePointIcon.js", () => {
61
61
  }
62
62
  };
63
63
 
64
- it("should create icon point style", () => {
64
+ it("should create icon point style with imageName without path", () => {
65
65
  expect(stylePointIcon.createIconStyle(attributes, feature, false)).toBeInstanceOf(Style);
66
66
  expect(stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true)).toBeInstanceOf(Style);
67
67
  expect(stylePointIcon.createIconStyle(attributes, feature, false).getImage()).toBeInstanceOf(Icon);
68
68
  expect(stylePointIcon.createIconStyle(attributes, feature, false).getImage().getScale()).toEqual(1);
69
69
  });
70
+ it("should create icon point style with pure imageName and wfsImgPath exists", () => {
71
+ let style = null;
72
+
73
+ attributes.imageName = "Rathaus.svg";
74
+ attributes.imagePath = "./geodaten/icons/";
75
+ style = stylePointIcon.createIconStyle(attributes, feature, false);
76
+
77
+ expect(style).toBeInstanceOf(Style);
78
+ expect(style.getImage()).toBeInstanceOf(Icon);
79
+ expect(style.getImage().getSrc()).toEqual(attributes.imagePath + attributes.imageName);
80
+ });
81
+ it("should create clustered icon point style with pure imageName and wfsImgPath exists", () => {
82
+ let style = null;
83
+
84
+ clusterAttributes.clusterImageName = "Rathaus.svg";
85
+ clusterAttributes.imagePath = "./geodaten/icons/";
86
+ style = stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true);
87
+
88
+ expect(style).toBeInstanceOf(Style);
89
+ expect(style.getImage()).toBeInstanceOf(Icon);
90
+ expect(style.getImage().getSrc()).toEqual(clusterAttributes.imagePath + clusterAttributes.clusterImageName);
91
+ });
92
+ it("should create icon point style with path in imageName and wfsImgPath exists", () => {
93
+ let style = null;
94
+
95
+ attributes.imageName = "/svg/poi/Rathaus.svg";
96
+ attributes.imagePath = "https://localhost:9001/portal/basic/geodaten/icons/";
97
+ style = stylePointIcon.createIconStyle(attributes, feature, false);
98
+
99
+ expect(style).toBeInstanceOf(Style);
100
+ expect(style.getImage()).toBeInstanceOf(Icon);
101
+ expect(style.getImage().getSrc()).toEqual(attributes.imagePath + attributes.imageName);
102
+ });
103
+ it("should create clustered icon point style with path in imageName and wfsImgPath exists", () => {
104
+ let style = null;
105
+
106
+ clusterAttributes.clusterImageName = "/svg/poi/Rathaus.svg";
107
+ clusterAttributes.imagePath = "https://localhost:9001/portal/basic/geodaten/icons/";
108
+ style = stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true);
109
+
110
+ expect(style).toBeInstanceOf(Style);
111
+ expect(style.getImage()).toBeInstanceOf(Icon);
112
+ expect(style.getImage().getSrc()).toEqual(clusterAttributes.imagePath + clusterAttributes.clusterImageName);
113
+ });
114
+ it("should create icon point style with whole path in imageName and wfsImgPath is empty", () => {
115
+ let style = null;
116
+
117
+ attributes.imageName = "https://localhost:9001/portal/basic/geodaten/icons/svg/poi/Rathaus.svg";
118
+ style = stylePointIcon.createIconStyle(attributes, feature, false);
119
+
120
+ expect(style).toBeInstanceOf(Style);
121
+ expect(style.getImage()).toBeInstanceOf(Icon);
122
+ expect(style.getImage().getSrc()).toEqual(attributes.imageName);
123
+ });
124
+ it("should create clustered icon point style with whole path in imageName and wfsImgPath is empty", () => {
125
+ let style = null;
126
+
127
+ clusterAttributes.clusterImageName = "https://localhost:9001/portal/basic/geodaten/icons/svg/poi/Rathaus.svg";
128
+ clusterAttributes.imagePath = "";
129
+ style = stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true);
130
+
131
+ expect(style).toBeInstanceOf(Style);
132
+ expect(style.getImage()).toBeInstanceOf(Icon);
133
+ expect(style.getImage().getSrc()).toEqual(clusterAttributes.clusterImageName);
134
+ });
135
+ it("should create icon point style with svg", () => {
136
+ let style = null;
137
+
138
+ attributes.imageName = "<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='#E10019' class='bi bi-geo-fill' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z'/></svg>";
139
+ style = stylePointIcon.createIconStyle(attributes, feature, false);
140
+
141
+ expect(style).toBeInstanceOf(Style);
142
+ expect(style.getImage()).toBeInstanceOf(Icon);
143
+ expect(style.getImage().getSrc()).toEqual("data:image/svg+xml;charset=utf-8," + encodeURIComponent(attributes.imageName));
144
+ });
70
145
  it("should create cluster icon point style", () => {
71
146
  expect(stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true)).toBeInstanceOf(Style);
72
147
  expect(stylePointIcon.createIconStyle(clusterAttributes, clusteredFeature, true).getImage()).toBeInstanceOf(Icon);