From 265408598837bc475cd90add46113360cffc7e89 Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Tue, 13 Apr 2021 09:56:48 +0200 Subject: [PATCH] Updates geostyler-style and ol - geostyler-style 4.0.0 - ol 6.5.0 --- data/styles/filter_invalidFilter.ts | 4 +- data/styles/filter_nestedFilter.ts | 4 +- data/styles/filter_simpleFilter.ts | 4 +- data/styles/multi_twoRulesSimplepoint.ts | 4 +- data/styles/point_simplecross.ts | 2 +- data/styles/point_simplepoint.ts | 2 +- data/styles/point_simplepoint_filter.ts | 2 +- data/styles/point_simplesquare.ts | 2 +- data/styles/point_simplestar.ts | 2 +- data/styles/point_simpletriangle.ts | 2 +- data/styles/point_simplex.ts | 2 +- data/styles/scaleDenom_line_circle.ts | 2 +- data/styles/scaleDenom_line_circle_overlap.ts | 2 +- package-lock.json | 85 +++++++++++-------- package.json | 4 +- src/OlStyleParser.ts | 24 +++--- 16 files changed, 79 insertions(+), 68 deletions(-) diff --git a/data/styles/filter_invalidFilter.ts b/data/styles/filter_invalidFilter.ts index 5d51e33f..68c32021 100644 --- a/data/styles/filter_invalidFilter.ts +++ b/data/styles/filter_invalidFilter.ts @@ -17,7 +17,7 @@ const filterInvalidFilter: Style = { ], symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 10 }] @@ -25,7 +25,7 @@ const filterInvalidFilter: Style = { name: 'OL Style Rule 1', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/data/styles/filter_nestedFilter.ts b/data/styles/filter_nestedFilter.ts index 2e59497a..5a991351 100644 --- a/data/styles/filter_nestedFilter.ts +++ b/data/styles/filter_nestedFilter.ts @@ -20,7 +20,7 @@ const filterNestedFilter: Style = { ], symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 10 }] @@ -28,7 +28,7 @@ const filterNestedFilter: Style = { name: 'OL Style Rule 1', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/data/styles/filter_simpleFilter.ts b/data/styles/filter_simpleFilter.ts index ca59e5c7..a83e6493 100644 --- a/data/styles/filter_simpleFilter.ts +++ b/data/styles/filter_simpleFilter.ts @@ -12,7 +12,7 @@ const filterSimpleFilter: Style = { ], symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 10 }] @@ -20,7 +20,7 @@ const filterSimpleFilter: Style = { name: 'OL Style Rule 1', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/data/styles/multi_twoRulesSimplepoint.ts b/data/styles/multi_twoRulesSimplepoint.ts index 8609fb73..88956868 100644 --- a/data/styles/multi_twoRulesSimplepoint.ts +++ b/data/styles/multi_twoRulesSimplepoint.ts @@ -7,7 +7,7 @@ const multiTwoRulesSimplepoint: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] @@ -16,7 +16,7 @@ const multiTwoRulesSimplepoint: Style = { name: 'OL Style Rule 1', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF1111', radius: 4 }] diff --git a/data/styles/point_simplecross.ts b/data/styles/point_simplecross.ts index 2971d9fa..05a8d7af 100644 --- a/data/styles/point_simplecross.ts +++ b/data/styles/point_simplecross.ts @@ -7,7 +7,7 @@ const pointSimpleCross: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Cross', + wellKnownName: 'cross', color: '#FF0000', radius: 6, rotate: 0 diff --git a/data/styles/point_simplepoint.ts b/data/styles/point_simplepoint.ts index 91c3bfc9..c64f2b15 100644 --- a/data/styles/point_simplepoint.ts +++ b/data/styles/point_simplepoint.ts @@ -7,7 +7,7 @@ const pointSimplePoint: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/data/styles/point_simplepoint_filter.ts b/data/styles/point_simplepoint_filter.ts index e8e82b1e..9df1bf31 100644 --- a/data/styles/point_simplepoint_filter.ts +++ b/data/styles/point_simplepoint_filter.ts @@ -17,7 +17,7 @@ const pointSimplePoint: Style = { }, symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6, strokeColor: '#000000', diff --git a/data/styles/point_simplesquare.ts b/data/styles/point_simplesquare.ts index d18b91e4..12495546 100644 --- a/data/styles/point_simplesquare.ts +++ b/data/styles/point_simplesquare.ts @@ -7,7 +7,7 @@ const pointSimpleSquare: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Square', + wellKnownName: 'square', color: '#FF0000', radius: 6, rotate: 0 diff --git a/data/styles/point_simplestar.ts b/data/styles/point_simplestar.ts index b3f6c31d..ec8d80e2 100644 --- a/data/styles/point_simplestar.ts +++ b/data/styles/point_simplestar.ts @@ -7,7 +7,7 @@ const pointSimpleStar: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Star', + wellKnownName: 'star', color: '#FF0000', radius: 6, rotate: 0 diff --git a/data/styles/point_simpletriangle.ts b/data/styles/point_simpletriangle.ts index fdb3683a..d3cf5948 100644 --- a/data/styles/point_simpletriangle.ts +++ b/data/styles/point_simpletriangle.ts @@ -7,7 +7,7 @@ const pointSimpleTriangle: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'Triangle', + wellKnownName: 'triangle', color: '#FF0000', radius: 6, rotate: 0 diff --git a/data/styles/point_simplex.ts b/data/styles/point_simplex.ts index 6ddc777c..65789134 100644 --- a/data/styles/point_simplex.ts +++ b/data/styles/point_simplex.ts @@ -7,7 +7,7 @@ const pointSimpleX: Style = { name: 'OL Style Rule 0', symbolizers: [{ kind: 'Mark', - wellKnownName: 'X', + wellKnownName: 'x', color: '#FF0000', radius: 6, rotate: 0 diff --git a/data/styles/scaleDenom_line_circle.ts b/data/styles/scaleDenom_line_circle.ts index 78d3dd99..af36302a 100644 --- a/data/styles/scaleDenom_line_circle.ts +++ b/data/styles/scaleDenom_line_circle.ts @@ -26,7 +26,7 @@ const scaleDenomLineCircle: Style = { }, symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/data/styles/scaleDenom_line_circle_overlap.ts b/data/styles/scaleDenom_line_circle_overlap.ts index c6a1ee61..f0a3ccd0 100644 --- a/data/styles/scaleDenom_line_circle_overlap.ts +++ b/data/styles/scaleDenom_line_circle_overlap.ts @@ -26,7 +26,7 @@ const scaleDenomLineCircleOverlap: Style = { }, symbolizers: [{ kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: '#FF0000', radius: 6 }] diff --git a/package-lock.json b/package-lock.json index f4df87bb..f4f29d69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6760,43 +6760,43 @@ } }, "@typescript-eslint/eslint-plugin-tslint": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-4.21.0.tgz", - "integrity": "sha512-s8TgCHHcPsQ/b+k5q26i/1Ed2G7FLD5avLEgUhcHgs35F4HUrQh2CAgurzPn0PSfWGtBrJQa5B+p+RQ19T27qA==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-4.22.0.tgz", + "integrity": "sha512-r4lhAPmd69ohf5grgDALtekETv4WVCpvfXtT3Nf3UUO/88sn4HB4h8xN1afwL48BprQ4TxH7ZUv7Ou6xgRlkAA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.21.0", + "@typescript-eslint/experimental-utils": "4.22.0", "lodash": "^4.17.15" }, "dependencies": { "@typescript-eslint/experimental-utils": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.21.0.tgz", - "integrity": "sha512-cEbgosW/tUFvKmkg3cU7LBoZhvUs+ZPVM9alb25XvR0dal4qHL3SiUqHNrzoWSxaXA9gsifrYrS1xdDV6w/gIA==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz", + "integrity": "sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.21.0", - "@typescript-eslint/types": "4.21.0", - "@typescript-eslint/typescript-estree": "4.21.0", + "@typescript-eslint/scope-manager": "4.22.0", + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/typescript-estree": "4.22.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/types": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.21.0.tgz", - "integrity": "sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.0.tgz", + "integrity": "sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.21.0.tgz", - "integrity": "sha512-ZD3M7yLaVGVYLw4nkkoGKumb7Rog7QID9YOWobFDMQKNl+vPxqVIW/uDk+MDeGc+OHcoG2nJ2HphwiPNajKw3w==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz", + "integrity": "sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.21.0", - "@typescript-eslint/visitor-keys": "4.21.0", + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/visitor-keys": "4.22.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -6805,12 +6805,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz", - "integrity": "sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz", + "integrity": "sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/types": "4.22.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -7007,28 +7007,28 @@ } }, "@typescript-eslint/scope-manager": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.21.0.tgz", - "integrity": "sha512-kfOjF0w1Ix7+a5T1knOw00f7uAP9Gx44+OEsNQi0PvvTPLYeXJlsCJ4tYnDj5PQEYfpcgOH5yBlw7K+UEI9Agw==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz", + "integrity": "sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q==", "dev": true, "requires": { - "@typescript-eslint/types": "4.21.0", - "@typescript-eslint/visitor-keys": "4.21.0" + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/visitor-keys": "4.22.0" }, "dependencies": { "@typescript-eslint/types": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.21.0.tgz", - "integrity": "sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.0.tgz", + "integrity": "sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==", "dev": true }, "@typescript-eslint/visitor-keys": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz", - "integrity": "sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w==", + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz", + "integrity": "sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/types": "4.22.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -10650,9 +10650,20 @@ } }, "geostyler-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/geostyler-style/-/geostyler-style-3.0.0.tgz", - "integrity": "sha512-fNnOK28qFEGLnxos9X9/5VsmOBYNddJDpAzPxpdbC9ErKlliKJ1sDH/w7/mVM4VoHyW11RdIqiDyG0VZLWikgw==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/geostyler-style/-/geostyler-style-4.0.0.tgz", + "integrity": "sha512-bq46+0aK8BbCaMTOL7HZhD8FZX5oy4Ve9lhkFA/PVL20oZp86NtzYYBvb0G4w+le8ZJdJIcJrgfrjvlX1s6XIQ==", + "requires": { + "@types/lodash": "^4.14.168", + "lodash": "^4.17.21" + }, + "dependencies": { + "@types/lodash": { + "version": "4.14.168", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", + "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==" + } + } }, "get-caller-file": { "version": "2.0.5", diff --git a/package.json b/package.json index 11e90a27..fad098a4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "/~https://github.com/geostyler/geostyler-openlayers-parser#readme", "dependencies": { "@terrestris/ol-util": "^4.0.1", - "geostyler-style": "^3.0.0", + "geostyler-style": "^4.0.0", "lodash": "^4.17.15" }, "peerDependencies": { @@ -63,7 +63,7 @@ "jest": "^26.1.0", "jest-canvas-mock": "^2.2.0", "np": "^7.4.0", - "ol": "^6.3.1", + "ol": "^6.5.0", "terser-webpack-plugin": "^3.0.6", "ts-loader": "^7.0.5", "typescript": "^4.2.3", diff --git a/src/OlStyleParser.ts b/src/OlStyleParser.ts index 3b800720..2e815eeb 100644 --- a/src/OlStyleParser.ts +++ b/src/OlStyleParser.ts @@ -89,7 +89,7 @@ export class OlStyleParser implements StyleParser { const olStrokeStyle = olCircleStyle.getStroke(); const circleSymbolizer: MarkSymbolizer = { kind: 'Mark', - wellKnownName: 'Circle', + wellKnownName: 'circle', color: olFillStyle ? OlStyleUtil.getHexColor(olFillStyle.getColor() as string) : undefined, opacity: olFillStyle ? OlStyleUtil.getOpacity(olFillStyle.getColor() as string) : undefined, radius: (olCircleStyle.getRadius() !== 0) ? olCircleStyle.getRadius() : 5, @@ -142,7 +142,7 @@ export class OlStyleParser implements StyleParser { case 3: switch (angle) { case 0: - markSymbolizer.wellKnownName = 'Triangle'; + markSymbolizer.wellKnownName = 'triangle'; break; case Math.PI / 2: markSymbolizer.wellKnownName = 'shape://carrow'; @@ -156,19 +156,19 @@ export class OlStyleParser implements StyleParser { // cross or x if (olRegularStyle.getAngle() === 0) { // cross - markSymbolizer.wellKnownName = 'Cross'; + markSymbolizer.wellKnownName = 'cross'; } else { // x - markSymbolizer.wellKnownName = 'X'; + markSymbolizer.wellKnownName = 'x'; } } else { // square - markSymbolizer.wellKnownName = 'Square'; + markSymbolizer.wellKnownName = 'square'; } break; case 5: // star - markSymbolizer.wellKnownName = 'Star'; + markSymbolizer.wellKnownName = 'star'; break; default: throw new Error('Could not parse OlStyle. Only 2, 3, 4 or 5 point regular shapes are allowed'); @@ -758,26 +758,26 @@ export class OlStyleParser implements StyleParser { switch (markSymbolizer.wellKnownName) { case 'shape://dot': - case 'Circle': + case 'circle': olStyle = new this.OlStyleConstructor({ image: new this.OlStyleCircleConstructor(shapeOpts) }); break; - case 'Square': + case 'square': shapeOpts.points = 4; shapeOpts.angle = 45 * Math.PI / 180; olStyle = new this.OlStyleConstructor({ image: new this.OlStyleRegularshapeConstructor(shapeOpts) }); break; - case 'Triangle': + case 'triangle': shapeOpts.points = 3; shapeOpts.angle = 0; olStyle = new this.OlStyleConstructor({ image: new this.OlStyleRegularshapeConstructor(shapeOpts) }); break; - case 'Star': + case 'star': shapeOpts.points = 5; shapeOpts.radius2 = shapeOpts.radius / 2.5; shapeOpts.angle = 0; @@ -786,7 +786,7 @@ export class OlStyleParser implements StyleParser { }); break; case 'shape://plus': - case 'Cross': + case 'cross': shapeOpts.points = 4; shapeOpts.radius2 = 0; shapeOpts.angle = 0; @@ -802,7 +802,7 @@ export class OlStyleParser implements StyleParser { }); break; case 'shape://times': - case 'X': + case 'x': shapeOpts.points = 4; shapeOpts.radius2 = 0; shapeOpts.angle = 45 * Math.PI / 180;