From 17c8a3a82fab5094202b3d56440497e7e3f519cf Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Thu, 27 Jun 2024 16:56:05 +0200 Subject: [PATCH 01/27] Migrate canvas source and polygon brush from @biigle/ol to core --- package-lock.json | 360 +++++++++--------- package.json | 7 +- .../components/annotationCanvas.vue | 67 ++-- .../annotationCanvas/drawInteractions.vue | 4 +- .../annotationCanvas/measureInteraction.vue | 6 +- .../polygonBrushInteraction.vue | 8 +- .../components/annotationCanvas/sampling.vue | 14 +- .../annotations/components/measureTooltip.vue | 6 +- .../js/annotations/components/minimap.vue | 12 +- resources/assets/js/annotations/main.js | 2 +- .../annotations/mixins/annotationTooltip.vue | 2 +- .../annotations/ol/AttachLabelInteraction.js | 2 +- .../assets/js/annotations/ol/CancelableMap.js | 2 +- .../js/annotations/ol/MagicWandInteraction.js | 18 +- .../js/annotations/ol/PolygonValidator.js | 16 +- .../js/annotations/ol/TranslateInteraction.js | 2 +- .../js/annotations/ol/ZoomToNativeControl.js | 2 +- .../js/annotations/ol/geom/flat/difference.js | 32 ++ .../js/annotations/ol/geom/flat/simplify.js | 18 + .../js/annotations/ol/geom/flat/union.js | 19 + .../ol/interaction/ModifyPolygonBrush.js | 264 +++++++++++++ .../ol/interaction/PolygonBrush.js | 295 ++++++++++++++ .../assets/js/annotations/ol/source/Canvas.js | 52 +++ .../assets/js/annotations/snapInteraction.vue | 10 +- .../assets/js/annotations/stores/styles.js | 10 +- .../js/videos/components/videoScreen.vue | 18 +- .../videoScreen/annotationPlayback.vue | 14 +- .../videoScreen/drawInteractions.vue | 6 +- .../videoScreen/modifyInteractions.vue | 6 +- .../videoScreen/polygonBrushInteractions.vue | 16 +- .../components/videoScreen/videoPlayback.vue | 10 +- 31 files changed, 985 insertions(+), 315 deletions(-) create mode 100644 resources/assets/js/annotations/ol/geom/flat/difference.js create mode 100644 resources/assets/js/annotations/ol/geom/flat/simplify.js create mode 100644 resources/assets/js/annotations/ol/geom/flat/union.js create mode 100644 resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js create mode 100644 resources/assets/js/annotations/ol/interaction/PolygonBrush.js create mode 100644 resources/assets/js/annotations/ol/source/Canvas.js diff --git a/package-lock.json b/package-lock.json index 17ee5e34d..ea04cb730 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,12 +6,17 @@ "": { "license": "GPL-3.0-only", "dependencies": { - "@biigle/ol": "^5.3.0", "@fortawesome/fontawesome-free": "^5.2.0", + "@turf/boolean-contains": "^6.5.0", + "@turf/boolean-overlap": "^6.5.0", + "@turf/difference": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/union": "^6.5.0", "bootstrap-sass": "^3.3.7", "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", + "ol": "^5.3.3", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", @@ -2097,22 +2102,6 @@ "node": ">=6.9.0" } }, - "node_modules/@biigle/ol": { - "version": "5.3.4", - "resolved": "https://npm.pkg.github.com/download/@biigle/ol/5.3.4/dfd8c69f0b9e233c0505336d1b98b235a8d428f4", - "integrity": "sha512-WEPbCRlfb3vhXmjY/LFB1K3PdadZnj5s1TkSZRaO9sKU5Uw3FaIi+ElWUgJRvIAGAo8zExELGvaRmtSJ4M2Xdg==", - "license": "BSD-2-Clause", - "dependencies": { - "@turf/boolean-contains": "^6.0.1", - "@turf/boolean-overlap": "^6.0.1", - "@turf/difference": "6.0.1", - "@turf/helpers": "^6.1.4", - "@turf/union": "^6.0.3", - "pbf": "3.1.0", - "pixelworks": "1.1.0", - "rbush": "2.0.2" - } - }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -2301,18 +2290,6 @@ "node": ">=10.13.0" } }, - "node_modules/@turf/area": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", - "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/bbox": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-6.5.0.tgz", @@ -2405,15 +2382,16 @@ } }, "node_modules/@turf/difference": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.0.1.tgz", - "integrity": "sha512-lkhJjNfPeLARQm232A851vVhrUvX3gdvTft5QlqkUlr7AzLpiT8PW14yEkU9xABxRh6PGv7T1UUVAeRgC7JxuA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", + "integrity": "sha512-l8iR5uJqvI+5Fs6leNbhPY5t/a3vipUF/3AeVLpwPQcgmedNXyheYuy07PcMGH5Jdpi5gItOiTqwiU/bUH4b3A==", "dependencies": { - "@turf/area": "6.x", - "@turf/helpers": "6.x", - "@turf/invariant": "6.x", - "@turf/meta": "6.x", - "martinez-polygon-clipping": "*" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" } }, "node_modules/@turf/distance": { @@ -4712,16 +4690,19 @@ } }, "node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "regexp.prototype.flags": "^1.5.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4779,14 +4760,19 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dependencies": { - "object-keys": "^1.0.12" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/depd": { @@ -5921,6 +5907,14 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5933,7 +5927,7 @@ "node_modules/geojson-equality": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", - "integrity": "sha1-oXE3TvBD5dR5eZWEC65GSOB1LXI=", + "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", "dependencies": { "deep-equal": "^1.0.0" } @@ -6193,11 +6187,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -7427,16 +7421,6 @@ "semver": "bin/semver.js" } }, - "node_modules/martinez-polygon-clipping": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/martinez-polygon-clipping/-/martinez-polygon-clipping-0.7.1.tgz", - "integrity": "sha512-Xt5hOjAVkRoGN7kUb/0VmkxcG07Ja+OA3qU+7YcY2pAlJ78V1G181VTozHCXpzlj0paNBbcLno77mcGeGStI0A==", - "dependencies": { - "robust-predicates": "^2.0.4", - "splaytree": "^0.1.4", - "tinyqueue": "^1.2.0" - } - }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -7899,12 +7883,12 @@ } }, "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -7927,6 +7911,16 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, + "node_modules/ol": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/ol/-/ol-5.3.3.tgz", + "integrity": "sha512-7eU4x8YMduNcED1D5wI+AMWDRe7/1HmGfsbV+kFFROI9RNABU/6n4osj6Q3trZbxxKnK2DSRIjIRGwRHT/Z+Ww==", + "dependencies": { + "pbf": "3.1.0", + "pixelworks": "1.1.0", + "rbush": "2.0.2" + } + }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -8261,7 +8255,7 @@ "node_modules/pixelworks": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pixelworks/-/pixelworks-1.1.0.tgz", - "integrity": "sha1-Hwla1I3Ki/ihyCWOAJIDGkTyLKU=" + "integrity": "sha512-nDqeyp0pvOvCihLsyc9GHWKP4THUtcfQ+qs61uiVaZdlNv0j7y6PWNyPfnTtuxMJ+MTAqff2QbbM/1DyCcRdOQ==" }, "node_modules/pkg-dir": { "version": "4.2.0", @@ -8276,17 +8270,23 @@ } }, "node_modules/polygon-clipping": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.3.tgz", - "integrity": "sha512-ho0Xx5DLkgxRx/+n4O74XyJ67DcyN3Tu9bGYKsnTukGAW6ssnuak6Mwcyb1wHy9MZc9xsUWqIoiazkZB5weECg==", + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.7.tgz", + "integrity": "sha512-nhfdr83ECBg6xtqOAJab1tbksbBAOMUltN60bU+llHVOL0e5Onm1WpAXXWXVB39L8AJFssoIhEVuy/S90MmotA==", "dependencies": { + "robust-predicates": "^3.0.2", "splaytree": "^3.1.0" } }, + "node_modules/polygon-clipping/node_modules/robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" + }, "node_modules/polygon-clipping/node_modules/splaytree": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.0.tgz", - "integrity": "sha512-gvUGR7xnOy0fLKTCxDeUZYgU/I1Tdf8M/lM1Qrf8L2TIOR5ipZjGk02uYcdv0o2x7WjVRgpm3iS2clLyuVAt0Q==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.2.tgz", + "integrity": "sha512-4OM2BJgC5UzrhVnnJA4BkHKGtjXNzzUfpQjCO8I05xYPsfS/VuQDwjCGGMi8rYQilHEV4j8NBqTFbls/PZEE7A==" }, "node_modules/polymorph-js": { "version": "0.2.4", @@ -9215,12 +9215,14 @@ "dev": true }, "node_modules/regexp.prototype.flags": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", - "integrity": "sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -9477,11 +9479,6 @@ "inherits": "^2.0.1" } }, - "node_modules/robust-predicates": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-2.0.4.tgz", - "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -9793,6 +9790,20 @@ "node": ">= 0.4" } }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -10005,11 +10016,6 @@ "node": ">= 6" } }, - "node_modules/splaytree": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-0.1.4.tgz", - "integrity": "sha512-D50hKrjZgBzqD3FT2Ek53f2dcDLAQT8SSGrzj3vidNH5ISRgceeGVJ2dQIthKOuayqFXfFjXheHNo4bbt9LhRQ==" - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -10455,11 +10461,6 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, - "node_modules/tinyqueue": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.2.3.tgz", - "integrity": "sha512-Qz9RgWuO9l8lT+Y9xvbzhPT2efIUIFd69N7eF7tJ9lnQl0iLj1M7peK7IoUGZL9DJHw9XftqLreccfxcQgYLxA==" - }, "node_modules/to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -12982,21 +12983,6 @@ "to-fast-properties": "^2.0.0" } }, - "@biigle/ol": { - "version": "5.3.4", - "resolved": "https://npm.pkg.github.com/download/@biigle/ol/5.3.4/dfd8c69f0b9e233c0505336d1b98b235a8d428f4", - "integrity": "sha512-WEPbCRlfb3vhXmjY/LFB1K3PdadZnj5s1TkSZRaO9sKU5Uw3FaIi+ElWUgJRvIAGAo8zExELGvaRmtSJ4M2Xdg==", - "requires": { - "@turf/boolean-contains": "^6.0.1", - "@turf/boolean-overlap": "^6.0.1", - "@turf/difference": "6.0.1", - "@turf/helpers": "^6.1.4", - "@turf/union": "^6.0.3", - "pbf": "3.1.0", - "pixelworks": "1.1.0", - "rbush": "2.0.2" - } - }, "@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -13142,15 +13128,6 @@ "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "dev": true }, - "@turf/area": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", - "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - } - }, "@turf/bbox": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-6.5.0.tgz", @@ -13222,15 +13199,13 @@ } }, "@turf/difference": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.0.1.tgz", - "integrity": "sha512-lkhJjNfPeLARQm232A851vVhrUvX3gdvTft5QlqkUlr7AzLpiT8PW14yEkU9xABxRh6PGv7T1UUVAeRgC7JxuA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", + "integrity": "sha512-l8iR5uJqvI+5Fs6leNbhPY5t/a3vipUF/3AeVLpwPQcgmedNXyheYuy07PcMGH5Jdpi5gItOiTqwiU/bUH4b3A==", "requires": { - "@turf/area": "6.x", - "@turf/helpers": "6.x", - "@turf/invariant": "6.x", - "@turf/meta": "6.x", - "martinez-polygon-clipping": "*" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" } }, "@turf/distance": { @@ -15116,16 +15091,16 @@ } }, "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "regexp.prototype.flags": "^1.5.1" } }, "deep-is": { @@ -15165,11 +15140,13 @@ "dev": true }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "requires": { - "object-keys": "^1.0.12" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "depd": { @@ -16045,6 +16022,11 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -16054,7 +16036,7 @@ "geojson-equality": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", - "integrity": "sha1-oXE3TvBD5dR5eZWEC65GSOB1LXI=", + "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", "requires": { "deep-equal": "^1.0.0" } @@ -16252,11 +16234,11 @@ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "requires": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" } }, "hash-base": { @@ -17161,16 +17143,6 @@ } } }, - "martinez-polygon-clipping": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/martinez-polygon-clipping/-/martinez-polygon-clipping-0.7.1.tgz", - "integrity": "sha512-Xt5hOjAVkRoGN7kUb/0VmkxcG07Ja+OA3qU+7YcY2pAlJ78V1G181VTozHCXpzlj0paNBbcLno77mcGeGStI0A==", - "requires": { - "robust-predicates": "^2.0.4", - "splaytree": "^0.1.4", - "tinyqueue": "^1.2.0" - } - }, "md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -17532,12 +17504,12 @@ "dev": true }, "object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" } }, "object-keys": { @@ -17551,6 +17523,16 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, + "ol": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/ol/-/ol-5.3.3.tgz", + "integrity": "sha512-7eU4x8YMduNcED1D5wI+AMWDRe7/1HmGfsbV+kFFROI9RNABU/6n4osj6Q3trZbxxKnK2DSRIjIRGwRHT/Z+Ww==", + "requires": { + "pbf": "3.1.0", + "pixelworks": "1.1.0", + "rbush": "2.0.2" + } + }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -17804,7 +17786,7 @@ "pixelworks": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pixelworks/-/pixelworks-1.1.0.tgz", - "integrity": "sha1-Hwla1I3Ki/ihyCWOAJIDGkTyLKU=" + "integrity": "sha512-nDqeyp0pvOvCihLsyc9GHWKP4THUtcfQ+qs61uiVaZdlNv0j7y6PWNyPfnTtuxMJ+MTAqff2QbbM/1DyCcRdOQ==" }, "pkg-dir": { "version": "4.2.0", @@ -17816,17 +17798,23 @@ } }, "polygon-clipping": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.3.tgz", - "integrity": "sha512-ho0Xx5DLkgxRx/+n4O74XyJ67DcyN3Tu9bGYKsnTukGAW6ssnuak6Mwcyb1wHy9MZc9xsUWqIoiazkZB5weECg==", + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.7.tgz", + "integrity": "sha512-nhfdr83ECBg6xtqOAJab1tbksbBAOMUltN60bU+llHVOL0e5Onm1WpAXXWXVB39L8AJFssoIhEVuy/S90MmotA==", "requires": { + "robust-predicates": "^3.0.2", "splaytree": "^3.1.0" }, "dependencies": { + "robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" + }, "splaytree": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.0.tgz", - "integrity": "sha512-gvUGR7xnOy0fLKTCxDeUZYgU/I1Tdf8M/lM1Qrf8L2TIOR5ipZjGk02uYcdv0o2x7WjVRgpm3iS2clLyuVAt0Q==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.2.tgz", + "integrity": "sha512-4OM2BJgC5UzrhVnnJA4BkHKGtjXNzzUfpQjCO8I05xYPsfS/VuQDwjCGGMi8rYQilHEV4j8NBqTFbls/PZEE7A==" } } }, @@ -18467,12 +18455,14 @@ "dev": true }, "regexp.prototype.flags": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", - "integrity": "sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" } }, "regexpp": { @@ -18665,11 +18655,6 @@ "inherits": "^2.0.1" } }, - "robust-predicates": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-2.0.4.tgz", - "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -18905,6 +18890,17 @@ "has-property-descriptors": "^1.0.2" } }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -19079,11 +19075,6 @@ } } }, - "splaytree": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-0.1.4.tgz", - "integrity": "sha512-D50hKrjZgBzqD3FT2Ek53f2dcDLAQT8SSGrzj3vidNH5ISRgceeGVJ2dQIthKOuayqFXfFjXheHNo4bbt9LhRQ==" - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -19401,11 +19392,6 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, - "tinyqueue": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-1.2.3.tgz", - "integrity": "sha512-Qz9RgWuO9l8lT+Y9xvbzhPT2efIUIFd69N7eF7tJ9lnQl0iLj1M7peK7IoUGZL9DJHw9XftqLreccfxcQgYLxA==" - }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", diff --git a/package.json b/package.json index c9dfe61c3..ae7b82648 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,17 @@ "vue-template-compiler": "^2.6.11" }, "dependencies": { - "@biigle/ol": "^5.3.0", "@fortawesome/fontawesome-free": "^5.2.0", + "@turf/boolean-contains": "^6.5.0", + "@turf/boolean-overlap": "^6.5.0", + "@turf/difference": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/union": "^6.5.0", "bootstrap-sass": "^3.3.7", "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", + "ol": "^5.3.3", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", diff --git a/resources/assets/js/annotations/components/annotationCanvas.vue b/resources/assets/js/annotations/components/annotationCanvas.vue index f0854373c..68d7a07a1 100644 --- a/resources/assets/js/annotations/components/annotationCanvas.vue +++ b/resources/assets/js/annotations/components/annotationCanvas.vue @@ -2,53 +2,52 @@ import * as PolygonValidator from '../ol/PolygonValidator'; import AnnotationTooltip from './annotationCanvas/annotationTooltip'; import AttachLabelInteraction from './annotationCanvas/attachLabelInteraction'; -import CanvasSource from '@biigle/ol/source/Canvas'; -import Circle from '@biigle/ol/geom/Circle'; -import Collection from '@biigle/ol/Collection'; +import CanvasSource from '../ol/source/Canvas'; +import Circle from 'ol/geom/Circle'; +import Collection from 'ol/Collection'; import ControlButton from './controlButton'; import DrawInteractions from './annotationCanvas/drawInteractions'; -import Ellipse from '@biigle/ol/geom/Ellipse'; +// import Ellipse from 'ol/geom/Ellipse'; import Events from '../../core/events'; -import Feature from '@biigle/ol/Feature'; -import ImageLayer from '@biigle/ol/layer/Image'; +import Feature from 'ol/Feature'; +import ImageLayer from 'ol/layer/Image'; import Keyboard from '../../core/keyboard'; import LabelIndicator from './labelIndicator'; import Lawnmower from './annotationCanvas/lawnmower'; -import LineString from '@biigle/ol/geom/LineString'; +import LineString from 'ol/geom/LineString'; import MagicWandInteraction from './annotationCanvas/magicWandInteraction'; -import Map from '@biigle/ol/Map'; +import Map from 'ol/Map'; import MeasureInteraction from './annotationCanvas/measureInteraction'; import Minimap from './minimap'; -import ModifyInteraction from '@biigle/ol/interaction/Modify'; +import ModifyInteraction from 'ol/interaction/Modify'; import MousePosition from './annotationCanvas/mousePosition'; -import MouseWheelZoom from '@biigle/ol/interaction/MouseWheelZoom'; -import Point from '@biigle/ol/geom/Point'; -import Polygon from '@biigle/ol/geom/Polygon'; +import MouseWheelZoom from 'ol/interaction/MouseWheelZoom'; +import Point from 'ol/geom/Point'; +import Polygon from 'ol/geom/Polygon'; import PolygonBrushInteraction from './annotationCanvas/polygonBrushInteraction'; -import Projection from '@biigle/ol/proj/Projection'; -import Rectangle from '@biigle/ol/geom/Rectangle'; +import Projection from 'ol/proj/Projection'; +// import Rectangle from 'ol/geom/Rectangle'; import Sampling from './annotationCanvas/sampling'; import ScaleLine from './annotationCanvas/scaleLine'; -import SelectInteraction from '@biigle/ol/interaction/Select'; +import SelectInteraction from 'ol/interaction/Select'; import Styles from '../stores/styles'; -import TileLayer from '@biigle/ol/layer/Tile'; +import TileLayer from 'ol/layer/Tile'; import TranslateInteraction from './annotationCanvas/translateInteraction'; -import VectorLayer from '@biigle/ol/layer/Vector'; -import VectorSource from '@biigle/ol/source/Vector'; -import View from '@biigle/ol/View'; -import ZoomControl from '@biigle/ol/control/Zoom'; -import ZoomifySource from '@biigle/ol/source/Zoomify'; +import VectorLayer from 'ol/layer/Vector'; +import VectorSource from 'ol/source/Vector'; +import View from 'ol/View'; +import ZoomControl from 'ol/control/Zoom'; +import ZoomifySource from 'ol/source/Zoomify'; import ZoomLevel from './annotationCanvas/zoomLevel'; -import ZoomToExtentControl from '@biigle/ol/control/ZoomToExtent'; +import ZoomToExtentControl from 'ol/control/ZoomToExtent'; import ZoomToNativeControl from '../ol/ZoomToNativeControl'; -import {click as clickCondition} from '@biigle/ol/events/condition'; -import {defaults as defaultInteractions} from '@biigle/ol/interaction' -import {getCenter} from '@biigle/ol/extent'; -import {shiftKeyOnly as shiftKeyOnlyCondition} from '@biigle/ol/events/condition'; -import {singleClick as singleClickCondition} from '@biigle/ol/events/condition'; +import {click as clickCondition} from 'ol/events/condition'; +import {defaults as defaultInteractions} from 'ol/interaction' +import {getCenter} from 'ol/extent'; +import {shiftKeyOnly as shiftKeyOnlyCondition} from 'ol/events/condition'; +import {singleClick as singleClickCondition} from 'ol/events/condition'; import { isInvalidShape } from '../utils'; - /** * The annotator canvas * @@ -371,8 +370,8 @@ export default { switch (annotation.shape) { case 'Point': return new Point(points[0]); - case 'Rectangle': - return new Rectangle([points]); + // case 'Rectangle': + // return new Rectangle([points]); case 'Polygon': return new Polygon([points]); case 'LineString': @@ -380,8 +379,8 @@ export default { case 'Circle': // radius is the x value of the second point of the circle return new Circle(points[0], points[1][0]); - case 'Ellipse': - return new Ellipse([points]); + // case 'Ellipse': + // return new Ellipse([points]); default: // unsupported shapes are ignored console.error('Unknown annotation shape: ' + annotation.shape); @@ -502,8 +501,8 @@ export default { points = [geometry.getCenter(), [geometry.getRadius()]]; break; case 'Polygon': - case 'Rectangle': - case 'Ellipse': + // case 'Rectangle': + // case 'Ellipse': points = geometry.getCoordinates()[0]; break; case 'Point': diff --git a/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue b/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue index a0c94fb5f..c51d5a22c 100644 --- a/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue +++ b/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue @@ -1,8 +1,8 @@ \ No newline at end of file + diff --git a/resources/assets/js/annotations/stores/styles.js b/resources/assets/js/annotations/stores/styles.js index 71e726f8c..dc5057407 100644 --- a/resources/assets/js/annotations/stores/styles.js +++ b/resources/assets/js/annotations/stores/styles.js @@ -1,8 +1,8 @@ -import Circle from '@biigle/ol/style/Circle'; -import Fill from '@biigle/ol/style/Fill'; -import RegularShape from '@biigle/ol/style/RegularShape'; -import Stroke from '@biigle/ol/style/Stroke'; -import Style from '@biigle/ol/style/Style'; +import Circle from 'ol/style/Circle'; +import Fill from 'ol/style/Fill'; +import RegularShape from 'ol/style/RegularShape'; +import Stroke from 'ol/style/Stroke'; +import Style from 'ol/style/Style'; /** * Store for the styles of OpenLayers features (annotations) diff --git a/resources/assets/js/videos/components/videoScreen.vue b/resources/assets/js/videos/components/videoScreen.vue index ca856b794..99004f7df 100644 --- a/resources/assets/js/videos/components/videoScreen.vue +++ b/resources/assets/js/videos/components/videoScreen.vue @@ -263,7 +263,7 @@ diff --git a/resources/assets/js/annotations/components/screenshotButton.vue b/resources/assets/js/annotations/components/screenshotButton.vue index d3b75f5bd..29509a674 100644 --- a/resources/assets/js/annotations/components/screenshotButton.vue +++ b/resources/assets/js/annotations/components/screenshotButton.vue @@ -124,14 +124,53 @@ export default { }, capture() { if (this.map) { - this.map.once('postcompose', (e) => { - this.makeBlob(e.context.canvas) - .then(this.download) - .catch(this.handleError); - }); + this.map.once('rendercomplete', this.handleRenderComplete); this.map.renderSync(); } }, + handleRenderComplete(e) { + // See: https://openlayers.org/en/v6.15.1/examples/export-map.html + const mapCanvas = document.createElement('canvas'); + const size = e.target.getSize(); + mapCanvas.width = size[0]; + mapCanvas.height = size[1]; + const mapContext = mapCanvas.getContext('2d'); + Array.prototype.forEach.call( + e.target.getViewport().querySelectorAll('.ol-layer canvas, canvas.ol-layer'), + function (canvas) { + if (canvas.width <= 0) { + return; + } + + let matrix; + const transform = canvas.style.transform; + if (transform) { + // Get the transform parameters from the style's transform matrix + matrix = transform + .match(/^matrix\(([^\(]*)\)$/)[1] + .split(',') + .map(Number); + } else { + matrix = [ + parseFloat(canvas.style.width) / canvas.width, + 0, + 0, + parseFloat(canvas.style.height) / canvas.height, + 0, + 0, + ]; + } + // Apply the transform to the export map context + CanvasRenderingContext2D.prototype.setTransform.apply( + mapContext, + matrix + ); + mapContext.drawImage(canvas, 0, 0); + } + ); + + this.makeBlob(mapCanvas).then(this.download).catch(this.handleError); + }, handleError(message) { Messages.danger(message); }, diff --git a/resources/assets/js/annotations/ol/MagicWandInteraction.js b/resources/assets/js/annotations/ol/MagicWandInteraction.js index 443ab096e..9a4473eeb 100644 --- a/resources/assets/js/annotations/ol/MagicWandInteraction.js +++ b/resources/assets/js/annotations/ol/MagicWandInteraction.js @@ -302,7 +302,7 @@ class MagicWandInteraction extends PointerInteraction { */ updateSnapshot() { if (!this.updatingSnapshot && this.layer) { - this.layer.once('postcompose', this.updateSnapshotCanvas.bind(this)); + this.layer.once('postrender', this.updateSnapshotCanvas.bind(this)); // Set flag to avoid infinite recursion since renderSync will trigger the // moveend event again! this.updatingSnapshot = true; diff --git a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js index 187a1bc15..c061958d8 100644 --- a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js @@ -3,7 +3,6 @@ import booleanContains from '@turf/boolean-contains'; import booleanOverlap from '@turf/boolean-overlap'; import Feature from 'ol/Feature'; import EventType from 'ol/events/EventType'; -import GeometryType from 'ol/geom/GeometryType'; import Circle from 'ol/geom/Circle'; import Polygon from 'ol/geom/Polygon'; import {createEditingStyle} from 'ol/style/Style'; @@ -168,13 +167,13 @@ class ModifyPolygonBrush extends Modify { startSubtracting_(event) { this.isSubtracting_ = true; - this.willModifyFeatures_(event); + // this.willModifyFeatures_(event, []); this.subtractCurrentFeatures_(event); } startAdding_(event) { this.isAdding_ = true; - this.willModifyFeatures_(event); + // this.willModifyFeatures_(event, []); this.addCurrentFeatures_(event); } @@ -256,7 +255,7 @@ function getDefaultStyleFunction() { const style = createEditingStyle(); return function(feature, resolution) { - return style[GeometryType.CIRCLE]; + return style['Circle']; } } diff --git a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js index ea4a67c61..83f989fc7 100644 --- a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js @@ -5,7 +5,6 @@ import Draw from 'ol/interaction/Draw'; import Event from 'ol/events/Event.js'; import EventType from 'ol/events/EventType'; import Feature from 'ol/Feature'; -import GeometryType from 'ol/geom/GeometryType'; import MapBrowserEventType from 'ol/MapBrowserEventType'; import VectorLayer from 'ol/layer/Vector'; import {always} from 'ol/events/condition'; @@ -101,6 +100,8 @@ class PolygonBrush extends Draw { options.freehandCondition = options.freehandCondition ? options.freehandCondition : penOnly; + options.type = 'Polygon'; + super(options); // Override the default overlay to set updateWhileAnimating. @@ -282,9 +283,9 @@ class PolygonBrush extends Draw { function getDefaultStyleFunction() { let styles = createEditingStyle(); - styles[GeometryType.POLYGON] = - styles[GeometryType.POLYGON].concat( - styles[GeometryType.LINE_STRING] + styles['Polygon'] = + styles['Polygon'].concat( + styles['LineString'] ); return function(feature, resolution) { diff --git a/resources/assets/js/annotations/ol/source/Canvas.js b/resources/assets/js/annotations/ol/source/Canvas.js index 03ec86f56..d1d0882fa 100644 --- a/resources/assets/js/annotations/ol/source/Canvas.js +++ b/resources/assets/js/annotations/ol/source/Canvas.js @@ -42,10 +42,9 @@ class Canvas extends Image { * @inheritDoc */ getImageInternal(extent, resolution, pixelRatio, projection) { - if (intersects(extent, this.canvas_.getExtent())) { - return this.canvas_; - } - return null; + // No need to check if extent intersects canvas. The canvas is always visible + // in our apllication. + return this.canvas_; }; } diff --git a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue index cc514df96..7bb370e5a 100644 --- a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue @@ -41,35 +41,19 @@ export default { this.map.removeLayer(this.videoLayer); } + this.videoCanvas.width = this.extent[2]; + this.videoCanvas.height = this.extent[3]; + this.videoLayer = new ImageLayer({ name: 'image', // required by the minimap component source: new CanvasSource({ - canvas: this.dummyCanvas, + canvas: this.videoCanvas, projection: projection, canvasExtent: this.extent, canvasSize: [this.extent[2], this.extent[3]], }), }); - // Based on this: https://stackoverflow.com/a/42902773/1796523 - this.videoLayer.on('postcompose', (event) => { - let frameState = event.frameState; - let resolution = frameState.viewState.resolution; - // Custom implementation of "map.getPixelFromCoordinate" because this - // layer is rendered both on the map of the main view and on the map of - // the minimap component (i.e. the map changes). - let origin = applyTransform( - frameState.coordinateToPixelTransform, - [0, this.extent[3]] - ); - let context = event.context; - context.save(); - context.scale(frameState.pixelRatio, frameState.pixelRatio); - context.translate(origin[0], origin[1]); - context.drawImage(this.video, 0, 0, this.extent[2] / resolution, this.extent[3] / resolution); - context.restore(); - }); - // The video layer should always be the first layer, otherwise it will be // rendered e.g. above the annotations. this.map.getLayers().insertAt(0, this.videoLayer); @@ -81,6 +65,8 @@ export default { // zoomFactor: 2, minResolution: this.minResolution, extent: this.extent, + showFullExtent: true, + constrainOnlyCenter: true, })); this.map.getView().fit(this.extent); @@ -89,6 +75,7 @@ export default { // Drop animation frame if the time has not changed. if (force || this.renderCurrentTime !== this.video.currentTime) { this.renderCurrentTime = this.video.currentTime; + this.videoContext.drawImage(this.video, 0, 0, this.videoCanvas.width, this.videoCanvas.height); this.videoLayer.changed(); let now = Date.now(); @@ -250,9 +237,8 @@ export default { }, }, created() { - this.dummyCanvas = document.createElement('canvas'); - this.dummyCanvas.width = 1; - this.dummyCanvas.height = 1; + this.videoCanvas = document.createElement('canvas'); + this.videoContext = this.videoCanvas.getContext('2d'); this.video.addEventListener('play', this.setPlaying); this.video.addEventListener('pause', this.setPaused); this.video.addEventListener('seeked', this.handleSeeked); From 7dda9c0a3f6359ce179440f5381ffddae7135614 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Tue, 2 Jul 2024 13:26:43 +0200 Subject: [PATCH 03/27] Improve video (minimap) rendering --- .../js/annotations/components/minimap.vue | 17 ----------------- .../assets/js/videos/components/videoScreen.vue | 1 - .../components/videoScreen/videoPlayback.vue | 16 +++++++++------- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/resources/assets/js/annotations/components/minimap.vue b/resources/assets/js/annotations/components/minimap.vue index 8d12e0a35..30b35323c 100644 --- a/resources/assets/js/annotations/components/minimap.vue +++ b/resources/assets/js/annotations/components/minimap.vue @@ -33,10 +33,6 @@ export default { type: Number, default: 200, }, - renderActive: { - type: Boolean, - default: true, - }, }, data() { return { @@ -133,22 +129,12 @@ export default { this.refreshImageLayer({element: layer}); }); }, - render() { - this.minimap.render(); - }, }, watch: { // Refresh the view if the extent (i.e. image size) changed. extent() { this.updateElementSize(); }, - renderActive(render) { - if (render) { - this.minimap.render(); - } else { - this.minimap.cancelRender(); - } - }, }, created() { this.minimap = new Map({ @@ -181,8 +167,6 @@ export default { this.minimap.on('pointerdrag', this.dragViewport); this.minimap.on('click', this.dragViewport); this.initImageLayer(map.getLayers()); - - map.on('postrender', this.render); }, mounted() { this.updateElementSize(); @@ -198,7 +182,6 @@ export default { map.un('change:size', this.updateMapSize); map.un('change:view', this.updateMapView); map.getLayers().un('add', this.refreshImageLayer); - map.un('postrender', this.render); }, }; diff --git a/resources/assets/js/videos/components/videoScreen.vue b/resources/assets/js/videos/components/videoScreen.vue index 99004f7df..4aa849285 100644 --- a/resources/assets/js/videos/components/videoScreen.vue +++ b/resources/assets/js/videos/components/videoScreen.vue @@ -3,7 +3,6 @@ = this.refreshRate) { From 57db566f7ca1ebe5674573d29a55b0b7757686d2 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Tue, 2 Jul 2024 13:53:09 +0200 Subject: [PATCH 04/27] Fix size of OpenLayers controls --- resources/assets/sass/annotations/_ol.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/assets/sass/annotations/_ol.scss b/resources/assets/sass/annotations/_ol.scss index 783a30402..5498b450a 100644 --- a/resources/assets/sass/annotations/_ol.scss +++ b/resources/assets/sass/annotations/_ol.scss @@ -17,3 +17,8 @@ @extend %custom-icon; } } + +.ol-control button { + // Keep same size than of OL5. + font-size: 1.14em !important; +} From 04bbea8e12585aa4c6302b29963235f6f5558105 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Tue, 2 Jul 2024 15:42:50 +0200 Subject: [PATCH 05/27] Fix magic wand snapshot update behavior --- resources/assets/js/annotations/ol/MagicWandInteraction.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/annotations/ol/MagicWandInteraction.js b/resources/assets/js/annotations/ol/MagicWandInteraction.js index 9a4473eeb..8743ce00b 100644 --- a/resources/assets/js/annotations/ol/MagicWandInteraction.js +++ b/resources/assets/js/annotations/ol/MagicWandInteraction.js @@ -118,6 +118,8 @@ class MagicWandInteraction extends PointerInteraction { zIndex: 200, })); + this.snapshotListener = this.updateSnapshot.bind(this); + // Update the snapshot and set event listeners if the interaction is active. this.toggleActive(); } @@ -283,10 +285,10 @@ class MagicWandInteraction extends PointerInteraction { */ toggleActive() { if (this.getActive()) { - this.map.on(['moveend', 'change:size'], this.updateSnapshot.bind(this)); + this.map.on(['moveend', 'change:size'], this.snapshotListener); this.updateSnapshot(); } else { - this.map.un(['moveend', 'change:size'], this.updateSnapshot.bind(this)); + this.map.un(['moveend', 'change:size'], this.snapshotListener); this.indicatorSource.clear(); this.isShowingPoint = false; this.isShowingCross = false; From c5bb3d5a5ac3bb945ef9c19d25ca42e5c206d5b4 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Tue, 2 Jul 2024 16:33:55 +0200 Subject: [PATCH 06/27] Remove unnecessary fallback --- .../components/annotationCanvas/annotationTooltip.vue | 2 +- resources/assets/js/videos/components/videoScreen/tooltips.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/annotations/components/annotationCanvas/annotationTooltip.vue b/resources/assets/js/annotations/components/annotationCanvas/annotationTooltip.vue index ccee4344b..f06fec913 100644 --- a/resources/assets/js/annotations/components/annotationCanvas/annotationTooltip.vue +++ b/resources/assets/js/annotations/components/annotationCanvas/annotationTooltip.vue @@ -38,7 +38,7 @@ export default { return layer.get('name') === 'annotations'; }, updateHoveredAnnotations(e) { - let features = this.map.getFeaturesAtPixel(e.pixel, {layerFilter: this.annotationLayerFilter}) || []; + let features = this.map.getFeaturesAtPixel(e.pixel, {layerFilter: this.annotationLayerFilter}); let hash = features.map((f) => f.getId()).join('-'); if (this.hoveredFeaturesHash !== hash) { diff --git a/resources/assets/js/videos/components/videoScreen/tooltips.vue b/resources/assets/js/videos/components/videoScreen/tooltips.vue index 732757573..2a7650c46 100644 --- a/resources/assets/js/videos/components/videoScreen/tooltips.vue +++ b/resources/assets/js/videos/components/videoScreen/tooltips.vue @@ -26,7 +26,7 @@ export default { return layer.get('name') === 'annotations'; }, updateHoveredAnnotations(e) { - let features = this.map.getFeaturesAtPixel(e.pixel, {layerFilter: this.annotationLayerFilter}) || []; + let features = this.map.getFeaturesAtPixel(e.pixel, {layerFilter: this.annotationLayerFilter}); let hash = features.map((f) => f.getId()).join('-'); if (this.hoveredFeaturesHash !== hash) { From 5724449aaef623d34df7b17a9acac37825e37ac7 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 15:18:25 +0200 Subject: [PATCH 07/27] Upgrade to OpenLayers v7 --- package-lock.json | 109 ++++++++++++++++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 78 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index e85580a16..b3f464704 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^6.15.1", + "ol": "^7.5.2", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", @@ -5032,6 +5032,11 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "node_modules/echarts": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.2.tgz", @@ -5994,20 +5999,20 @@ } }, "node_modules/geotiff": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.0.4.tgz", - "integrity": "sha512-aG8h9bJccGusioPsEWsEqx8qdXpZN71A20WCvRKGxcnHSOWLKmC5ZmsAmodfxb9TRQvs+89KikGuPzxchhA+Uw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", + "integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==", "dependencies": { "@petamoriken/float16": "^3.4.7", "lerc": "^3.0.0", - "lru-cache": "^6.0.0", "pako": "^2.0.4", "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", "web-worker": "^1.2.0", - "xml-utils": "^1.0.2" + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" }, "engines": { - "browsers": "defaults", "node": ">=10.19" } }, @@ -6016,6 +6021,17 @@ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, + "node_modules/geotiff/node_modules/quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -7453,6 +7469,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -7984,12 +8001,13 @@ "dev": true }, "node_modules/ol": { - "version": "6.15.1", - "resolved": "https://registry.npmjs.org/ol/-/ol-6.15.1.tgz", - "integrity": "sha512-ZG2CKTpJ8Q+tPywYysVwPk+yevwJzlbwjRKhoCvd7kLVWMbfBl1O/+Kg/yrZZrhG9FNXbFH4GeOZ5yVRqo3P4w==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz", + "integrity": "sha512-HJbb3CxXrksM6ct367LsP3N+uh+iBBMdP3DeGGipdV9YAYTP0vTJzqGnoqQ6C2IW4qf8krw9yuyQbc9fjOIaOQ==", "dependencies": { - "geotiff": "2.0.4", - "ol-mapbox-style": "^8.0.5", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "ol-mapbox-style": "^10.1.0", "pbf": "3.2.1", "rbush": "^3.0.1" }, @@ -7999,12 +8017,13 @@ } }, "node_modules/ol-mapbox-style": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-8.2.1.tgz", - "integrity": "sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.7.0.tgz", + "integrity": "sha512-S/UdYBuOjrotcR95Iq9AejGYbifKeZE85D9VtH11ryJLQPTZXZSW1J5bIXcr4AlAH6tyjPPHTK34AdkwB32Myw==", "dependencies": { "@mapbox/mapbox-gl-style-spec": "^13.23.1", - "mapbox-to-css-font": "^2.4.1" + "mapbox-to-css-font": "^2.4.1", + "ol": "^7.3.0" } }, "node_modules/on-finished": { @@ -11579,7 +11598,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yaml": { "version": "1.10.2", @@ -11629,6 +11649,11 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, + "node_modules/zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" } }, "dependencies": { @@ -15478,6 +15503,11 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "echarts": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.2.tgz", @@ -16222,23 +16252,29 @@ } }, "geotiff": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.0.4.tgz", - "integrity": "sha512-aG8h9bJccGusioPsEWsEqx8qdXpZN71A20WCvRKGxcnHSOWLKmC5ZmsAmodfxb9TRQvs+89KikGuPzxchhA+Uw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", + "integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==", "requires": { "@petamoriken/float16": "^3.4.7", "lerc": "^3.0.0", - "lru-cache": "^6.0.0", "pako": "^2.0.4", "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", "web-worker": "^1.2.0", - "xml-utils": "^1.0.2" + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" }, "dependencies": { "pako": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + }, + "quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==" } } }, @@ -17300,6 +17336,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -17711,23 +17748,25 @@ "dev": true }, "ol": { - "version": "6.15.1", - "resolved": "https://registry.npmjs.org/ol/-/ol-6.15.1.tgz", - "integrity": "sha512-ZG2CKTpJ8Q+tPywYysVwPk+yevwJzlbwjRKhoCvd7kLVWMbfBl1O/+Kg/yrZZrhG9FNXbFH4GeOZ5yVRqo3P4w==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz", + "integrity": "sha512-HJbb3CxXrksM6ct367LsP3N+uh+iBBMdP3DeGGipdV9YAYTP0vTJzqGnoqQ6C2IW4qf8krw9yuyQbc9fjOIaOQ==", "requires": { - "geotiff": "2.0.4", - "ol-mapbox-style": "^8.0.5", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "ol-mapbox-style": "^10.1.0", "pbf": "3.2.1", "rbush": "^3.0.1" } }, "ol-mapbox-style": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-8.2.1.tgz", - "integrity": "sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.7.0.tgz", + "integrity": "sha512-S/UdYBuOjrotcR95Iq9AejGYbifKeZE85D9VtH11ryJLQPTZXZSW1J5bIXcr4AlAH6tyjPPHTK34AdkwB32Myw==", "requires": { "@mapbox/mapbox-gl-style-spec": "^13.23.1", - "mapbox-to-css-font": "^2.4.1" + "mapbox-to-css-font": "^2.4.1", + "ol": "^7.3.0" } }, "on-finished": { @@ -20314,7 +20353,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "1.10.2", @@ -20357,6 +20397,11 @@ "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } + }, + "zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" } } } diff --git a/package.json b/package.json index 0395a7055..087b30e17 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^6.15.1", + "ol": "^7.5.2", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", From a1b024231347cb958fc6acb0228b448f54c7aaba Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 15:18:40 +0200 Subject: [PATCH 08/27] Fix OpenLayers control style --- resources/assets/sass/annotations/_ol.scss | 26 ++++++++++++++++--- .../components/_annotation-canvas.scss | 2 -- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/resources/assets/sass/annotations/_ol.scss b/resources/assets/sass/annotations/_ol.scss index 5498b450a..dcd7c199a 100644 --- a/resources/assets/sass/annotations/_ol.scss +++ b/resources/assets/sass/annotations/_ol.scss @@ -1,3 +1,5 @@ +$ol-control-color: rgb(0, 60, 136); + %custom-icon { color: white; display: block; @@ -18,7 +20,25 @@ } } -.ol-control button { - // Keep same size than of OL5. - font-size: 1.14em !important; +.ol-control { + --ol-subtle-background-color: rgba(255, 255, 255, 0.4); + padding: 2px; + + &:hover { + --ol-subtle-background-color: rgba(255, 255, 255, 0.6); + } + + button { + // Keep same size and style than of OL5. + font-size: 1.14em !important; + --ol-background-color: #{fade-out($ol-control-color, 0.5)}; + --ol-subtle-foreground-color: white; + transition: background-color 0.25s ease; + + &:hover, &:focus, &.active { + --ol-foreground-color: white; + --ol-background-color: #{fade-out($ol-control-color, 0.3)}; + --ol-subtle-foreground-color: transparent; + } + } } diff --git a/resources/assets/sass/annotations/components/_annotation-canvas.scss b/resources/assets/sass/annotations/components/_annotation-canvas.scss index 7e6a982a6..e55ac2c42 100644 --- a/resources/assets/sass/annotations/components/_annotation-canvas.scss +++ b/resources/assets/sass/annotations/components/_annotation-canvas.scss @@ -1,5 +1,3 @@ -$ol-control-color: rgb(0, 60, 136); - %ol-control { // on top of the map canvas z-index: 1; From b6f765632315def4efd785c022372319bc3f3059 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 15:28:04 +0200 Subject: [PATCH 09/27] Upgrade to OpenLayers v9 --- package-lock.json | 261 +++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 75 insertions(+), 188 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3f464704..1e7f61900 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^7.5.2", + "ol": "^8.2.0", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", @@ -2224,45 +2224,6 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, - "node_modules/@mapbox/jsonlint-lines-primitives": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", - "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@mapbox/mapbox-gl-style-spec": { - "version": "13.28.0", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-style-spec/-/mapbox-gl-style-spec-13.28.0.tgz", - "integrity": "sha512-B8xM7Fp1nh5kejfIl4SWeY0gtIeewbuRencqO3cJDrCHZpaPg7uY+V8abuR+esMeuOjRl5cLhVTP40v+1ywxbg==", - "dependencies": { - "@mapbox/jsonlint-lines-primitives": "~2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/unitbezier": "^0.0.0", - "csscolorparser": "~1.0.2", - "json-stringify-pretty-compact": "^2.0.0", - "minimist": "^1.2.6", - "rw": "^1.3.3", - "sort-object": "^0.3.2" - }, - "bin": { - "gl-style-composite": "bin/gl-style-composite.js", - "gl-style-format": "bin/gl-style-format.js", - "gl-style-migrate": "bin/gl-style-migrate.js", - "gl-style-validate": "bin/gl-style-validate.js" - } - }, - "node_modules/@mapbox/point-geometry": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", - "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" - }, - "node_modules/@mapbox/unitbezier": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", - "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==" - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4142,6 +4103,36 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-parse": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz", + "integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==", + "dependencies": { + "color-name": "^2.0.0" + } + }, + "node_modules/color-parse/node_modules/color-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", + "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==", + "engines": { + "node": ">=12.20" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, "node_modules/colord": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.2.tgz", @@ -4585,11 +4576,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -7070,11 +7056,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "node_modules/json-stringify-pretty-compact": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz", - "integrity": "sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ==" - }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -7506,11 +7487,6 @@ "semver": "bin/semver.js" } }, - "node_modules/mapbox-to-css-font": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.4.tgz", - "integrity": "sha512-X1dtuTuH2D1MRMuductMZCLV/fy9EoIgqW/lmu8vQSAhEatx/tdFebkYT3TVhdTwqFDHbLEgQBD3IKA4KI7aoQ==" - }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -7770,7 +7746,8 @@ "node_modules/minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "node_modules/ms": { "version": "2.1.2", @@ -8001,13 +7978,14 @@ "dev": true }, "node_modules/ol": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz", - "integrity": "sha512-HJbb3CxXrksM6ct367LsP3N+uh+iBBMdP3DeGGipdV9YAYTP0vTJzqGnoqQ6C2IW4qf8krw9yuyQbc9fjOIaOQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", + "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", "dependencies": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", "earcut": "^2.2.3", "geotiff": "^2.0.7", - "ol-mapbox-style": "^10.1.0", "pbf": "3.2.1", "rbush": "^3.0.1" }, @@ -8016,16 +7994,6 @@ "url": "https://opencollective.com/openlayers" } }, - "node_modules/ol-mapbox-style": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.7.0.tgz", - "integrity": "sha512-S/UdYBuOjrotcR95Iq9AejGYbifKeZE85D9VtH11ryJLQPTZXZSW1J5bIXcr4AlAH6tyjPPHTK34AdkwB32Myw==", - "dependencies": { - "@mapbox/mapbox-gl-style-spec": "^13.23.1", - "mapbox-to-css-font": "^2.4.1", - "ol": "^7.3.0" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -9607,11 +9575,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" - }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -10048,34 +10011,6 @@ "websocket-driver": "^0.7.4" } }, - "node_modules/sort-asc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz", - "integrity": "sha512-jBgdDd+rQ+HkZF2/OHCmace5dvpos/aWQpcxuyRs9QUbPRnkEJmYVo81PIGpjIdpOcsnJ4rGjStfDHsbn+UVyw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-desc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.1.1.tgz", - "integrity": "sha512-jfZacW5SKOP97BF5rX5kQfJmRVZP5/adDUTY8fCSPvNcXDVpUEe2pr/iKGlcyZzchRJZrswnp68fgk3qBXgkJw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-object": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-0.3.2.tgz", - "integrity": "sha512-aAQiEdqFTTdsvUFxXm3umdo04J7MRljoVGbBlkH7BgNsMvVNAJyGj7C/wV1A8wHWAJj/YikeZbfuCKqhggNWGA==", - "dependencies": { - "sort-asc": "^0.1.0", - "sort-desc": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -13236,36 +13171,6 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, - "@mapbox/jsonlint-lines-primitives": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", - "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==" - }, - "@mapbox/mapbox-gl-style-spec": { - "version": "13.28.0", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-style-spec/-/mapbox-gl-style-spec-13.28.0.tgz", - "integrity": "sha512-B8xM7Fp1nh5kejfIl4SWeY0gtIeewbuRencqO3cJDrCHZpaPg7uY+V8abuR+esMeuOjRl5cLhVTP40v+1ywxbg==", - "requires": { - "@mapbox/jsonlint-lines-primitives": "~2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/unitbezier": "^0.0.0", - "csscolorparser": "~1.0.2", - "json-stringify-pretty-compact": "^2.0.0", - "minimist": "^1.2.6", - "rw": "^1.3.3", - "sort-object": "^0.3.2" - } - }, - "@mapbox/point-geometry": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", - "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" - }, - "@mapbox/unitbezier": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", - "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==" - }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -14823,6 +14728,35 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-parse": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz", + "integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==", + "requires": { + "color-name": "^2.0.0" + }, + "dependencies": { + "color-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", + "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==" + } + } + }, + "color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "requires": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, "colord": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.2.tgz", @@ -15178,11 +15112,6 @@ "integrity": "sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==", "dev": true }, - "csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" - }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -17024,11 +16953,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-pretty-compact": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz", - "integrity": "sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ==" - }, "json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -17363,11 +17287,6 @@ } } }, - "mapbox-to-css-font": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.4.tgz", - "integrity": "sha512-X1dtuTuH2D1MRMuductMZCLV/fy9EoIgqW/lmu8vQSAhEatx/tdFebkYT3TVhdTwqFDHbLEgQBD3IKA4KI7aoQ==" - }, "md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -17571,7 +17490,8 @@ "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "ms": { "version": "2.1.2", @@ -17748,27 +17668,18 @@ "dev": true }, "ol": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz", - "integrity": "sha512-HJbb3CxXrksM6ct367LsP3N+uh+iBBMdP3DeGGipdV9YAYTP0vTJzqGnoqQ6C2IW4qf8krw9yuyQbc9fjOIaOQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", + "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", "requires": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", "earcut": "^2.2.3", "geotiff": "^2.0.7", - "ol-mapbox-style": "^10.1.0", "pbf": "3.2.1", "rbush": "^3.0.1" } }, - "ol-mapbox-style": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.7.0.tgz", - "integrity": "sha512-S/UdYBuOjrotcR95Iq9AejGYbifKeZE85D9VtH11ryJLQPTZXZSW1J5bIXcr4AlAH6tyjPPHTK34AdkwB32Myw==", - "requires": { - "@mapbox/mapbox-gl-style-spec": "^13.23.1", - "mapbox-to-css-font": "^2.4.1", - "ol": "^7.3.0" - } - }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -18900,11 +18811,6 @@ "queue-microtask": "^1.2.2" } }, - "rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -19246,25 +19152,6 @@ "websocket-driver": "^0.7.4" } }, - "sort-asc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz", - "integrity": "sha512-jBgdDd+rQ+HkZF2/OHCmace5dvpos/aWQpcxuyRs9QUbPRnkEJmYVo81PIGpjIdpOcsnJ4rGjStfDHsbn+UVyw==" - }, - "sort-desc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.1.1.tgz", - "integrity": "sha512-jfZacW5SKOP97BF5rX5kQfJmRVZP5/adDUTY8fCSPvNcXDVpUEe2pr/iKGlcyZzchRJZrswnp68fgk3qBXgkJw==" - }, - "sort-object": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-0.3.2.tgz", - "integrity": "sha512-aAQiEdqFTTdsvUFxXm3umdo04J7MRljoVGbBlkH7BgNsMvVNAJyGj7C/wV1A8wHWAJj/YikeZbfuCKqhggNWGA==", - "requires": { - "sort-asc": "^0.1.0", - "sort-desc": "^0.1.1" - } - }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", diff --git a/package.json b/package.json index 087b30e17..7e0fe5b89 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^7.5.2", + "ol": "^8.2.0", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", From f190f7101a19c512a4148dc172f31aac663f4515 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 16:01:46 +0200 Subject: [PATCH 10/27] Fix issues because minimap made OpenLayers map reactive --- resources/assets/js/annotations/components/minimap.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/annotations/components/minimap.vue b/resources/assets/js/annotations/components/minimap.vue index 30b35323c..c83ea6e7d 100644 --- a/resources/assets/js/annotations/components/minimap.vue +++ b/resources/assets/js/annotations/components/minimap.vue @@ -36,8 +36,7 @@ export default { }, data() { return { - originalLayer: null, - currentLayer: null, + // }; }, computed: { @@ -137,6 +136,10 @@ export default { }, }, created() { + // Must not be reactive. + this.originalLayer = null; + this.currentLayer = null; + this.minimap = new Map({ // remove controls controls: [], From 24991675948f626001369036b2386129214b9cd6 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 16:41:52 +0200 Subject: [PATCH 11/27] Improve performance of polygon brush and modify brush interactions --- package-lock.json | 542 +----------------- package.json | 1 - .../ol/interaction/ModifyPolygonBrush.js | 27 +- .../ol/interaction/PolygonBrush.js | 10 +- 4 files changed, 40 insertions(+), 540 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e7f61900..b80e1a2b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "dependencies": { "@fortawesome/fontawesome-free": "^5.2.0", "@turf/boolean-contains": "^6.5.0", - "@turf/boolean-overlap": "^6.5.0", "@turf/difference": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/union": "^6.5.0", @@ -2307,18 +2306,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/bearing": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bearing/-/bearing-6.5.0.tgz", - "integrity": "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/boolean-contains": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/boolean-contains/-/boolean-contains-6.5.0.tgz", @@ -2334,22 +2321,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/boolean-overlap": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-overlap/-/boolean-overlap-6.5.0.tgz", - "integrity": "sha512-8btMIdnbXVWUa1M7D4shyaSGxLRw6NjMcqKBcsTXcZdnaixl22k7ar7BvIzkaRYN3SFECk9VGXfLncNS3ckQUw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/line-overlap": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-equality": "0.1.6" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/boolean-point-in-polygon": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/boolean-point-in-polygon/-/boolean-point-in-polygon-6.5.0.tgz", @@ -2374,18 +2345,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/destination": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/destination/-/destination-6.5.0.tgz", - "integrity": "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/difference": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", @@ -2399,18 +2358,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/helpers": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", @@ -2430,52 +2377,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-intersect": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-intersect/-/line-intersect-6.5.0.tgz", - "integrity": "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-rbush": "3.x" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/line-overlap": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-overlap/-/line-overlap-6.5.0.tgz", - "integrity": "sha512-xHOaWLd0hkaC/1OLcStCpfq55lPHpPNadZySDXYiYjEz5HXr1oKmtMYpn0wGizsLwrOixRdEp+j7bL8dPt4ojQ==", - "dependencies": { - "@turf/boolean-point-on-line": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/nearest-point-on-line": "^6.5.0", - "deep-equal": "1.x", - "geojson-rbush": "3.x" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/line-segment": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-segment/-/line-segment-6.5.0.tgz", - "integrity": "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/meta": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", @@ -2487,23 +2388,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-on-line": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/nearest-point-on-line/-/nearest-point-on-line-6.5.0.tgz", - "integrity": "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg==", - "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/union": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/union/-/union-6.5.0.tgz", @@ -2675,11 +2559,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/geojson": { - "version": "7946.0.8", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.8.tgz", - "integrity": "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==" - }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -3874,6 +3753,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4724,25 +4604,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", - "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", - "dependencies": { - "is-arguments": "^1.1.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.5.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -4773,6 +4634,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4794,22 +4656,6 @@ "node": ">=8" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -5161,6 +5007,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -5172,6 +5019,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, "engines": { "node": ">= 0.4" } @@ -5937,6 +5785,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5947,14 +5796,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5964,26 +5805,6 @@ "node": ">=6.9.0" } }, - "node_modules/geojson-equality": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", - "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", - "dependencies": { - "deep-equal": "^1.0.0" - } - }, - "node_modules/geojson-rbush": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/geojson-rbush/-/geojson-rbush-3.2.0.tgz", - "integrity": "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==", - "dependencies": { - "@turf/bbox": "*", - "@turf/helpers": "6.x", - "@turf/meta": "6.x", - "@types/geojson": "7946.0.8", - "rbush": "^3.0.1" - } - }, "node_modules/geotiff": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", @@ -6031,6 +5852,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -6144,6 +5966,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -6218,6 +6041,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "dependencies": { "es-define-property": "^1.0.0" }, @@ -6229,6 +6053,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6240,20 +6065,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dependencies": { - "has-symbols": "^1.0.3" - }, + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6329,6 +6141,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -6770,21 +6583,6 @@ "node": ">= 10" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6821,20 +6619,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -6913,21 +6697,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -7948,29 +7717,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -9287,23 +9033,6 @@ "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", "dev": true }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -9851,6 +9580,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -9863,20 +9593,6 @@ "node": ">= 0.4" } }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -13230,15 +12946,6 @@ "@turf/meta": "^6.5.0" } }, - "@turf/bearing": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bearing/-/bearing-6.5.0.tgz", - "integrity": "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - } - }, "@turf/boolean-contains": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/boolean-contains/-/boolean-contains-6.5.0.tgz", @@ -13251,19 +12958,6 @@ "@turf/invariant": "^6.5.0" } }, - "@turf/boolean-overlap": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-overlap/-/boolean-overlap-6.5.0.tgz", - "integrity": "sha512-8btMIdnbXVWUa1M7D4shyaSGxLRw6NjMcqKBcsTXcZdnaixl22k7ar7BvIzkaRYN3SFECk9VGXfLncNS3ckQUw==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/line-overlap": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-equality": "0.1.6" - } - }, "@turf/boolean-point-in-polygon": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/boolean-point-in-polygon/-/boolean-point-in-polygon-6.5.0.tgz", @@ -13282,15 +12976,6 @@ "@turf/invariant": "^6.5.0" } }, - "@turf/destination": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/destination/-/destination-6.5.0.tgz", - "integrity": "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - } - }, "@turf/difference": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", @@ -13301,15 +12986,6 @@ "polygon-clipping": "^0.15.3" } }, - "@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - } - }, "@turf/helpers": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", @@ -13323,43 +12999,6 @@ "@turf/helpers": "^6.5.0" } }, - "@turf/line-intersect": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-intersect/-/line-intersect-6.5.0.tgz", - "integrity": "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-rbush": "3.x" - } - }, - "@turf/line-overlap": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-overlap/-/line-overlap-6.5.0.tgz", - "integrity": "sha512-xHOaWLd0hkaC/1OLcStCpfq55lPHpPNadZySDXYiYjEz5HXr1oKmtMYpn0wGizsLwrOixRdEp+j7bL8dPt4ojQ==", - "requires": { - "@turf/boolean-point-on-line": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/nearest-point-on-line": "^6.5.0", - "deep-equal": "1.x", - "geojson-rbush": "3.x" - } - }, - "@turf/line-segment": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-segment/-/line-segment-6.5.0.tgz", - "integrity": "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw==", - "requires": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0" - } - }, "@turf/meta": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", @@ -13368,20 +13007,6 @@ "@turf/helpers": "^6.5.0" } }, - "@turf/nearest-point-on-line": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/nearest-point-on-line/-/nearest-point-on-line-6.5.0.tgz", - "integrity": "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg==", - "requires": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/meta": "^6.5.0" - } - }, "@turf/union": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/union/-/union-6.5.0.tgz", @@ -13549,11 +13174,6 @@ "@types/range-parser": "*" } }, - "@types/geojson": { - "version": "7946.0.8", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.8.tgz", - "integrity": "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==" - }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -14560,6 +14180,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, "requires": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -15212,19 +14833,6 @@ } } }, - "deep-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", - "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", - "requires": { - "is-arguments": "^1.1.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.5.1" - } - }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -15249,6 +14857,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, "requires": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -15261,16 +14870,6 @@ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true }, - "define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "requires": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -15558,6 +15157,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, "requires": { "get-intrinsic": "^1.2.4" } @@ -15565,7 +15165,8 @@ "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true }, "es-module-lexer": { "version": "0.9.3", @@ -16141,7 +15742,8 @@ "function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -16149,37 +15751,12 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, - "geojson-equality": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", - "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", - "requires": { - "deep-equal": "^1.0.0" - } - }, - "geojson-rbush": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/geojson-rbush/-/geojson-rbush-3.2.0.tgz", - "integrity": "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==", - "requires": { - "@turf/bbox": "*", - "@turf/helpers": "6.x", - "@turf/meta": "6.x", - "@types/geojson": "7946.0.8", - "rbush": "^3.0.1" - } - }, "geotiff": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", @@ -16217,6 +15794,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, "requires": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -16299,6 +15877,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "requires": { "get-intrinsic": "^1.1.3" } @@ -16358,6 +15937,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "requires": { "es-define-property": "^1.0.0" } @@ -16365,20 +15945,14 @@ "has-proto": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "requires": { - "has-symbols": "^1.0.3" - } + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true }, "hash-base": { "version": "3.1.0", @@ -16430,6 +16004,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "requires": { "function-bind": "^1.1.2" } @@ -16749,15 +16324,6 @@ "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", "dev": true }, - "is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -16788,14 +16354,6 @@ "has": "^1.0.3" } }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -16844,15 +16402,6 @@ "isobject": "^3.0.1" } }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -17647,20 +17196,6 @@ "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true }, - "object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "requires": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -18601,17 +18136,6 @@ "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", "dev": true }, - "regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "requires": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - } - }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -19028,6 +18552,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, "requires": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -19037,17 +18562,6 @@ "has-property-descriptors": "^1.0.2" } }, - "set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - } - }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", diff --git a/package.json b/package.json index 7e0fe5b89..f7473fff0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "dependencies": { "@fortawesome/fontawesome-free": "^5.2.0", "@turf/boolean-contains": "^6.5.0", - "@turf/boolean-overlap": "^6.5.0", "@turf/difference": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/union": "^6.5.0", diff --git a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js index c061958d8..e16ce8be5 100644 --- a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js @@ -1,6 +1,5 @@ import {polygon as turfPolygon} from '@turf/helpers'; import booleanContains from '@turf/boolean-contains'; -import booleanOverlap from '@turf/boolean-overlap'; import Feature from 'ol/Feature'; import EventType from 'ol/events/EventType'; import Circle from 'ol/geom/Circle'; @@ -199,16 +198,7 @@ class ModifyPolygonBrush extends Modify { // Skip features that can't be represented as polygon. return; } - if (booleanOverlap(sketchPointPolygon, featurePolygon)) { - var coords = difference(featurePolygon, sketchPointPolygon); - if (!this.allowRemove_ && sketchPointArea > (new Polygon(coords)).getArea()) { - // If allowRemove_ is false, the modified polygon may not become smaller than - // the sketchPointPolygon. - return; - } - featureGeom.setCoordinates(coords); - } else if (booleanContains(sketchPointPolygon, featurePolygon)) { - if (this.allowRemove_) { + if (this.allowRemove_ && booleanContains(sketchPointPolygon, featurePolygon)) { this.features_.remove(feature); if (this.source_) { this.source_.removeFeature(feature); @@ -216,8 +206,15 @@ class ModifyPolygonBrush extends Modify { this.dispatchEvent( new ModifyEvent(ModifyPolygonBrushEventType.MODIFYREMOVE, new Collection([feature]), event) ); + } else { + var coords = difference(featurePolygon, sketchPointPolygon); + if (!this.allowRemove_ && sketchPointArea > (new Polygon(coords)).getArea()) { + // If allowRemove_ is false, the modified polygon may not become smaller than + // the sketchPointPolygon. + return; } - } + featureGeom.setCoordinates(coords); + } }, this); } @@ -232,11 +229,7 @@ class ModifyPolygonBrush extends Modify { // Skip features that can't be represented as polygon. return; } - if (booleanOverlap(sketchPointPolygon, featurePolygon)) { - featureGeom.setCoordinates(union(sketchPointPolygon, featurePolygon)); - } else if (booleanContains(sketchPointPolygon, featurePolygon)) { - featureGeom.setCoordinates(sketchPointGeom.getCoordinates()); - } + featureGeom.setCoordinates(union(sketchPointPolygon, featurePolygon)); }, this); } diff --git a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js index 83f989fc7..04346cb83 100644 --- a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js @@ -1,5 +1,3 @@ -import booleanContains from '@turf/boolean-contains'; -import booleanOverlap from '@turf/boolean-overlap'; import Circle from 'ol/geom/Circle'; import Draw from 'ol/interaction/Draw'; import Event from 'ol/events/Event.js'; @@ -245,12 +243,8 @@ class PolygonBrush extends Draw { const sketchCirclePolygon = turfPolygon(sketchCircleGeometry.getCoordinates()); const sketchFeatureGeometry = this.sketchFeature_.getGeometry(); const sketchFeaturePolygon = turfPolygon(sketchFeatureGeometry.getCoordinates()); - if (booleanOverlap(sketchCirclePolygon, sketchFeaturePolygon) - || booleanContains(sketchCirclePolygon, sketchFeaturePolygon)) { - sketchFeatureGeometry.setCoordinates( - union(sketchCirclePolygon, sketchFeaturePolygon) - ); - } + + sketchFeatureGeometry.setCoordinates(union(sketchCirclePolygon, sketchFeaturePolygon)); } } From 9a4cdddaea28c937630370f3210edb564d16e90a Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 16:58:06 +0200 Subject: [PATCH 12/27] Remove unnecessary option --- resources/assets/js/annotations/ol/source/Canvas.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/assets/js/annotations/ol/source/Canvas.js b/resources/assets/js/annotations/ol/source/Canvas.js index d1d0882fa..aefa0d14c 100644 --- a/resources/assets/js/annotations/ol/source/Canvas.js +++ b/resources/assets/js/annotations/ol/source/Canvas.js @@ -29,12 +29,6 @@ class Canvas extends Image { */ this.canvas_ = new ImageCanvas(options.canvasExtent, resolution, 1, options.canvas); - /** - * @private - * @type {import("../size.js").Size} - */ - this.canvasSize_ = options.canvasSize ? options.canvasSize : null; - listen(this.canvas_, EventType.CHANGE, this.handleImageChange, this); } From f47de14220b90e3689d3af2338c44d48e3381720 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 3 Jul 2024 16:58:17 +0200 Subject: [PATCH 13/27] Upgrade to OpenLayers v9 (for real) The last commit only upgraded to v8. --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b80e1a2b8..d2ff933c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^8.2.0", + "ol": "^9.2.4", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", @@ -7724,9 +7724,9 @@ "dev": true }, "node_modules/ol": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", - "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/ol/-/ol-9.2.4.tgz", + "integrity": "sha512-bsbu4ObaAlbELMIZWnYEvX4Z9jO+OyCBshtODhDKmqYTPEfnKOX3RieCr97tpJkqWTZvyV4tS9UQDvHoCdxS+A==", "dependencies": { "color-rgba": "^3.0.0", "color-space": "^2.0.1", @@ -17203,9 +17203,9 @@ "dev": true }, "ol": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", - "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/ol/-/ol-9.2.4.tgz", + "integrity": "sha512-bsbu4ObaAlbELMIZWnYEvX4Z9jO+OyCBshtODhDKmqYTPEfnKOX3RieCr97tpJkqWTZvyV4tS9UQDvHoCdxS+A==", "requires": { "color-rgba": "^3.0.0", "color-space": "^2.0.1", diff --git a/package.json b/package.json index f7473fff0..92fa9fae0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^8.2.0", + "ol": "^9.2.4", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", From 1f3f0946bfb38e368d1a971a33c2e6fd9bd71955 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Thu, 4 Jul 2024 13:40:45 +0200 Subject: [PATCH 14/27] Fix screenshot button behavior --- .../components/screenshotButton.vue | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/resources/assets/js/annotations/components/screenshotButton.vue b/resources/assets/js/annotations/components/screenshotButton.vue index 29509a674..c1b766279 100644 --- a/resources/assets/js/annotations/components/screenshotButton.vue +++ b/resources/assets/js/annotations/components/screenshotButton.vue @@ -130,46 +130,13 @@ export default { }, handleRenderComplete(e) { // See: https://openlayers.org/en/v6.15.1/examples/export-map.html - const mapCanvas = document.createElement('canvas'); - const size = e.target.getSize(); - mapCanvas.width = size[0]; - mapCanvas.height = size[1]; - const mapContext = mapCanvas.getContext('2d'); - Array.prototype.forEach.call( - e.target.getViewport().querySelectorAll('.ol-layer canvas, canvas.ol-layer'), - function (canvas) { - if (canvas.width <= 0) { - return; - } - - let matrix; - const transform = canvas.style.transform; - if (transform) { - // Get the transform parameters from the style's transform matrix - matrix = transform - .match(/^matrix\(([^\(]*)\)$/)[1] - .split(',') - .map(Number); - } else { - matrix = [ - parseFloat(canvas.style.width) / canvas.width, - 0, - 0, - parseFloat(canvas.style.height) / canvas.height, - 0, - 0, - ]; - } - // Apply the transform to the export map context - CanvasRenderingContext2D.prototype.setTransform.apply( - mapContext, - matrix - ); - mapContext.drawImage(canvas, 0, 0); - } - ); + // This version is modified/simplified because we want the screenshot + // in the actual device pixel ratio and not at the original size. + const canvas = e.target + .getViewport() + .querySelector('.ol-layer canvas, canvas.ol-layer'); - this.makeBlob(mapCanvas).then(this.download).catch(this.handleError); + this.makeBlob(canvas).then(this.download).catch(this.handleError); }, handleError(message) { Messages.danger(message); From f4737002ab855405ba706947b5a3f5fa35742101 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Thu, 4 Jul 2024 13:58:06 +0200 Subject: [PATCH 15/27] Fix minimap update on color adjustment --- resources/assets/js/annotations/annotatorContainer.vue | 5 ++--- .../assets/js/annotations/components/annotationCanvas.vue | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/resources/assets/js/annotations/annotatorContainer.vue b/resources/assets/js/annotations/annotatorContainer.vue index 84f295869..a19df869b 100644 --- a/resources/assets/js/annotations/annotatorContainer.vue +++ b/resources/assets/js/annotations/annotatorContainer.vue @@ -501,10 +501,9 @@ export default { }, 10000); }, updateColorAdjustment(params) { - let canvas = this.$refs.canvas; - debounce(function () { + debounce(() => { ImagesStore.updateColorAdjustment(params); - canvas.render(); + this.$refs.canvas.fireImageSourceChanged(); }, 100, 'annotations.color-adjustment.update'); }, handleSettingsChange(key, value) { diff --git a/resources/assets/js/annotations/components/annotationCanvas.vue b/resources/assets/js/annotations/components/annotationCanvas.vue index 3acb55354..14158820d 100644 --- a/resources/assets/js/annotations/components/annotationCanvas.vue +++ b/resources/assets/js/annotations/components/annotationCanvas.vue @@ -583,10 +583,10 @@ export default { this.resetInteractionMode(); } }, - render() { - if (this.map) { - this.map.render(); - this.$emit('render'); + fireImageSourceChanged() { + const source = this.imageLayer?.getSource(); + if (source) { + source.changed(); } }, handleRegularImage(image) { From 708fd0d2846c5c3f88a6099b720c8ad773dedc24 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Thu, 4 Jul 2024 14:21:23 +0200 Subject: [PATCH 16/27] Fix padding of zoom to whole image interaction --- resources/assets/js/annotations/components/annotationCanvas.vue | 2 +- .../assets/js/videos/components/videoScreen/videoPlayback.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/annotations/components/annotationCanvas.vue b/resources/assets/js/annotations/components/annotationCanvas.vue index 14158820d..f0ccc912a 100644 --- a/resources/assets/js/annotations/components/annotationCanvas.vue +++ b/resources/assets/js/annotations/components/annotationCanvas.vue @@ -733,7 +733,6 @@ export default { projection: this.projection, center: center, resolution: this.resolution, - zoomFactor: 2, // Allow a maximum of 100x magnification for non-tiled images. More // cannot be represented in the URL parameters. minResolution: 0.01, @@ -741,6 +740,7 @@ export default { extent: extent, showFullExtent: true, constrainOnlyCenter: true, + padding: [10, 10, 10, 10], })); if (this.resolution === undefined) { diff --git a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue index 28b5b44f3..85015a0e1 100644 --- a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue @@ -64,11 +64,11 @@ export default { // Center is required but will be updated immediately with fit(). center: [0, 0], projection: projection, - // zoomFactor: 2, minResolution: this.minResolution, extent: this.extent, showFullExtent: true, constrainOnlyCenter: true, + padding: [10, 10, 10, 10], })); this.map.getView().fit(this.extent); From 03ee712a335911b12b97754781c4636f4d15335a Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 5 Jul 2024 12:10:45 +0200 Subject: [PATCH 17/27] Fix select interaction behavior --- resources/assets/js/annotations/stores/styles.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/annotations/stores/styles.js b/resources/assets/js/annotations/stores/styles.js index dc5057407..6f3ffc7d0 100644 --- a/resources/assets/js/annotations/stores/styles.js +++ b/resources/assets/js/annotations/stores/styles.js @@ -50,6 +50,10 @@ let selectedCircleFill = new Fill({ color: colors.orange, }); +let transparentFill = new Fill({ + color: 'transparent', +}); + let defaultCircleStroke = new Stroke({ color: colors.white, width: 2 @@ -92,9 +96,7 @@ export default { // Add transparent fill for hit detection inside of circles and // polygons. // See https://github.com/openlayers/openlayers/pull/7750 - fill: new Fill({ - color: 'transparent', - }), + fill: transparentFill, }), new Style({ stroke: new Stroke({ @@ -115,6 +117,10 @@ export default { fill: selectedCircleFill, stroke: selectedCircleStroke, }), + // Add transparent fill for hit detection inside of circles and + // polygons. + // See https://github.com/openlayers/openlayers/pull/7750 + fill: transparentFill, zIndex: 200, }), new Style({ From 6b45674e231735f7c81135838f67b2da538ded7d Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 5 Jul 2024 14:42:19 +0200 Subject: [PATCH 18/27] Fix flickering minimap with tiled image --- .../js/annotations/components/minimap.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/annotations/components/minimap.vue b/resources/assets/js/annotations/components/minimap.vue index c83ea6e7d..09cb943aa 100644 --- a/resources/assets/js/annotations/components/minimap.vue +++ b/resources/assets/js/annotations/components/minimap.vue @@ -10,6 +10,7 @@ import TileLayer from 'ol/layer/Tile'; import VectorLayer from 'ol/layer/Vector'; import VectorSource from 'ol/source/Vector'; import View from 'ol/View'; +import ZoomifySource from 'ol/source/Zoomify'; import {CancelableMap as Map} from '../ol/CancelableMap'; import {fromExtent} from 'ol/geom/Polygon'; import {getCenter} from 'ol/extent'; @@ -120,7 +121,21 @@ export default { }, handleChangeSource(e) { if (this.currentLayer) { - this.currentLayer.setSource(e.target.getSource()); + let source = e.target.getSource(); + + // Create a new tile source instead of sharing it because otherwise the + // minimap would flicker on zoom/pan sometimes. + if (this.currentLayer instanceof TileLayer) { + let image = this.$parent.image + source = new ZoomifySource({ + url: image.url, + size: [image.width, image.height], + extent: [0, 0, image.width, image.height], + transition: 0, + }); + } + + this.currentLayer.setSource(source); } }, initImageLayer(layers) { From 61c6bcda622e3272e6203be20f76fb02d312ecfd Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 5 Jul 2024 15:05:49 +0200 Subject: [PATCH 19/27] Fix ESLint errors --- .../assets/js/annotations/ol/geom/flat/difference.js | 1 - resources/assets/js/annotations/ol/geom/flat/union.js | 1 - .../js/annotations/ol/interaction/ModifyPolygonBrush.js | 6 +++--- .../assets/js/annotations/ol/interaction/PolygonBrush.js | 4 ++-- resources/assets/js/annotations/ol/source/Canvas.js | 6 +++--- .../videos/components/videoScreen/annotationPlayback.vue | 8 ++++---- .../js/videos/components/videoScreen/videoPlayback.vue | 1 - 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/resources/assets/js/annotations/ol/geom/flat/difference.js b/resources/assets/js/annotations/ol/geom/flat/difference.js index 83d68897c..3c4e2776c 100644 --- a/resources/assets/js/annotations/ol/geom/flat/difference.js +++ b/resources/assets/js/annotations/ol/geom/flat/difference.js @@ -1,5 +1,4 @@ import turfDifference from '@turf/difference'; -import {polygon as turfPolygon} from '@turf/helpers'; import Polygon from 'ol/geom/Polygon.js'; import {reducePrecision} from './simplify.js'; diff --git a/resources/assets/js/annotations/ol/geom/flat/union.js b/resources/assets/js/annotations/ol/geom/flat/union.js index 023eda5f4..59ce4e09c 100644 --- a/resources/assets/js/annotations/ol/geom/flat/union.js +++ b/resources/assets/js/annotations/ol/geom/flat/union.js @@ -1,5 +1,4 @@ import turfUnion from '@turf/union'; -import {polygon as turfPolygon} from '@turf/helpers'; import {reducePrecision} from './simplify.js'; export function union(first, second) { diff --git a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js index e16ce8be5..ba972debf 100644 --- a/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js @@ -204,7 +204,7 @@ class ModifyPolygonBrush extends Modify { this.source_.removeFeature(feature); } this.dispatchEvent( - new ModifyEvent(ModifyPolygonBrushEventType.MODIFYREMOVE, new Collection([feature]), event) + new ModifyEvent(ModifyEventType.MODIFYREMOVE, new Collection([feature]), event) ); } else { var coords = difference(featurePolygon, sketchPointPolygon); @@ -218,7 +218,7 @@ class ModifyPolygonBrush extends Modify { }, this); } - addCurrentFeatures_(event) { + addCurrentFeatures_() { const sketchPointGeom = fromCircle(this.sketchCircle_); let sketchPointPolygon = turfPolygon(sketchPointGeom.getCoordinates()); this.features_.getArray().forEach(function (feature) { @@ -247,7 +247,7 @@ class ModifyPolygonBrush extends Modify { function getDefaultStyleFunction() { const style = createEditingStyle(); - return function(feature, resolution) { + return function() { return style['Circle']; } } diff --git a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js index 04346cb83..912481537 100644 --- a/resources/assets/js/annotations/ol/interaction/PolygonBrush.js +++ b/resources/assets/js/annotations/ol/interaction/PolygonBrush.js @@ -168,7 +168,7 @@ class PolygonBrush extends Draw { return false; } - handleUpEvent(event) { + handleUpEvent() { if (this.handlingDownUpSequence && this.isDrawing_) { this.finishDrawing(); @@ -282,7 +282,7 @@ function getDefaultStyleFunction() { styles['LineString'] ); - return function(feature, resolution) { + return function(feature) { return styles[feature.getGeometry().getType()]; }; } diff --git a/resources/assets/js/annotations/ol/source/Canvas.js b/resources/assets/js/annotations/ol/source/Canvas.js index aefa0d14c..730a932b0 100644 --- a/resources/assets/js/annotations/ol/source/Canvas.js +++ b/resources/assets/js/annotations/ol/source/Canvas.js @@ -2,7 +2,7 @@ import Image from 'ol/source/Image'; import ImageCanvas from 'ol/ImageCanvas'; import {listen} from 'ol/events'; import EventType from 'ol/events/EventType'; -import {intersects, getHeight} from 'ol/extent'; +import {getHeight} from 'ol/extent'; /** * @classdesc @@ -35,11 +35,11 @@ class Canvas extends Image { /** * @inheritDoc */ - getImageInternal(extent, resolution, pixelRatio, projection) { + getImageInternal() { // No need to check if extent intersects canvas. The canvas is always visible // in our apllication. return this.canvas_; - }; + } } export default Canvas; diff --git a/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue b/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue index 8860d60bc..e9897176e 100644 --- a/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue @@ -154,8 +154,8 @@ export default { switch (shape) { case 'Point': return new Point(points[0]); - case 'Rectangle': - return new Rectangle([points]); + // case 'Rectangle': + // return new Rectangle([points]); case 'Polygon': return new Polygon([points]); case 'LineString': @@ -163,8 +163,8 @@ export default { case 'Circle': // radius is the x value of the second point of the circle return new Circle(points[0], points[1][0]); - case 'Ellipse': - return new Ellipse([points]); + // case 'Ellipse': + // return new Ellipse([points]); default: // unsupported shapes are ignored console.error('Unknown annotation shape: ' + shape); diff --git a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue index 85015a0e1..0d5777a68 100644 --- a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue @@ -4,7 +4,6 @@ import ImageLayer from 'ol/layer/Image'; import Keyboard from '../../../core/keyboard'; import Projection from 'ol/proj/Projection'; import View from 'ol/View'; -import {apply as applyTransform} from 'ol/transform'; /** * Mixin for the videoScreen component that contains logic for the video playback. From 19d96f8643bf9f0ab555a888ac6df8a9a62bcc38 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 5 Jul 2024 16:52:04 +0200 Subject: [PATCH 20/27] Make video annotation rendering more efficient --- .../videoScreen/annotationPlayback.vue | 33 ++++++++++++------- .../components/videoScreen/videoPlayback.vue | 9 ----- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue b/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue index e9897176e..9519f737e 100644 --- a/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/annotationPlayback.vue @@ -48,7 +48,8 @@ export default { }, }, methods: { - refreshAllAnnotations(time) { + refreshAllAnnotations() { + let time = this.video.currentTime; let source = this.annotationSource; let selected = this.selectedFeatures; let annotations = this.annotationsPreparedToRender; @@ -122,7 +123,10 @@ export default { } Object.values(newRendered).forEach((feature) => { - this.updateGeometry(feature, time); + let annotation = feature.get('annotation'); + let points = annotation.interpolatePoints(time); + let geometry = feature.getGeometry(); + this.updateGeometry(geometry, points); }); }, refreshSingleAnnotation(annotation) { @@ -143,11 +147,6 @@ export default { return feature; }, - updateGeometry(feature, time) { - let annotation = feature.get('annotation'); - let points = annotation.interpolatePoints(time); - feature.setGeometry(this.getGeometryFromPoints(annotation.shape, points)); - }, getGeometryFromPoints(shape, points) { points = this.convertPointsFromDbToOl(points); @@ -171,6 +170,20 @@ export default { return; } }, + updateGeometry(geometry, points) { + points = this.convertPointsFromDbToOl(points); + + if (geometry instanceof Point) { + geometry.setCoordinates(points[0]); + } else if (geometry instanceof LineString) { + geometry.setCoordinates(points); + } else if (geometry instanceof Circle) { + geometry.setCenter(points[0]); + geometry.setRadius(points[1][0]); + } else { + geometry.setCoordinates([points]); + } + }, getPointsFromGeometry(geometry) { let points; switch (geometry.getType()) { @@ -233,11 +246,9 @@ export default { }, }, created() { - this.$on('refresh', this.refreshAllAnnotations); this.$once('map-ready', () => { - this.$watch('annotationsRevision', () => { - this.refreshAllAnnotations(this.video.currentTime); - }); + this.$watch('annotationsRevision', this.refreshAllAnnotations); + this.videoSource.on('change', this.refreshAllAnnotations); }); }, }; diff --git a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue index 0d5777a68..33a0ca56d 100644 --- a/resources/assets/js/videos/components/videoScreen/videoPlayback.vue +++ b/resources/assets/js/videos/components/videoScreen/videoPlayback.vue @@ -15,10 +15,7 @@ export default { return { playing: false, animationFrameId: null, - // Refresh the annotations only every x ms. - refreshRate: 30, renderCurrentTime: -1, - refreshLastTime: Date.now(), extent: [0, 0, 0, 0], // Allow a maximum of 100x magnification. More cannot be represented in the // URL parameters. @@ -78,12 +75,6 @@ export default { this.renderCurrentTime = this.video.currentTime; this.videoContext.drawImage(this.video, 0, 0, this.videoCanvas.width, this.videoCanvas.height); this.videoSource.changed(); - - let now = Date.now(); - if (force || (now - this.refreshLastTime) >= this.refreshRate) { - this.$emit('refresh', this.video.currentTime); - this.refreshLastTime = now; - } } }, startRenderLoop() { From 01b4b83c1b334545379623bd6b0fefc31f5c2858 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Mon, 8 Jul 2024 16:07:04 +0200 Subject: [PATCH 21/27] Make annotation selection more efficient The old code removed and added all annotations again at all times. A change is only required if annotations are de-/selected in the sidebar. --- .../components/annotationCanvas.vue | 30 +++++++++++++-- .../js/videos/components/videoScreen.vue | 38 +++++++++++++++---- 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/resources/assets/js/annotations/components/annotationCanvas.vue b/resources/assets/js/annotations/components/annotationCanvas.vue index f0ccc912a..3fbae40d4 100644 --- a/resources/assets/js/annotations/components/annotationCanvas.vue +++ b/resources/assets/js/annotations/components/annotationCanvas.vue @@ -707,12 +707,34 @@ export default { this.resetHoveredAnnotations(); }, selectedAnnotations(annotations) { - let source = this.annotationSource; + // This allows selection of annotations outside OpenLayers and forwards + // the state to the SelectInteraction. let features = this.selectedFeatures; - features.clear(); - annotations.forEach(function (annotation) { - features.push(source.getFeatureById(annotation.id)); + let featureIdMap = {}; + let annotationIdMap = {}; + annotations.forEach(a => annotationIdMap[a.id] = true); + let toRemove = []; + + features.forEach(f => { + const id = f.getId(); + if (annotationIdMap[id]) { + featureIdMap[id] = true; + } else { + toRemove.push(f); + } }); + + if (toRemove.length === features.getLength()) { + features.clear(); + } else { + toRemove.forEach(f => features.remove(f)); + } + + annotations + .filter(a => !featureIdMap[a.id]) + .forEach( + a => features.push(this.annotationSource.getFeatureById(a.id)) + ); }, extent(extent, oldExtent) { // The extent only truly changes if the width and height changed. diff --git a/resources/assets/js/videos/components/videoScreen.vue b/resources/assets/js/videos/components/videoScreen.vue index 4aa849285..c19ac4069 100644 --- a/resources/assets/js/videos/components/videoScreen.vue +++ b/resources/assets/js/videos/components/videoScreen.vue @@ -575,18 +575,40 @@ export default { }, watch: { selectedAnnotations(annotations) { + // This allows selection of annotations outside OpenLayers and forwards + // the state to the SelectInteraction. let source = this.annotationSource; let features = this.selectedFeatures; - if (source && features) { - let feature; + if (!source || !features) { + return; + } + + let featureIdMap = {}; + let annotationIdMap = {}; + annotations.forEach(a => annotationIdMap[a.id] = true); + let toRemove = []; + + features.forEach(f => { + const id = f.getId(); + if (annotationIdMap[id]) { + featureIdMap[id] = true; + } else { + toRemove.push(f); + } + }); + + if (toRemove.length === features.getLength()) { features.clear(); - annotations.forEach(function (annotation) { - feature = source.getFeatureById(annotation.id); - if (feature) { - features.push(feature); - } - }); + } else { + toRemove.forEach(f => features.remove(f)); } + + annotations + .filter(a => !featureIdMap[a.id]) + .map(a => source.getFeatureById(a.id)) + // Ignore a==null because the selected annotation may not exist in the + // current video frame. + .forEach(a => a && features.push(a)); }, isDefaultInteractionMode(isDefault) { this.selectInteraction.setActive(isDefault); From ed1707117c89e8f133cbe3f645dd931bd2cc0357 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 10 Jul 2024 15:43:40 +0200 Subject: [PATCH 22/27] Enable Ellipse and Rectangle tools again with @biigle/ol:9.2.4 --- package-lock.json | 59 ++++++++--------- package.json | 2 +- .../components/annotationCanvas.vue | 64 +++++++++---------- .../annotationCanvas/drawInteractions.vue | 4 +- .../annotationCanvas/measureInteraction.vue | 6 +- .../polygonBrushInteraction.vue | 4 +- .../components/annotationCanvas/sampling.vue | 14 ++-- .../annotations/components/measureTooltip.vue | 6 +- .../js/annotations/components/minimap.vue | 20 +++--- resources/assets/js/annotations/main.js | 2 +- .../annotations/mixins/annotationTooltip.vue | 2 +- .../annotations/ol/AttachLabelInteraction.js | 2 +- .../js/annotations/ol/MagicWandInteraction.js | 22 +++---- .../js/annotations/ol/PolygonValidator.js | 16 ++--- .../js/annotations/ol/TranslateInteraction.js | 2 +- .../js/annotations/ol/ZoomToNativeControl.js | 2 +- .../js/annotations/ol/geom/flat/difference.js | 2 +- .../ol/interaction/ModifyPolygonBrush.js | 22 +++---- .../ol/interaction/PolygonBrush.js | 22 +++---- .../assets/js/annotations/ol/source/Canvas.js | 10 +-- .../assets/js/annotations/snapInteraction.vue | 8 +-- .../assets/js/annotations/stores/styles.js | 14 ++-- .../js/videos/components/videoScreen.vue | 18 +++--- .../videoScreen/annotationPlayback.vue | 22 +++---- .../videoScreen/drawInteractions.vue | 6 +- .../videoScreen/modifyInteractions.vue | 6 +- .../videoScreen/polygonBrushInteractions.vue | 12 ++-- .../components/videoScreen/videoPlayback.vue | 6 +- 28 files changed, 186 insertions(+), 189 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2ff933c8..7ecb7ab2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "license": "GPL-3.0-only", "dependencies": { + "@biigle/ol": "^9.2.4", "@fortawesome/fontawesome-free": "^5.2.0", "@turf/boolean-contains": "^6.5.0", "@turf/difference": "^6.5.0", @@ -15,7 +16,6 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^9.2.4", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", @@ -2101,6 +2101,20 @@ "node": ">=6.9.0" } }, + "node_modules/@biigle/ol": { + "version": "9.2.4", + "resolved": "https://npm.pkg.github.com/download/@biigle/ol/9.2.4/1c025faf01d9f35d5cc036d4c6bc48538a3ba7d1", + "integrity": "sha512-scfuI2HDw6p666koJv7vGSzihCWZY+Ld6zGsLKTBddMufIeKE6XbUrQXxLWmPWiNYUQ11OJoVUo3NIXsQnxo0w==", + "license": "BSD-2-Clause", + "dependencies": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -7723,23 +7737,6 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "node_modules/ol": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/ol/-/ol-9.2.4.tgz", - "integrity": "sha512-bsbu4ObaAlbELMIZWnYEvX4Z9jO+OyCBshtODhDKmqYTPEfnKOX3RieCr97tpJkqWTZvyV4tS9UQDvHoCdxS+A==", - "dependencies": { - "color-rgba": "^3.0.0", - "color-space": "^2.0.1", - "earcut": "^2.2.3", - "geotiff": "^2.0.7", - "pbf": "3.2.1", - "rbush": "^3.0.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/openlayers" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -12787,6 +12784,19 @@ "to-fast-properties": "^2.0.0" } }, + "@biigle/ol": { + "version": "9.2.4", + "resolved": "https://npm.pkg.github.com/download/@biigle/ol/9.2.4/1c025faf01d9f35d5cc036d4c6bc48538a3ba7d1", + "integrity": "sha512-scfuI2HDw6p666koJv7vGSzihCWZY+Ld6zGsLKTBddMufIeKE6XbUrQXxLWmPWiNYUQ11OJoVUo3NIXsQnxo0w==", + "requires": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + } + }, "@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -17202,19 +17212,6 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "ol": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/ol/-/ol-9.2.4.tgz", - "integrity": "sha512-bsbu4ObaAlbELMIZWnYEvX4Z9jO+OyCBshtODhDKmqYTPEfnKOX3RieCr97tpJkqWTZvyV4tS9UQDvHoCdxS+A==", - "requires": { - "color-rgba": "^3.0.0", - "color-space": "^2.0.1", - "earcut": "^2.2.3", - "geotiff": "^2.0.7", - "pbf": "3.2.1", - "rbush": "^3.0.1" - } - }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", diff --git a/package.json b/package.json index 92fa9fae0..88408ea23 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "vue-template-compiler": "^2.6.11" }, "dependencies": { + "@biigle/ol": "^9.2.4", "@fortawesome/fontawesome-free": "^5.2.0", "@turf/boolean-contains": "^6.5.0", "@turf/difference": "^6.5.0", @@ -32,7 +33,6 @@ "echarts": "^5.3.2", "jsts": "^2.11.0", "magic-wand-tool": "^1.1.4", - "ol": "^9.2.4", "polymorph-js": "^0.2.4", "uiv": "^1.2.4", "vue": "^2.0.5", diff --git a/resources/assets/js/annotations/components/annotationCanvas.vue b/resources/assets/js/annotations/components/annotationCanvas.vue index 3fbae40d4..4484b7d98 100644 --- a/resources/assets/js/annotations/components/annotationCanvas.vue +++ b/resources/assets/js/annotations/components/annotationCanvas.vue @@ -3,49 +3,49 @@ import * as PolygonValidator from '../ol/PolygonValidator'; import AnnotationTooltip from './annotationCanvas/annotationTooltip'; import AttachLabelInteraction from './annotationCanvas/attachLabelInteraction'; import CanvasSource from '../ol/source/Canvas'; -import Circle from 'ol/geom/Circle'; -import Collection from 'ol/Collection'; +import Circle from '@biigle/ol/geom/Circle'; +import Collection from '@biigle/ol/Collection'; import ControlButton from './controlButton'; import DrawInteractions from './annotationCanvas/drawInteractions'; -// import Ellipse from 'ol/geom/Ellipse'; +import Ellipse from '@biigle/ol/geom/Ellipse'; import Events from '../../core/events'; -import Feature from 'ol/Feature'; -import ImageLayer from 'ol/layer/Image'; +import Feature from '@biigle/ol/Feature'; +import ImageLayer from '@biigle/ol/layer/Image'; import Keyboard from '../../core/keyboard'; import LabelIndicator from './labelIndicator'; import Lawnmower from './annotationCanvas/lawnmower'; -import LineString from 'ol/geom/LineString'; +import LineString from '@biigle/ol/geom/LineString'; import MagicWandInteraction from './annotationCanvas/magicWandInteraction'; -import Map from 'ol/Map'; +import Map from '@biigle/ol/Map'; import MeasureInteraction from './annotationCanvas/measureInteraction'; import Minimap from './minimap'; -import ModifyInteraction from 'ol/interaction/Modify'; +import ModifyInteraction from '@biigle/ol/interaction/Modify'; import MousePosition from './annotationCanvas/mousePosition'; -import MouseWheelZoom from 'ol/interaction/MouseWheelZoom'; -import Point from 'ol/geom/Point'; -import Polygon from 'ol/geom/Polygon'; +import MouseWheelZoom from '@biigle/ol/interaction/MouseWheelZoom'; +import Point from '@biigle/ol/geom/Point'; +import Polygon from '@biigle/ol/geom/Polygon'; import PolygonBrushInteraction from './annotationCanvas/polygonBrushInteraction'; -import Projection from 'ol/proj/Projection'; -// import Rectangle from 'ol/geom/Rectangle'; +import Projection from '@biigle/ol/proj/Projection'; +import Rectangle from '@biigle/ol/geom/Rectangle'; import Sampling from './annotationCanvas/sampling'; import ScaleLine from './annotationCanvas/scaleLine'; -import SelectInteraction from 'ol/interaction/Select'; +import SelectInteraction from '@biigle/ol/interaction/Select'; import Styles from '../stores/styles'; -import TileLayer from 'ol/layer/Tile'; +import TileLayer from '@biigle/ol/layer/Tile'; import TranslateInteraction from './annotationCanvas/translateInteraction'; -import VectorLayer from 'ol/layer/Vector'; -import VectorSource from 'ol/source/Vector'; -import View from 'ol/View'; -import ZoomControl from 'ol/control/Zoom'; -import ZoomifySource from 'ol/source/Zoomify'; +import VectorLayer from '@biigle/ol/layer/Vector'; +import VectorSource from '@biigle/ol/source/Vector'; +import View from '@biigle/ol/View'; +import ZoomControl from '@biigle/ol/control/Zoom'; +import ZoomifySource from '@biigle/ol/source/Zoomify'; import ZoomLevel from './annotationCanvas/zoomLevel'; -import ZoomToExtentControl from 'ol/control/ZoomToExtent'; +import ZoomToExtentControl from '@biigle/ol/control/ZoomToExtent'; import ZoomToNativeControl from '../ol/ZoomToNativeControl'; -import {click as clickCondition} from 'ol/events/condition'; -import {defaults as defaultInteractions} from 'ol/interaction' -import {getCenter} from 'ol/extent'; -import {shiftKeyOnly as shiftKeyOnlyCondition} from 'ol/events/condition'; -import {singleClick as singleClickCondition} from 'ol/events/condition'; +import {click as clickCondition} from '@biigle/ol/events/condition'; +import {defaults as defaultInteractions} from '@biigle/ol/interaction' +import {getCenter} from '@biigle/ol/extent'; +import {shiftKeyOnly as shiftKeyOnlyCondition} from '@biigle/ol/events/condition'; +import {singleClick as singleClickCondition} from '@biigle/ol/events/condition'; import { isInvalidShape } from '../utils'; /** @@ -368,8 +368,8 @@ export default { switch (annotation.shape) { case 'Point': return new Point(points[0]); - // case 'Rectangle': - // return new Rectangle([points]); + case 'Rectangle': + return new Rectangle([points]); case 'Polygon': return new Polygon([points]); case 'LineString': @@ -377,8 +377,8 @@ export default { case 'Circle': // radius is the x value of the second point of the circle return new Circle(points[0], points[1][0]); - // case 'Ellipse': - // return new Ellipse([points]); + case 'Ellipse': + return new Ellipse([points]); default: // unsupported shapes are ignored console.error('Unknown annotation shape: ' + annotation.shape); @@ -499,8 +499,8 @@ export default { points = [geometry.getCenter(), [geometry.getRadius()]]; break; case 'Polygon': - // case 'Rectangle': - // case 'Ellipse': + case 'Rectangle': + case 'Ellipse': points = geometry.getCoordinates()[0]; break; case 'Point': diff --git a/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue b/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue index c51d5a22c..a0c94fb5f 100644 --- a/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue +++ b/resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue @@ -1,8 +1,8 @@