diff --git a/angular.json b/angular.json index eec9cd68..846289d8 100644 --- a/angular.json +++ b/angular.json @@ -28,7 +28,7 @@ ], "styles": [ "src/styles.css", - "node_modules/mapbox-gl/dist/mapbox-gl.css", + "node_modules/maplibre-gl/dist/maplibre-gl.css", "node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css", "node_modules/iv-viewer/dist/iv-viewer.css" ] @@ -93,7 +93,7 @@ "scripts": [], "styles": [ "src/styles.css", - "node_modules/mapbox-gl/dist/mapbox-gl.css", + "node_modules/maplibre-gl/dist/maplibre-gl.css", "node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css", "node_modules/iv-viewer/dist/iv-viewer.css" ], @@ -156,7 +156,7 @@ "karmaConfig": "projects/arlas-components/karma.conf.js", "styles": [ "src/styles.css", - "node_modules/mapbox-gl/dist/mapbox-gl.css", + "node_modules/maplibre-gl/dist/maplibre-gl.css", "node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css", "node_modules/iv-viewer/dist/iv-viewer.css" ] diff --git a/package-lock.json b/package-lock.json index a4223035..8a6ab88d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,6 @@ "@turf/centroid": "6.5.0", "@turf/helpers": "6.5.0", "@turf/length": "^6.5.0", - "@types/mapbox-gl": "^1.6.3", "@types/tinycolor2": "^1.4.0", "arlas-d3": "~11.1.0", "core-js": "~3.26.1", @@ -38,7 +37,7 @@ "iv-viewer": "~2.0.1", "jsts": "2.1.0", "jszip": "^3.2.1", - "mapbox-gl": "^1.6.1", + "maplibre-gl": "^3.4.0", "moment": "^2.29.4", "ng-lazyload-image": "^9.0.0", "ngeohash": "^0.6.0", @@ -3668,10 +3667,6 @@ "geojson-rewind": "geojson-rewind" } }, - "node_modules/@mapbox/geojson-types": { - "version": "1.0.2", - "license": "ISC" - }, "node_modules/@mapbox/jsonlint-lines-primitives": { "version": "2.0.2", "engines": { @@ -3695,25 +3690,10 @@ "version": "1.0.1", "license": "ISC" }, - "node_modules/@mapbox/mapbox-gl-supported": { - "version": "1.5.0", - "license": "BSD-3-Clause", - "peerDependencies": { - "mapbox-gl": ">=0.32.1 <2.0.0" - } - }, "node_modules/@mapbox/point-geometry": { "version": "0.1.0", "license": "ISC" }, - "node_modules/@mapbox/tiny-sdf": { - "version": "1.2.5", - "license": "BSD-2-Clause" - }, - "node_modules/@mapbox/unitbezier": { - "version": "0.0.0", - "license": "BSD-2-Clause" - }, "node_modules/@mapbox/vector-tile": { "version": "1.3.1", "license": "BSD-3-Clause", @@ -3728,6 +3708,34 @@ "node": ">=6.0.0" } }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.3.2", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz", + "integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" + }, + "node_modules/@maplibre/maplibre-gl-style-spec/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/@ngtools/webpack": { "version": "14.2.11", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.2.11.tgz", @@ -4293,8 +4301,9 @@ } }, "node_modules/@types/geojson": { - "version": "7946.0.10", - "license": "MIT" + "version": "7946.0.11", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==" }, "node_modules/@types/http-proxy": { "version": "1.17.10", @@ -4315,11 +4324,19 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/mapbox-gl": { - "version": "1.13.4", - "license": "MIT", + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz", + "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA==" + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz", + "integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==", "dependencies": { - "@types/geojson": "*" + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" } }, "node_modules/@types/mime": { @@ -4340,6 +4357,11 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/pbf": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz", + "integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ==" + }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -4399,6 +4421,14 @@ "@types/node": "*" } }, + "node_modules/@types/supercluster": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.1.tgz", + "integrity": "sha512-dNK02GO1UApgo+1KpY4jOfm3uWb2eBCMB/VMM2y8cMoF49FiqVVcOawEg19wxYcaX7SvEs370incOuFtFGrVLg==", + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/tinycolor2": { "version": "1.4.3", "license": "MIT" @@ -5349,6 +5379,14 @@ "tinycolor2": "~1.4.1" } }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", @@ -5363,6 +5401,14 @@ "node": ">=8" } }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -5854,6 +5900,23 @@ "node": ">= 0.8" } }, + "node_modules/bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "dependencies": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "node_modules/bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "dependencies": { + "typewise-core": "^1.2" + } + }, "node_modules/cacache": { "version": "16.1.2", "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.2.tgz", @@ -6767,10 +6830,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/csscolorparser": { - "version": "1.0.3", - "license": "MIT" - }, "node_modules/cssdb": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.5.4.tgz", @@ -8405,6 +8464,17 @@ "dev": true, "license": "MIT" }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -8848,6 +8918,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/gettext-parser": { "version": "4.2.0", "dev": true, @@ -8898,6 +8976,35 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/globals": { "version": "11.12.0", "dev": true, @@ -8954,10 +9061,6 @@ "dev": true, "license": "MIT" }, - "node_modules/grid-index": { - "version": "1.1.0", - "license": "ISC" - }, "node_modules/gzip-size": { "version": "6.0.0", "dev": true, @@ -9780,6 +9883,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "dev": true, @@ -9879,7 +9990,6 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", - "dev": true, "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -10055,7 +10165,6 @@ }, "node_modules/isobject": { "version": "3.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10258,6 +10367,11 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stringify-pretty-compact": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + }, "node_modules/json5": { "version": "2.2.3", "dev": true, @@ -10669,13 +10783,8 @@ "node": ">=10" } }, - "node_modules/kdbush": { - "version": "3.0.0", - "license": "ISC" - }, "node_modules/kind-of": { "version": "6.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11062,40 +11171,72 @@ "node": ">=12" } }, - "node_modules/mapbox-gl": { - "version": "1.13.3", - "license": "SEE LICENSE IN LICENSE.txt", + "node_modules/maplibre-gl": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.4.0.tgz", + "integrity": "sha512-5Q36HD2mJoPcd85O2wIDq2t6kl9KMBpITO12A9wPKpQ6ieYKKf5Dp4U/XNjmZWtSTIX2hnx+OwlInkAVLdav6Q==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", - "@mapbox/geojson-types": "^1.0.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^1.5.0", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^1.1.1", - "@mapbox/unitbezier": "^0.0.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.2", + "@maplibre/maplibre-gl-style-spec": "^19.3.2", + "@types/geojson": "^7946.0.11", + "@types/mapbox__point-geometry": "^0.1.2", + "@types/mapbox__vector-tile": "^1.3.1", + "@types/pbf": "^3.0.3", + "@types/supercluster": "^7.1.1", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", - "gl-matrix": "^3.2.1", - "grid-index": "^1.1.0", + "gl-matrix": "^3.4.3", + "global-prefix": "^3.0.0", + "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", - "potpack": "^1.0.1", + "potpack": "^2.0.0", "quickselect": "^2.0.0", - "rw": "^1.3.3", - "supercluster": "^7.1.0", + "supercluster": "^8.0.1", "tinyqueue": "^2.0.3", - "vt-pbf": "^3.1.1" + "vt-pbf": "^3.1.3" }, "engines": { - "node": ">=6.4.0" + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, - "node_modules/mapbox-gl/node_modules/rw": { - "version": "1.3.3", - "license": "BSD-3-Clause" + "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", + "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==" + }, + "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" + }, + "node_modules/maplibre-gl/node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==" + }, + "node_modules/maplibre-gl/node_modules/potpack": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", + "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==" + }, + "node_modules/maplibre-gl/node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "dependencies": { + "kdbush": "^4.0.2" + } }, "node_modules/media-typer": { "version": "0.3.0", @@ -13418,10 +13559,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/potpack": { - "version": "1.0.2", - "license": "ISC" - }, "node_modules/prelude-ls": { "version": "1.2.1", "dev": true, @@ -14407,6 +14544,20 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "license": "MIT" @@ -14587,6 +14738,38 @@ "node": ">= 10" } }, + "node_modules/sort-asc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-desc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-object": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "dependencies": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -14720,6 +14903,40 @@ "wbuf": "^1.7.3" } }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "dev": true, @@ -14930,13 +15147,6 @@ "webpack": "^5.0.0" } }, - "node_modules/supercluster": { - "version": "7.1.5", - "license": "ISC", - "dependencies": { - "kdbush": "^3.0.0" - } - }, "node_modules/supports-color": { "version": "5.5.0", "dev": true, @@ -15541,6 +15751,19 @@ "node": ">=4.2.0" } }, + "node_modules/typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "dependencies": { + "typewise-core": "^1.2.0" + } + }, + "node_modules/typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" + }, "node_modules/ua-parser-js": { "version": "0.7.33", "dev": true, @@ -15599,6 +15822,20 @@ "node": ">=4" } }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -18897,9 +19134,6 @@ "minimist": "^1.2.6" } }, - "@mapbox/geojson-types": { - "version": "1.0.2" - }, "@mapbox/jsonlint-lines-primitives": { "version": "2.0.2" }, @@ -18918,19 +19152,9 @@ "@mapbox/mapbox-gl-draw-static-mode": { "version": "1.0.1" }, - "@mapbox/mapbox-gl-supported": { - "version": "1.5.0", - "requires": {} - }, "@mapbox/point-geometry": { "version": "0.1.0" }, - "@mapbox/tiny-sdf": { - "version": "1.2.5" - }, - "@mapbox/unitbezier": { - "version": "0.0.0" - }, "@mapbox/vector-tile": { "version": "1.3.1", "requires": { @@ -18940,6 +19164,31 @@ "@mapbox/whoots-js": { "version": "3.1.0" }, + "@maplibre/maplibre-gl-style-spec": { + "version": "19.3.2", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz", + "integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==", + "requires": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "dependencies": { + "@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" + }, + "rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + } + } + }, "@ngtools/webpack": { "version": "14.2.11", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.2.11.tgz", @@ -19365,7 +19614,9 @@ } }, "@types/geojson": { - "version": "7946.0.10" + "version": "7946.0.11", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==" }, "@types/http-proxy": { "version": "1.17.10", @@ -19384,10 +19635,19 @@ "version": "7.0.11", "dev": true }, - "@types/mapbox-gl": { - "version": "1.13.4", + "@types/mapbox__point-geometry": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz", + "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA==" + }, + "@types/mapbox__vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz", + "integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==", "requires": { - "@types/geojson": "*" + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" } }, "@types/mime": { @@ -19408,6 +19668,11 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/pbf": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz", + "integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ==" + }, "@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -19465,6 +19730,14 @@ "@types/node": "*" } }, + "@types/supercluster": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.1.tgz", + "integrity": "sha512-dNK02GO1UApgo+1KpY4jOfm3uWb2eBCMB/VMM2y8cMoF49FiqVVcOawEg19wxYcaX7SvEs370incOuFtFGrVLg==", + "requires": { + "@types/geojson": "*" + } + }, "@types/tinycolor2": { "version": "1.4.3" }, @@ -20125,6 +20398,11 @@ "tinycolor2": "~1.4.1" } }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==" + }, "array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", @@ -20135,6 +20413,11 @@ "version": "2.1.0", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==" + }, "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -20440,6 +20723,23 @@ "version": "3.1.2", "dev": true }, + "bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "requires": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "requires": { + "typewise-core": "^1.2" + } + }, "cacache": { "version": "16.1.2", "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.2.tgz", @@ -21062,9 +21362,6 @@ "version": "6.1.0", "dev": true }, - "csscolorparser": { - "version": "1.0.3" - }, "cssdb": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.5.4.tgz", @@ -22085,6 +22382,14 @@ "version": "3.0.2", "dev": true }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "requires": { + "is-extendable": "^0.1.0" + } + }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -22395,6 +22700,11 @@ "get-stream": { "version": "6.0.1" }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==" + }, "gettext-parser": { "version": "4.2.0", "dev": true, @@ -22432,6 +22742,31 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "globals": { "version": "11.12.0", "dev": true @@ -22470,9 +22805,6 @@ "version": "1.0.4", "dev": true }, - "grid-index": { - "version": "1.1.0" - }, "gzip-size": { "version": "6.0.0", "dev": true, @@ -23064,6 +23396,11 @@ "is-docker": { "version": "2.2.1" }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==" + }, "is-extglob": { "version": "2.1.1", "dev": true @@ -23123,7 +23460,6 @@ }, "is-plain-object": { "version": "2.0.4", - "dev": true, "requires": { "isobject": "^3.0.1" } @@ -23231,8 +23567,7 @@ "version": "2.0.0" }, "isobject": { - "version": "3.0.1", - "dev": true + "version": "3.0.1" }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -23371,6 +23706,11 @@ "version": "1.0.1", "dev": true }, + "json-stringify-pretty-compact": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + }, "json5": { "version": "2.2.3", "dev": true @@ -23663,12 +24003,8 @@ "source-map-support": "^0.5.5" } }, - "kdbush": { - "version": "3.0.0" - }, "kind-of": { - "version": "6.0.3", - "dev": true + "version": "6.0.3" }, "klaw-sync": { "version": "6.0.0", @@ -23926,35 +24262,65 @@ } } }, - "mapbox-gl": { - "version": "1.13.3", + "maplibre-gl": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.4.0.tgz", + "integrity": "sha512-5Q36HD2mJoPcd85O2wIDq2t6kl9KMBpITO12A9wPKpQ6ieYKKf5Dp4U/XNjmZWtSTIX2hnx+OwlInkAVLdav6Q==", "requires": { "@mapbox/geojson-rewind": "^0.5.2", - "@mapbox/geojson-types": "^1.0.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^1.5.0", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^1.1.1", - "@mapbox/unitbezier": "^0.0.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.2", + "@maplibre/maplibre-gl-style-spec": "^19.3.2", + "@types/geojson": "^7946.0.11", + "@types/mapbox__point-geometry": "^0.1.2", + "@types/mapbox__vector-tile": "^1.3.1", + "@types/pbf": "^3.0.3", + "@types/supercluster": "^7.1.1", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", - "gl-matrix": "^3.2.1", - "grid-index": "^1.1.0", + "gl-matrix": "^3.4.3", + "global-prefix": "^3.0.0", + "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", - "potpack": "^1.0.1", + "potpack": "^2.0.0", "quickselect": "^2.0.0", - "rw": "^1.3.3", - "supercluster": "^7.1.0", + "supercluster": "^8.0.1", "tinyqueue": "^2.0.3", - "vt-pbf": "^3.1.1" + "vt-pbf": "^3.1.3" }, "dependencies": { - "rw": { - "version": "1.3.3" + "@mapbox/tiny-sdf": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", + "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==" + }, + "@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" + }, + "kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==" + }, + "potpack": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", + "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==" + }, + "supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "requires": { + "kdbush": "^4.0.2" + } } } }, @@ -25497,9 +25863,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "potpack": { - "version": "1.0.2" - }, "prelude-ls": { "version": "1.2.1", "dev": true @@ -26183,6 +26546,17 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + } + }, "setimmediate": { "version": "1.0.5" }, @@ -26318,6 +26692,29 @@ "socks": "^2.6.2" } }, + "sort-asc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==" + }, + "sort-desc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==" + }, + "sort-object": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "requires": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + } + }, "source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -26426,6 +26823,33 @@ "wbuf": "^1.7.3" } }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "sprintf-js": { "version": "1.0.3", "dev": true @@ -26559,12 +26983,6 @@ "normalize-path": "^3.0.0" } }, - "supercluster": { - "version": "7.1.5", - "requires": { - "kdbush": "^3.0.0" - } - }, "supports-color": { "version": "5.5.0", "dev": true, @@ -26960,6 +27378,19 @@ "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "dev": true }, + "typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "requires": { + "typewise-core": "^1.2.0" + } + }, + "typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" + }, "ua-parser-js": { "version": "0.7.33", "dev": true @@ -26992,6 +27423,17 @@ "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/package.json b/package.json index f7e7b190..5399d995 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "@turf/centroid": "6.5.0", "@turf/helpers": "6.5.0", "@turf/length": "^6.5.0", - "@types/mapbox-gl": "^1.6.3", "@types/tinycolor2": "^1.4.0", "arlas-d3": "~11.1.0", "core-js": "~3.26.1", @@ -47,7 +46,7 @@ "iv-viewer": "~2.0.1", "jsts": "2.1.0", "jszip": "^3.2.1", - "mapbox-gl": "^1.6.1", + "maplibre-gl": "^3.4.0", "moment": "^2.29.4", "ng-lazyload-image": "^9.0.0", "ngeohash": "^0.6.0", diff --git a/projects/arlas-components/assets/styles.css b/projects/arlas-components/assets/styles.css index 97e4bcc9..2f5acff4 100644 --- a/projects/arlas-components/assets/styles.css +++ b/projects/arlas-components/assets/styles.css @@ -20,7 +20,7 @@ /* You can add global styles to this file, and also import other style files */ @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; -@import '../node_modules/mapbox-gl/dist/mapbox-gl.css'; +@import '../node_modules/maplibre-gl/dist/maplibre-gl.css'; body { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; diff --git a/projects/arlas-components/package.json b/projects/arlas-components/package.json index 7e468212..66cdd310 100644 --- a/projects/arlas-components/package.json +++ b/projects/arlas-components/package.json @@ -28,7 +28,6 @@ "@turf/bbox": "^6.5.0", "@turf/centroid": "6.5.0", "@turf/helpers": "6.5.0", - "@turf/length": "^6.5.0", "@types/mapbox-gl": "^1.6.3", "arlas-d3": "~11.1.0", "geojson-polygon-self-intersections": "1.2.1", @@ -36,7 +35,7 @@ "iv-viewer": "~2.0.1", "jsts": "2.1.0", "jszip": "^3.2.1", - "mapbox-gl": "^1.6.1", + "maplibre-gl": "^3.4.0", "ng-lazyload-image": "^9.0.0", "ngeohash": "^0.6.0", "ngx-loading": "^14.0.0", diff --git a/projects/arlas-components/src/lib/components/mapgl-import/mapgl-import.component.ts b/projects/arlas-components/src/lib/components/mapgl-import/mapgl-import.component.ts index cb113f0d..a13c47b3 100644 --- a/projects/arlas-components/src/lib/components/mapgl-import/mapgl-import.component.ts +++ b/projects/arlas-components/src/lib/components/mapgl-import/mapgl-import.component.ts @@ -11,6 +11,7 @@ import * as extent_ from 'turf-extent'; import { parse } from 'wellknown'; import { valid } from 'geojson-validation'; import * as gpsi_ from 'geojson-polygon-self-intersections'; +import { GeoJSONSource } from 'maplibre-gl'; const gpsi = gpsi_.default; const shp = shp_.default; const extent = extent_.default; @@ -575,7 +576,7 @@ export class MapglImportComponent { this.featureIndex = 0; this.mapComponent.onAoiChanged.next(this.emptyData); if (labelSource !== undefined) { - labelSource.setData(this.emptyData); + (labelSource as GeoJSONSource).setData(this.emptyData as any); } } diff --git a/projects/arlas-components/src/lib/components/mapgl-layer-icon/mapgl-layer-icon.component.ts b/projects/arlas-components/src/lib/components/mapgl-layer-icon/mapgl-layer-icon.component.ts index ce7fa9b7..d307c397 100644 --- a/projects/arlas-components/src/lib/components/mapgl-layer-icon/mapgl-layer-icon.component.ts +++ b/projects/arlas-components/src/lib/components/mapgl-layer-icon/mapgl-layer-icon.component.ts @@ -1,6 +1,8 @@ import { Component, OnInit, ViewChild, ElementRef, Input, AfterViewInit, SimpleChanges, OnChanges } from '@angular/core'; import { select } from 'd3-selection'; import { Legend, PROPERTY_SELECTOR_SOURCE } from '../mapgl/mapgl.component.util'; +import { Layer } from '../mapgl/model/mapLayers'; +import { SymbolLayerSpecification } from 'maplibre-gl'; @Component({ selector: 'arlas-mapgl-layer-icon', @@ -8,7 +10,7 @@ import { Legend, PROPERTY_SELECTOR_SOURCE } from '../mapgl/mapgl.component.util' styleUrls: ['./mapgl-layer-icon.component.css'] }) export class MapglLayerIconComponent implements OnInit, AfterViewInit, OnChanges { - @Input() public layer: mapboxgl.Layer; + @Input() public layer: maplibregl.LayerSpecification; @Input() public colorLegend: Legend = {}; @Input() public strokeColorLegend: Legend = {}; @Input() public widthLegend: Legend = {}; @@ -38,10 +40,10 @@ export class MapglLayerIconComponent implements OnInit, AfterViewInit, OnChanges private drawIcons(): void { const type = this.layer.type; const paint = this.layer.paint; - const source: string = this.layer.source as string; + const source: string = (this.layer as Layer).source as string; switch (type) { case 'circle': { - const p: mapboxgl.CirclePaint = (paint as mapboxgl.CirclePaint); + const p: maplibregl.CirclePaintProps = (paint as maplibregl.CirclePaintProps); if (source.startsWith('feature-metric')) { drawFeatureCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, true); } else if (source.startsWith('feature')) { @@ -74,7 +76,7 @@ export class MapglLayerIconComponent implements OnInit, AfterViewInit, OnChanges break; } case 'symbol': { - const l: mapboxgl.SymbolLayout = (this.layer.layout as mapboxgl.SymbolLayout); + const l: maplibregl.SymbolLayoutProps = ((this.layer as any).layout as maplibregl.SymbolLayoutProps); if (l['text-field']) { drawTextIcon(this.layerIconElement.nativeElement, this.colorLegend); } diff --git a/projects/arlas-components/src/lib/components/mapgl-legend/mapgl-legend.component.ts b/projects/arlas-components/src/lib/components/mapgl-legend/mapgl-legend.component.ts index 12a24ad4..e07e538c 100644 --- a/projects/arlas-components/src/lib/components/mapgl-legend/mapgl-legend.component.ts +++ b/projects/arlas-components/src/lib/components/mapgl-legend/mapgl-legend.component.ts @@ -24,12 +24,11 @@ import { curveLinear, area, line } from 'd3-shape'; import { scaleLinear, ScaleLinear } from 'd3-scale'; import { select } from 'd3-selection'; import { HistogramData } from 'arlas-d3/histograms/utils/HistogramUtils'; -import { StyleFunction, Expression } from 'mapbox-gl'; import * as tinycolor from 'tinycolor2'; import { ArlasColorService } from '../../services/color.generator.service'; -import { ARLAS_ID, FILLSTROKE_LAYER_PREFIX, HOVER_LAYER_PREFIX, SELECT_LAYER_PREFIX } from '../mapgl/model/mapLayers'; +import { ARLAS_ID, FILLSTROKE_LAYER_PREFIX, HOVER_LAYER_PREFIX, LayerMetadata, SELECT_LAYER_PREFIX } from '../mapgl/model/mapLayers'; import { Legend, LegendData, PROPERTY_SELECTOR_SOURCE } from '../mapgl/mapgl.component.util'; -import * as mapboxgl from 'mapbox-gl'; +import * as maplibregl from 'maplibre-gl'; export const GET = 'get'; export const MATCH = 'match'; @@ -51,7 +50,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { * @Input : Angular * @description Layer object */ - @Input() public layer: mapboxgl.Layer; + @Input() public layer: maplibregl.LayerSpecification; /** * @Input : Angular * @description Collection of the layer @@ -86,7 +85,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { */ @Output() public visibilityStatus: Subject = new Subject(); - @Output() public downloadSourceEmitter: Subject<{layer: mapboxgl.Layer; downloadType: string;}> = new Subject(); + @Output() public downloadSourceEmitter: Subject<{layer: maplibregl.LayerSpecification; downloadType: string;}> = new Subject(); @ViewChild('width_svg', { read: ElementRef, static: false }) public lineWidthLegendElement: ElementRef; @ViewChild('radius_svg', { read: ElementRef, static: false }) public circleRadiusLegendElement: ElementRef; @@ -139,7 +138,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { !this.layer.id.startsWith(FILLSTROKE_LAYER_PREFIX) && !this.layer.id.startsWith(HOVER_LAYER_PREFIX) && !this.layer.id.startsWith(SELECT_LAYER_PREFIX)) { this.visibleMode = this.enabled; - if (!!this.layer.metadata && this.layer.metadata.showLegend === false) { + if (!!this.layer.metadata && (this.layer.metadata as any).showLegend === false) { this.visibleMode = false; } } @@ -164,7 +163,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { } } - public downloadLayerSource(layer: mapboxgl.Layer, downloadType: string): void { + public downloadLayerSource(layer: maplibregl.LayerSpecification, downloadType: string): void { const download = { layer, downloadType @@ -185,11 +184,12 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { private drawLegends(visibileMode: boolean): void { const type = this.layer.type; const paint = this.layer.paint; - const metadata = this.layer.metadata; + const metadata = this.layer.metadata as any; switch (type) { case 'circle': { - const p: mapboxgl.CirclePaint = (paint as mapboxgl.CirclePaint); - const colors = MapglLegendComponent.buildColorLegend(p['circle-color'], visibileMode, this.legendData, this.layer.filter, this.translate); + const p: maplibregl.CirclePaintProps = (paint as maplibregl.CirclePaintProps); + const colors = MapglLegendComponent.buildColorLegend(p['circle-color'], visibileMode, this.legendData, + (this.layer as maplibregl.CircleLayerSpecification).filter, this.translate); const strokeColors = MapglLegendComponent.buildColorLegend(p['circle-stroke-color'], visibileMode, this.legendData, this.layer.filter, this.translate); this.buildCircleRadiusLegend(p['circle-radius']); @@ -200,7 +200,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { break; } case 'line': { - const p: mapboxgl.LinePaint = (paint as mapboxgl.LinePaint); + const p: maplibregl.LinePaintProps = (paint as maplibregl.LinePaintProps); const colors = MapglLegendComponent.buildColorLegend(p['line-color'], visibileMode, this.legendData, this.layer.filter, this.translate); this.buildWidthLegend(p['line-width']); this.lineDasharray = p['line-dasharray']; @@ -209,7 +209,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { break; } case 'fill': { - const p: mapboxgl.FillPaint = (paint as mapboxgl.FillPaint); + const p: maplibregl.FillPaintProps = (paint as maplibregl.FillPaintProps); const colors = MapglLegendComponent.buildColorLegend(p['fill-color'], visibileMode, this.legendData, this.layer.filter, this.translate); this.colorLegend = colors[0]; this.colorsPalette = colors[1]; @@ -222,8 +222,9 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { break; } case 'heatmap': { - const p: mapboxgl.HeatmapPaint = (paint as mapboxgl.HeatmapPaint); - const colors = MapglLegendComponent.buildColorLegend(p['heatmap-color'], visibileMode, this.legendData, this.layer.filter, this.translate); + const p: maplibregl.HeatmapPaintProps = (paint as maplibregl.HeatmapPaintProps); + const colors = MapglLegendComponent.buildColorLegend(p['heatmap-color'] as any + , visibileMode, this.legendData, this.layer.filter, this.translate); this.buildCircleRadiusLegend(p['heatmap-radius']); this.colorLegend = colors[0]; this.colorsPalette = colors[1]; @@ -233,11 +234,11 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { break; } case 'symbol': { - const p: mapboxgl.SymbolPaint = (paint as mapboxgl.SymbolPaint); + const p: maplibregl.SymbolPaintProps = (paint as maplibregl.SymbolPaintProps); const colors = MapglLegendComponent.buildColorLegend(p['text-color'], visibileMode, this.legendData, this.layer.filter, this.translate); this.colorLegend = colors[0]; this.colorsPalette = colors[1]; - const l: mapboxgl.SymbolLayout = (paint as mapboxgl.SymbolLayout); + const l: maplibregl.SymbolLayoutProps = (paint as maplibregl.SymbolLayoutProps); this.buildWidthLegend(l['text-size']); break; } @@ -279,8 +280,8 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { }); } - public static buildColorLegend(colorExpression: string | StyleFunction | Expression, visibleMode: boolean, - legendData: Map, filter?: any[] , translate?: TranslateService): [Legend, string] { + public static buildColorLegend(colorExpression: maplibregl.DataDrivenProperty, visibleMode: boolean, + legendData: Map, filter?: any , translate?: TranslateService): [Legend, string] { const colorLegend: Legend = { visible: true }; let colorsPalette = ''; if (typeof colorExpression === 'string') { @@ -413,7 +414,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { return [colorLegend, colorsPalette]; } - private buildWidthLegend(lineWidth: number | StyleFunction | Expression): void { + private buildWidthLegend(lineWidth: any): void { /** if the line width is fix then it is not added to the legend*/ if (Array.isArray(lineWidth)) { if (lineWidth.length >= 3) { @@ -445,7 +446,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { } } - private buildCircleRadiusLegend(circleRadius: number | StyleFunction | Expression): void { + private buildCircleRadiusLegend(circleRadius: any): void { if (Array.isArray(circleRadius)) { if (circleRadius.length >= 3) { if (circleRadius[0] === INTERPOLATE) { @@ -479,7 +480,7 @@ export class MapglLegendComponent implements OnInit, AfterViewInit, OnChanges { } } - private buildCircleStrokeLegend(circleStroke: number | StyleFunction | Expression): void { + private buildCircleStrokeLegend(circleStroke: any): void { if (Array.isArray(circleStroke)) { if (circleStroke.length >= 3) { if (circleStroke[0] === INTERPOLATE) { diff --git a/projects/arlas-components/src/lib/components/mapgl/draw/draw.models.ts b/projects/arlas-components/src/lib/components/mapgl/draw/draw.models.ts index e9f1a750..76e9eb14 100644 --- a/projects/arlas-components/src/lib/components/mapgl/draw/draw.models.ts +++ b/projects/arlas-components/src/lib/components/mapgl/draw/draw.models.ts @@ -17,6 +17,9 @@ * under the License. */ +import * as maplibregl from 'maplibre-gl'; + + export interface AoiDimensions { area: number; areaMessage?: string; diff --git a/projects/arlas-components/src/lib/components/mapgl/draw/draw.service.ts b/projects/arlas-components/src/lib/components/mapgl/draw/draw.service.ts index bf9b5a39..2260e2bc 100644 --- a/projects/arlas-components/src/lib/components/mapgl/draw/draw.service.ts +++ b/projects/arlas-components/src/lib/components/mapgl/draw/draw.service.ts @@ -18,7 +18,6 @@ */ import { Injectable } from '@angular/core'; -import mapboxgl from 'mapbox-gl'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; import area from '@turf/area'; import { Feature, FeatureCollection, lineString } from '@turf/helpers'; @@ -29,7 +28,7 @@ import { AoiDimensions, EditionState } from './draw.models'; @Injectable() export class MapboxAoiDrawService { - private map: mapboxgl.Map; + private map: maplibregl.Map; private mapDraw: MapboxDraw; private editionId: string; private registeringMode: boolean; @@ -80,7 +79,7 @@ export class MapboxAoiDrawService { this.bboxEditionState.isEditing = false; } - public setMap(map: mapboxgl.Map) { + public setMap(map: maplibregl.Map) { this.map = map; this.onSelectionChange(); this.onRender(); @@ -88,7 +87,7 @@ export class MapboxAoiDrawService { this.onStop(); } - public setMapboxDraw(mapboxDraw: mapboxgl.Map) { + public setMapboxDraw(mapboxDraw: maplibregl.Map) { this.mapDraw = mapboxDraw; } diff --git a/projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts b/projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts index a776dab5..dc6913d7 100644 --- a/projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts +++ b/projects/arlas-components/src/lib/components/mapgl/mapgl.component.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import Point from '@mapbox/point-geometry'; import { AfterContentInit, @@ -33,7 +34,7 @@ import { paddedBounds, MapExtend, LegendData } from './mapgl.component.util'; import * as mapglJsonSchema from './mapgl.schema.json'; import { MapLayers, BasemapStyle, BasemapStylesGroup, ExternalEvent, - ARLAS_ID, FILLSTROKE_LAYER_PREFIX, SCROLLABLE_ARLAS_ID, ARLAS_VSET + ARLAS_ID, FILLSTROKE_LAYER_PREFIX, SCROLLABLE_ARLAS_ID, ARLAS_VSET, LayerMetadata, Layer } from './model/mapLayers'; import { MapSource } from './model/mapSource'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; @@ -41,11 +42,11 @@ import { Feature, Polygon, Feature as TurfFeature, polygon } from '@turf/helpers import centroid from '@turf/centroid'; import limitVertexDirectSelectMode from './model/LimitVertexDirectSelectMode'; import validGeomDrawPolygonMode from './model/ValidGeomDrawPolygonMode'; -import * as mapboxgl from 'mapbox-gl'; +import * as maplibregl from 'maplibre-gl'; import { FeatureCollection } from '@turf/helpers'; import { MatSnackBar } from '@angular/material/snack-bar'; import { TranslateService } from '@ngx-translate/core'; -import { TransformRequestFunction, AnyLayer } from 'mapbox-gl'; +import { RequestTransformFunction } from 'maplibre-gl'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import StaticMode from '@mapbox/mapbox-gl-draw-static-mode'; import * as styles from './model/theme'; @@ -58,7 +59,7 @@ export const CROSS_LAYER_PREFIX = 'arlas_cross'; export interface OnMoveResult { zoom: number; zoomStart: number; - center: Array; + center: Array | maplibregl.LngLat; centerWithOffset: Array; extend: Array; extendWithOffset: Array; @@ -101,7 +102,7 @@ export const GEOJSON_SOURCE_TYPE = 'geojson'; }) export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterContentInit, OnDestroy { - public map: any; + public map: maplibregl.Map; public draw: any; public zoom: number; public legendOpen = true; @@ -118,12 +119,12 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo private canvas: HTMLElement; private box: HTMLElement; // points which xy coordinates are in screen referential - private start: mapboxgl.Point; - private current: mapboxgl.Point; + private start: Point; + private current: Point; // Lat/lng on mousedown (start); mouseup (end) and mousemove (between start and end) - private startlngLat: mapboxgl.LngLat; - private endlngLat: mapboxgl.LngLat; - private movelngLat: mapboxgl.LngLat; + private startlngLat: maplibregl.LngLat; + private endlngLat: maplibregl.LngLat; + private movelngLat: maplibregl.LngLat; private savedEditFeature = null; @@ -168,7 +169,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo * @Input : Angular * @description Unit of the scale. */ - @Input() public unitScale = 'metric'; + @Input() public unitScale: maplibregl.Unit = 'metric'; /** * @Input : Angular * @description Default style of the base map @@ -281,7 +282,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo * @Input : Angular * @description A callback run before the Map makes a request for an external URL, mapbox map option */ - @Input() public transformRequest: TransformRequestFunction; + @Input() public transformRequest: RequestTransformFunction; /** * @Input : Angular @@ -400,7 +401,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo }> = new Subject(); public showBasemapsList = false; - public layersMap: Map; + public layersMap: Map; public basemapStylesGroup: BasemapStylesGroup; public currentLat: string; @@ -464,7 +465,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo } }); layersSet.forEach(ll => { - (this.map as mapboxgl.Map).setLayoutProperty(ll, 'visibility', 'none'); + (this.map as maplibregl.Map).setLayoutProperty(ll, 'visibility', 'none'); this.setStrokeLayoutVisibility(ll, 'none'); this.setScrollableLayoutVisibility(ll, 'none'); }); @@ -475,7 +476,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo if (this.visualisationsSets.status.get(v)) { ls.forEach(l => { layers.add(l); - (this.map as mapboxgl.Map).setLayoutProperty(l, 'visibility', 'visible'); + (this.map as maplibregl.Map).setLayoutProperty(l, 'visibility', 'visible'); this.setStrokeLayoutVisibility(l, 'visible'); this.setScrollableLayoutVisibility(l, 'visible'); }); @@ -485,12 +486,12 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.reorderLayers(); } - public downloadLayerSource(downaload: { layer: mapboxgl.Layer; downloadType: string; }): void { + public downloadLayerSource(downaload: { layer: maplibregl.LayerSpecification; downloadType: string; }): void { const downlodedSource = { layerId: downaload.layer.id, layerName: getLayerName(downaload.layer.id), - collection: downaload.layer.metadata.collection, - sourceName: downaload.layer.source as string, + collection: (downaload.layer.metadata as LayerMetadata).collection, + sourceName: (downaload.layer as any).source as string, downloadType: downaload.downloadType }; this.downloadSourceEmitter.next(downlodedSource); @@ -502,9 +503,9 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo * @param layers List of actual layers that are declared in `visualisation` object * @param sources List of sources that these external `layers` use. */ - public addVisualisation(visualisation: VisualisationSetConfig, layers: Array, sources: Array): void { + public addVisualisation(visualisation: VisualisationSetConfig, layers: Array, sources: Array): void { sources.forEach((s) => { - this.map.addSource(s.id, s.source); + this.map.addSource(s.id, s.source as maplibregl.SourceSpecification); }); this.visualisationSetsConfig.unshift(visualisation); this.visualisationsSets.visualisations.set(visualisation.name, new Set(visualisation.layers)); @@ -627,7 +628,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo } this.drawSelectionChanged = false; if (this.map.getSource(this.POLYGON_LABEL_SOURCE) !== undefined) { - this.map.getSource(this.POLYGON_LABEL_SOURCE).setData(this.polygonlabeldata); + // this.map.getSource(this.POLYGON_LABEL_SOURCE).setData(this.polygonlabeldata); } } if (changes['boundsToFit'] !== undefined) { @@ -637,7 +638,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo const width = positionInfo.width; this.map.fitBounds(newBoundsToFit, { maxZoom: this.fitBoundsMaxZoom, - offset: this.fitBoundsOffSet + offset: (this.fitBoundsOffSet as maplibregl.PointLike) }); } if (changes['featureToHightLight'] !== undefined @@ -653,7 +654,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo } } - public setBaseMapStyle(style: string | mapboxgl.Style) { + public setBaseMapStyle(style: string | maplibregl.StyleSpecification) { if (this.map) { if (typeof this.basemapStylesGroup.selectedBasemapStyle.styleFile === 'string') { this.http.get(this.basemapStylesGroup.selectedBasemapStyle.styleFile).subscribe((s: any) => this.setStyle(s, style)); @@ -663,19 +664,19 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo } } - public setStyle(s: mapboxgl.Style, style: string | mapboxgl.Style) { + public setStyle(s: maplibregl.StyleSpecification, style: string | maplibregl.StyleSpecification) { const selectedBasemapLayersSet = new Set(); - const layers: Array = (this.map).getStyle().layers; - const sources = (this.map).getStyle().sources; + const layers: Array = (this.map).getStyle().layers; + const sources = (this.map).getStyle().sources; if (s.layers) { s.layers.forEach(l => selectedBasemapLayersSet.add(l.id)); } - const layersToSave = new Array(); + const layersToSave = new Array(); const sourcesToSave = new Array(); - layers.filter((l: mapboxgl.Layer) => !selectedBasemapLayersSet.has(l.id)).forEach(l => { + layers.filter((l: maplibregl.LayerSpecification) => !selectedBasemapLayersSet.has(l.id)).forEach(l => { layersToSave.push(l); - if (sourcesToSave.filter(ms => ms.id === l.source.toString()).length === 0) { - sourcesToSave.push({ id: l.source.toString(), source: sources[l.source.toString()] }); + if (sourcesToSave.filter(ms => ms.id === (l as Layer).source.toString()).length === 0) { + sourcesToSave.push({ id: (l as Layer).source.toString(), source: sources[(l as Layer).source.toString()] }); } }); const sourcesToSaveSet = new Set(); @@ -717,7 +718,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.maxZoom = 0; } - this.map = new mapboxgl.Map({ + this.map = new maplibregl.Map({ container: this.id, style: afterViewInitbasemapStyle.styleFile, center: this.initCenter, @@ -735,7 +736,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo }); this.drawService.setMap(this.map); fromEvent(window, 'beforeunload').subscribe(() => { - const bounds = (this.map).getBounds(); + const bounds = (this.map).getBounds(); const mapExtend: MapExtend = { bounds: bounds.toArray(), center: bounds.getCenter().toArray(), zoom: this.map.getZoom() }; this.onMapClosed.next(mapExtend); }); @@ -745,14 +746,14 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo /** Whether to display scale */ if (this.displayScale) { - const scale = new mapboxgl.ScaleControl({ + const scale = new maplibregl.ScaleControl({ maxWidth: this.maxWidthScale, unit: this.unitScale, }); this.map.addControl(scale, 'bottom-right'); } - const navigationControllButtons = new mapboxgl.NavigationControl(); + const navigationControllButtons = new maplibregl.NavigationControl(); const addGeoBoxButton = new ControlButton('addgeobox'); const removeAoisButton = new ControlButton('removeaois'); @@ -859,7 +860,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.mapLayers.events.emitOnClick.forEach(layerId => { this.map.on('click', layerId, (e) => { - const features = (this.map as mapboxgl.Map).queryRenderedFeatures(e.point); + const features = (this.map as maplibregl.Map).queryRenderedFeatures(e.point); const hasCrossOrDrawLayer = (!!features && !!features.find(f => f.layer.id.startsWith(CROSS_LAYER_PREFIX))); if (!this.isDrawingBbox && !this.isDrawingPolygon && !this.isInSimpleDrawMode && !hasCrossOrDrawLayer) { this.onFeatureClic.next({ features: e.features, point: [e.lngLat.lng, e.lngLat.lat] }); @@ -909,7 +910,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo } }); if (layerInVisualisations) { - (this.map as mapboxgl.Map).setLayoutProperty(l, 'visibility', 'none'); + (this.map as maplibregl.Map).setLayoutProperty(l, 'visibility', 'none'); this.setStrokeLayoutVisibility(l, 'none'); this.setScrollableLayoutVisibility(l, 'none'); } @@ -1154,7 +1155,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.east = this.map.getBounds().getEast(); this.north = this.map.getBounds().getNorth(); this.zoom = this.map.getZoom(); - const offsetPoint = new mapboxgl.Point((this.offset.east + this.offset.west) / 2, (this.offset.north + this.offset.south) / 2); + const offsetPoint = new Point((this.offset.east + this.offset.west) / 2, (this.offset.north + this.offset.south) / 2); const centerOffsetPoint = this.map.project(this.map.getCenter()).add(offsetPoint); const centerOffSetLatLng = this.map.unproject(centerOffsetPoint); @@ -1165,8 +1166,8 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo const height = bottomLeft.y; const width = topRght.x; - const bottomLeftOffset = bottomLeft.add(new mapboxgl.Point(this.offset.west, this.offset.south)); - const topRghtOffset = topRght.add(new mapboxgl.Point(this.offset.east, this.offset.north)); + const bottomLeftOffset = bottomLeft.add(new Point(this.offset.west, this.offset.south)); + const topRghtOffset = topRght.add(new Point(this.offset.east, this.offset.north)); const bottomLeftOffsetLatLng = this.map.unproject(bottomLeftOffset); const topRghtOffsetLatLng = this.map.unproject(topRghtOffset); @@ -1237,15 +1238,15 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.map.fitBounds(this.map.getBounds()); // Mouse events - this.map.on('mousedown', (e: mapboxgl.MapMouseEvent) => { + this.map.on('mousedown', (e: maplibregl.MapMouseEvent) => { this.startlngLat = e.lngLat; this.drawService.startBboxDrawing(); }); - this.map.on('mouseup', (e: mapboxgl.MapMouseEvent) => { + this.map.on('mouseup', (e: maplibregl.MapMouseEvent) => { this.endlngLat = e.lngLat; this.drawService.stopBboxDrawing(); }); - this.map.on('mousemove', (e: mapboxgl.MapMouseEvent) => { + this.map.on('mousemove', (e: maplibregl.MapMouseEvent) => { const lngLat = e.lngLat; if (this.displayCurrentCoordinates) { const displayedLngLat = this.wrapLatLng ? lngLat.wrap() : lngLat; @@ -1289,9 +1290,9 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo if (!!this.redrawSource) { this.redrawSource.subscribe(sd => { if (this.map.getSource(sd.source) !== undefined) { - this.map.getSource(sd.source).setData({ + (this.map.getSource(sd.source) as maplibregl.GeoJSONSource).setData({ 'type': 'FeatureCollection', - 'features': sd.data + 'features': sd.data as any }); } }); @@ -1611,7 +1612,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo this.mapLayers.externalEventLayers.filter(layer => layer.on === visibilityEvent).forEach(layer => { if (this.map.getLayer(layer.id) !== undefined) { let originalLayerIsVisible = false; - const fullLayer = this.layersMap.get(layer.id); + const fullLayer = this.layersMap.get(layer.id) as Layer; const isCollectionCompatible = (!collection || (!!collection && (fullLayer.source as string).includes(collection))); if (isCollectionCompatible) { const originalLayerId = layer.id.replace('arlas-' + visibilityEvent.toString() + '-', ''); @@ -1619,9 +1620,9 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo originalLayerIsVisible = this.map.getLayer(originalLayerId).visibility === 'visible'; } const layerFilter: Array = []; - const externalEventLayer = this.layersMap.get(layer.id); + const externalEventLayer = this.layersMap.get(layer.id) as Layer; if (!!externalEventLayer && !!externalEventLayer.filter) { - externalEventLayer.filter.forEach(f => { + ( externalEventLayer.filter as Array).forEach(f => { layerFilter.push(f); }); } @@ -1631,7 +1632,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo if (visibilityCondition && originalLayerIsVisible) { const condition = visibilityFilter; layerFilter.push(condition); - this.map.setFilter(layer.id, layerFilter); + this.map.setFilter(layer.id, layerFilter as any); this.map.setLayoutProperty(layer.id, 'visibility', 'visible'); } else { this.map.setFilter(layer.id, (layer as any).filter); @@ -1655,7 +1656,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo document.addEventListener('mouseup', this.mouseup); // Capture the first xy coordinates const rect = this.canvas.getBoundingClientRect(); - this.start = new mapboxgl.Point( + this.start = new Point( e.clientX - rect.left - this.canvas.clientLeft, e.clientY - rect.top - this.canvas.clientTop ); @@ -1664,7 +1665,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo private mousemove = (e) => { // Capture the ongoing xy coordinates const rect = this.canvas.getBoundingClientRect(); - this.current = new mapboxgl.Point( + this.current = new Point( e.clientX - rect.left - this.canvas.clientLeft, e.clientY - rect.top - this.canvas.clientTop ); @@ -1689,7 +1690,7 @@ export class MapglComponent implements OnInit, AfterViewInit, OnChanges, AfterCo private mouseup = (e) => { const rect = this.canvas.getBoundingClientRect(); - const f = new mapboxgl.Point( + const f = new Point( e.clientX - rect.left - this.canvas.clientLeft, e.clientY - rect.top - this.canvas.clientTop ); diff --git a/projects/arlas-components/src/lib/components/mapgl/mapgl.component.util.ts b/projects/arlas-components/src/lib/components/mapgl/mapgl.component.util.ts index 3b7ae72d..8f37cdf1 100644 --- a/projects/arlas-components/src/lib/components/mapgl/mapgl.component.util.ts +++ b/projects/arlas-components/src/lib/components/mapgl/mapgl.component.util.ts @@ -18,7 +18,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -import { Point } from 'mapbox-gl'; +import Point from '@mapbox/point-geometry'; export function paddedBounds(npad: number, spad: number, epad: number, wpad: number, map: any, SW, NE) { @@ -68,20 +68,21 @@ export interface MapExtend { @Pipe({ name: 'getLayer' }) export class GetLayerPipe implements PipeTransform { - public transform(value: string, layersMap?: Map): mapboxgl.Layer { + public transform(value: string, layersMap?: Map): maplibregl.LayerSpecification { return !!layersMap ? layersMap.get(value) : undefined; } } @Pipe({ name: 'getCollection' }) export class GetCollectionPipe implements PipeTransform { - public transform(value: string, layersMap?: Map): string { + public transform(value: string, layersMap?: Map): string { let collection: string; - if (!!layersMap && !!layersMap.get(value).metadata) { - if (!!layersMap.get(value).metadata.collectionDisplayName) { - collection = layersMap.get(value).metadata.collectionDisplayName; - } else if (!!layersMap.get(value).metadata.collection) { - collection = layersMap.get(value).metadata.collection; + const md = layersMap.get(value).metadata as any; + if (!!layersMap && !!md) { + if (!!md.collectionDisplayName) { + collection = md.collectionDisplayName; + } else if (!!md.collection) { + collection = md.collection; } } return collection; diff --git a/projects/arlas-components/src/lib/components/mapgl/model/mapLayers.ts b/projects/arlas-components/src/lib/components/mapgl/model/mapLayers.ts index 401a5857..3e492ffe 100644 --- a/projects/arlas-components/src/lib/components/mapgl/model/mapLayers.ts +++ b/projects/arlas-components/src/lib/components/mapgl/model/mapLayers.ts @@ -17,11 +17,14 @@ * under the License. */ -import { AnyLayer } from 'mapbox-gl'; +import { CircleLayerSpecification, FillLayerSpecification, HeatmapLayerSpecification, + LayerSpecification, LineLayerSpecification, SymbolLayerSpecification } from 'maplibre-gl'; +export type Layer = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | + CircleLayerSpecification | HeatmapLayerSpecification; export interface BasemapStyle { name: string; - styleFile: string | mapboxgl.Style; + styleFile: string | maplibregl.StyleSpecification; image?: string; } @@ -31,7 +34,7 @@ export interface BasemapStylesGroup { } export interface MapLayers { - layers: Array; + layers: Array; externalEventLayers?: Array; events: LayerEvents; } diff --git a/projects/arlas-components/src/lib/components/mapgl/model/mapSource.ts b/projects/arlas-components/src/lib/components/mapgl/model/mapSource.ts index a7bce17d..d0d75f95 100644 --- a/projects/arlas-components/src/lib/components/mapgl/model/mapSource.ts +++ b/projects/arlas-components/src/lib/components/mapgl/model/mapSource.ts @@ -17,9 +17,9 @@ * under the License. */ +import { SourceSpecification } from 'maplibre-gl'; + export class MapSource { public id: string; - public source: string | mapboxgl.AnySourceData | mapboxgl.VectorSource | mapboxgl.RasterSource | - mapboxgl.GeoJSONSource | mapboxgl.GeoJSONSourceRaw | - mapboxgl.CanvasSource | mapboxgl.ImageSource | mapboxgl.VideoSource; + public source: string | SourceSpecification; } diff --git a/src/styles.css b/src/styles.css index 42ba4301..914f7792 100644 --- a/src/styles.css +++ b/src/styles.css @@ -20,7 +20,7 @@ /* You can add global styles to this file, and also import other style files */ @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; -@import '../node_modules/mapbox-gl/dist/mapbox-gl.css'; +@import '../node_modules/maplibre-gl/dist/maplibre-gl.css'; body { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";