diff --git a/package-lock.json b/package-lock.json index 6d89dd56..de36077c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@stackblitz/sdk": "^1.11.0", "express": "^4.21.2", "lodash-es": "^4.17.21", - "maplibre-gl": "^4.6.0", + "maplibre-gl": "^5.0.0", "rxjs": "7.8.1", "scroll-into-view-if-needed": "^3.1.0", "tslib": "^2.6.3", @@ -5870,17 +5870,16 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "20.3.1", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.3.1.tgz", - "integrity": "sha512-5ueL4UDitzVtceQ8J4kY+Px3WK+eZTsmGwha3MBKHKqiHvKrjWWwBCIl1K8BuJSc5OFh83uI8IFNoFvQxX2uUw==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-22.0.1.tgz", + "integrity": "sha512-V7bSw7Ui6+NhpeeuYqGoqamvKuy+3+uCvQ/t4ZJkwN8cx527CAlQQQ2kp+w5R9q+Tw6bUAH+fsq+mPEkicgT8g==", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", "json-stringify-pretty-compact": "^4.0.0", "minimist": "^1.2.8", - "quickselect": "^2.0.0", + "quickselect": "^3.0.0", "rw": "^1.3.3", - "sort-object": "^3.0.3", "tinyqueue": "^3.0.0" }, "bin": { @@ -5897,11 +5896,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" - }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", @@ -7105,9 +7099,9 @@ } }, "node_modules/@types/geojson": { - "version": "7946.0.14", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", - "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + "version": "7946.0.15", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz", + "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==" }, "node_modules/@types/geojson-vt": { "version": "3.2.5", @@ -8146,14 +8140,6 @@ "dequal": "^2.0.3" } }, - "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": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -8210,14 +8196,6 @@ "node": ">=0.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/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -8698,23 +8676,6 @@ "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": "18.0.3", "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.3.tgz", @@ -10916,9 +10877,9 @@ } }, "node_modules/earcut": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.0.tgz", - "integrity": "sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz", + "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw==" }, "node_modules/eastasianwidth": { "version": "0.2.0", @@ -11795,17 +11756,6 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "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", @@ -12542,14 +12492,6 @@ "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/getos": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", @@ -13638,14 +13580,6 @@ "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", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -13786,6 +13720,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, "dependencies": { "isobject": "^3.0.1" }, @@ -13899,6 +13834,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -16268,9 +16204,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.6.0.tgz", - "integrity": "sha512-zobZK+fE+XM+7K81fk5pSBYWZlTGjGT0P96y2fR4DV2ry35ZBfAd0uWNatll69EgYeE+uOhN1MvEk+z1PCuyOQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.0.0.tgz", + "integrity": "sha512-WG8IYFK2gfJYXvWjlqg1yavo/YO/JlNkblAJMt19sjIafP5oJzTgXFiOLUIYkjtrv5pKiAWuSYsx4CD3ithJqw==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -16279,14 +16215,14 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^20.3.1", - "@types/geojson": "^7946.0.14", + "@maplibre/maplibre-gl-style-spec": "^22.0.1", + "@types/geojson": "^7946.0.15", "@types/geojson-vt": "3.2.5", "@types/mapbox__point-geometry": "^0.1.4", "@types/mapbox__vector-tile": "^1.3.4", "@types/pbf": "^3.0.5", "@types/supercluster": "^7.1.3", - "earcut": "^3.0.0", + "earcut": "^3.0.1", "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", "global-prefix": "^4.0.0", @@ -20061,20 +19997,6 @@ "node": ">= 0.4" } }, - "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/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -20318,38 +20240,6 @@ "node": ">= 14" } }, - "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", @@ -20492,40 +20382,6 @@ "node": "*" } }, - "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/split2": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", @@ -21573,19 +21429,6 @@ "node": ">=14.17" } }, - "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/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", @@ -21663,20 +21506,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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": "3.0.0", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", diff --git a/package.json b/package.json index 20f73cf9..7c8d90e8 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@stackblitz/sdk": "^1.11.0", "express": "^4.21.2", "lodash-es": "^4.17.21", - "maplibre-gl": "^4.6.0", + "maplibre-gl": "^5.0.0", "rxjs": "7.8.1", "scroll-into-view-if-needed": "^3.1.0", "tslib": "^2.6.3", diff --git a/projects/ngx-maplibre-gl/package-lock.json b/projects/ngx-maplibre-gl/package-lock.json index cfb61056..a5e92dd3 100644 --- a/projects/ngx-maplibre-gl/package-lock.json +++ b/projects/ngx-maplibre-gl/package-lock.json @@ -11,7 +11,7 @@ "peerDependencies": { "@angular/common": ">= 18.0.0", "@angular/core": ">= 18.0.0", - "maplibre-gl": ">= 4.1.0", + "maplibre-gl": ">= 5.0.0", "rxjs": ">= 7.8.1" } }, @@ -106,19 +106,18 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "20.3.0", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.3.0.tgz", - "integrity": "sha512-eSiQ3E5LUSxAOY9ABXGyfNhout2iEa6mUxKeaQ9nJ8NL1NuaQYU7zKqzx/LEYcXe1neT4uYAgM1wYZj3fTSXtA==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-22.0.1.tgz", + "integrity": "sha512-V7bSw7Ui6+NhpeeuYqGoqamvKuy+3+uCvQ/t4ZJkwN8cx527CAlQQQ2kp+w5R9q+Tw6bUAH+fsq+mPEkicgT8g==", "peer": true, "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", "json-stringify-pretty-compact": "^4.0.0", "minimist": "^1.2.8", - "quickselect": "^2.0.0", + "quickselect": "^3.0.0", "rw": "^1.3.3", - "sort-object": "^3.0.3", - "tinyqueue": "^2.0.3" + "tinyqueue": "^3.0.0" }, "bin": { "gl-style-format": "dist/gl-style-format.mjs", @@ -126,22 +125,10 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, - "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", - "peer": true - }, - "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", - "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==", - "peer": true - }, "node_modules/@types/geojson": { - "version": "7946.0.14", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", - "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==", + "version": "7946.0.15", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz", + "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==", "peer": true }, "node_modules/@types/geojson-vt": { @@ -185,61 +172,12 @@ "@types/geojson": "*" } }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "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==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "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==", - "peer": true, - "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==", - "peer": true, - "dependencies": { - "typewise-core": "^1.2" - } - }, "node_modules/earcut": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.0.tgz", - "integrity": "sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz", + "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw==", "peer": true }, - "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==", - "peer": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/geojson-vt": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", @@ -258,15 +196,6 @@ "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==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/gl-matrix": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", @@ -274,17 +203,17 @@ "peer": 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==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", "peer": true, "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/ieee754": { @@ -308,45 +237,21 @@ "peer": true }, "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "peer": true - }, - "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==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", "peer": true, - "dependencies": { - "isobject": "^3.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "peer": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=16" } }, "node_modules/json-stringify-pretty-compact": { @@ -371,9 +276,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.5.2.tgz", - "integrity": "sha512-vlWL9EY2bSGg5FAt0mKPfYqlfX15uLW5D3kKv4Xjn54nIVn01MKdfUJMAVIr+8fXVqfSX6c095Iy5XnV+T76kQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.0.0.tgz", + "integrity": "sha512-WG8IYFK2gfJYXvWjlqg1yavo/YO/JlNkblAJMt19sjIafP5oJzTgXFiOLUIYkjtrv5pKiAWuSYsx4CD3ithJqw==", "peer": true, "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", @@ -383,17 +288,17 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^20.3.0", - "@types/geojson": "^7946.0.14", + "@maplibre/maplibre-gl-style-spec": "^22.0.1", + "@types/geojson": "^7946.0.15", "@types/geojson-vt": "3.2.5", "@types/mapbox__point-geometry": "^0.1.4", "@types/mapbox__vector-tile": "^1.3.4", "@types/pbf": "^3.0.5", "@types/supercluster": "^7.1.3", - "earcut": "^3.0.0", + "earcut": "^3.0.1", "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", - "global-prefix": "^3.0.0", + "global-prefix": "^4.0.0", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.3.0", @@ -481,93 +386,6 @@ "tslib": "^2.1.0" } }, - "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==", - "peer": true, - "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/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==", - "peer": true, - "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==", - "peer": true, - "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==", - "peer": true, - "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/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==", - "peer": true, - "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==", - "peer": true, - "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==", - "peer": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/supercluster": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", @@ -589,36 +407,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "peer": true }, - "node_modules/typewise": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", - "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", - "peer": true, - "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==", - "peer": true - }, - "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==", - "peer": true, - "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/vt-pbf": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", @@ -631,15 +419,18 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "peer": true, "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { - "which": "bin/which" + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/zone.js": { diff --git a/projects/ngx-maplibre-gl/package.json b/projects/ngx-maplibre-gl/package.json index 8df344f0..21a5410b 100644 --- a/projects/ngx-maplibre-gl/package.json +++ b/projects/ngx-maplibre-gl/package.json @@ -22,7 +22,7 @@ "peerDependencies": { "@angular/common": ">= 18.0.0", "@angular/core": ">= 18.0.0", - "maplibre-gl": ">= 4.5.2", + "maplibre-gl": ">= 5.0.0", "rxjs": ">= 7.8.1" } } diff --git a/projects/ngx-maplibre-gl/src/lib/control/globe-control.directive.ts b/projects/ngx-maplibre-gl/src/lib/control/globe-control.directive.ts new file mode 100644 index 00000000..0b74c663 --- /dev/null +++ b/projects/ngx-maplibre-gl/src/lib/control/globe-control.directive.ts @@ -0,0 +1,42 @@ +import { Directive, afterNextRender, inject } from '@angular/core'; +import { GlobeControl } from 'maplibre-gl'; +import { MapService } from '../map/map.service'; +import { ControlComponent } from './control.component'; + +/** + * `mglGlobe` - a globe control directive + * + * @category Directives + * + * @see [Globe](https://maplibre.org/ngx-maplibre-gl/demo/globe) + * @see [GlobeControl](https://maplibre.org/maplibre-gl-js/docs/API/classes/GlobeControl) + */ +@Directive({ + selector: '[mglGlobe]', + standalone: true, +}) +export class GlobeControlDirective { + + private readonly mapService = inject(MapService); + private readonly controlComponent = inject>( + ControlComponent, + { host: true } + ); + + constructor() { + afterNextRender(() => { + this.mapService.mapCreated$.subscribe(() => { + if (this.controlComponent.control) { + throw new Error('Another control is already set for this control'); + } + + this.controlComponent.control = new GlobeControl(); + + this.mapService.addControl( + this.controlComponent.control, + this.controlComponent.position() + ); + }); + }); + } +} diff --git a/projects/ngx-maplibre-gl/src/lib/control/navigation-control.directive.ts b/projects/ngx-maplibre-gl/src/lib/control/navigation-control.directive.ts index 5b5850ef..66a7e338 100644 --- a/projects/ngx-maplibre-gl/src/lib/control/navigation-control.directive.ts +++ b/projects/ngx-maplibre-gl/src/lib/control/navigation-control.directive.ts @@ -29,6 +29,8 @@ export class NavigationControlDirective { readonly showZoom = input(); /* Init inputs */ readonly visualizePitch = input(); + /* Init inputs */ + readonly visualizeRoll = input(); constructor() { afterNextRender(() => { @@ -40,6 +42,7 @@ export class NavigationControlDirective { showCompass: this.showCompass(), showZoom: this.showZoom(), visualizePitch: this.visualizePitch(), + visualizeRoll: this.visualizeRoll(), }); this.controlComponent.control = new NavigationControl(options); this.mapService.addControl( diff --git a/projects/ngx-maplibre-gl/src/lib/map/map.component.spec.ts b/projects/ngx-maplibre-gl/src/lib/map/map.component.spec.ts index 300f4028..0ad568b0 100644 --- a/projects/ngx-maplibre-gl/src/lib/map/map.component.spec.ts +++ b/projects/ngx-maplibre-gl/src/lib/map/map.component.spec.ts @@ -24,6 +24,7 @@ const getMapServiceStub = () => 'updateMaxPitch', 'updateMinPitch', 'destroyMap', + 'clearMapElements' ], { mapCreated$: of(true), diff --git a/projects/ngx-maplibre-gl/src/lib/map/map.component.ts b/projects/ngx-maplibre-gl/src/lib/map/map.component.ts index 21fe8346..2da6a793 100644 --- a/projects/ngx-maplibre-gl/src/lib/map/map.component.ts +++ b/projects/ngx-maplibre-gl/src/lib/map/map.component.ts @@ -28,6 +28,7 @@ import type { MapWheelEvent, PointLike, TerrainSpecification, + ProjectionSpecification, } from 'maplibre-gl'; import { MapService, type MovingOptions } from './map.service'; import type { MapEvent, EventData } from './map.types'; @@ -79,7 +80,6 @@ import { firstValueFrom } from 'rxjs'; standalone: true, }) export class MapComponent implements OnChanges, OnDestroy, MapEvent { - /** Init injection */ private readonly mapService = inject(MapService); private readonly elementRef = inject(ElementRef); @@ -96,8 +96,7 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { /** Init input */ readonly refreshExpiredTiles = input(); /** Init input */ - readonly failIfMajorPerformanceCaveat = - input(); + readonly canvasContextAttributes = input(); /** Init input */ readonly bearingSnap = input(); /** Init input */ @@ -113,10 +112,7 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { /** Init input */ readonly maxTileCacheSize = input(); /** Init input */ - readonly localIdeographFontFamily = - input(); - /** Init input */ - readonly preserveDrawingBuffer = input(); + readonly localIdeographFontFamily = input(); /** Init input */ readonly trackResize = input(); /** Init input */ @@ -124,11 +120,27 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { /** Init input */ readonly bounds = input(); /** Init input */ - readonly antialias = input(); - /** Init input */ readonly locale = input(); /** Init input */ readonly cooperativeGestures = input(); + /** Init input */ + readonly cancelPendingTileRequestsWhileZooming = input(); + /** Init input */ + readonly centerClampedToGround = input(); + /** Init input */ + readonly maplibreLogo = input(); + /** Init input */ + readonly maxCanvasSize = input(); + /** Init input */ + readonly maxTileCacheZoomLevels = input(); + /** Init input */ + readonly pixelRatio = input(); + /** Init input */ + readonly rollEnabled = input(); + /** Init input */ + readonly transformCameraUpdate = input(); + /** Init input */ + readonly validateStyle = input(); /** Dynamic input */ readonly minZoom = input(); @@ -167,11 +179,17 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { /** Dynamic input */ readonly pitch = input<[number]>(); /** Dynamic input */ + readonly roll = input(); + /** Dynamic input */ readonly fitBoundsOptions = input(); // First value goes to options.fitBoundsOptions. Subsequents changes are passed to fitBounds /** Dynamic input */ readonly renderWorldCopies = input(); /** Dynamic input */ + readonly elevation = input(); + /** Dynamic input that is not part of the `MapOptions` object */ readonly terrain = input(); + /** Dynamic input that is not part of the `MapOptions` object */ + readonly projection = input(); /** Added by ngx-mapbox-gl */ readonly movingMethod = input<'jumpTo' | 'easeTo' | 'flyTo'>('flyTo'); @@ -274,7 +292,7 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { constructor() { afterNextRender(() => { - if (this.preserveDrawingBuffer()) { + if (this.canvasContextAttributes()?.preserveDrawingBuffer) { // This is to allow better interaction with the map state const htmlElement: HTMLElement = this.elementRef.nativeElement; htmlElement.setAttribute('data-cy', 'map'); @@ -306,8 +324,7 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { clickTolerance: this.clickTolerance(), attributionControl: this.attributionControl(), logoPosition: this.logoPosition(), - failIfMajorPerformanceCaveat: this.failIfMajorPerformanceCaveat(), - preserveDrawingBuffer: this.preserveDrawingBuffer(), + canvasContextAttributes: this.canvasContextAttributes(), refreshExpiredTiles: this.refreshExpiredTiles(), maxBounds: this.maxBounds(), scrollZoom: this.scrollZoom(), @@ -323,16 +340,28 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { zoom: this.zoom(), bearing: this.bearing(), pitch: this.pitch(), + roll: this.roll(), renderWorldCopies: this.renderWorldCopies(), maxTileCacheSize: this.maxTileCacheSize(), localIdeographFontFamily: this.localIdeographFontFamily(), transformRequest: this.transformRequest(), bounds: this.bounds() ? this.bounds() : this.fitBounds(), fitBoundsOptions: this.fitBoundsOptions(), - antialias: this.antialias(), locale: this.locale, cooperativeGestures: this.cooperativeGestures(), + cancelPendingTileRequestsWhileZooming: this.cancelPendingTileRequestsWhileZooming(), + centerClampedToGround: this.centerClampedToGround(), + elevation: this.elevation(), + maplibreLogo: this.maplibreLogo(), + maxCanvasSize: this.maxCanvasSize(), + maxTileCacheZoomLevels: this.maxTileCacheZoomLevels(), + pixelRatio: this.pixelRatio(), + rollEnabled: this.rollEnabled(), + transformCameraUpdate: this.transformCameraUpdate(), + validateStyle: this.validateStyle(), + terrain: this.terrain(), + projection: this.projection(), }, mapEvents: this, }); @@ -449,16 +478,16 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { !changes.center.isFirstChange() && !changes.zoom && !changes.bearing && - !changes.pitch + !changes.pitch && + !changes.roll ) { this.mapService.panTo(this.center()!, this.panToOptions()); } else if ( (changes.center && !changes.center.isFirstChange()) || (changes.zoom && !changes.zoom.isFirstChange()) || - (changes.bearing && - !changes.bearing.isFirstChange() && - !changes.fitScreenCoordinates) || - (changes.pitch && !changes.pitch.isFirstChange()) + (changes.bearing && !changes.bearing.isFirstChange() && !changes.fitScreenCoordinates) || + (changes.pitch && !changes.pitch.isFirstChange()) || + (changes.roll && !changes.roll.isFirstChange()) ) { this.mapService.move( this.movingMethod(), @@ -466,11 +495,18 @@ export class MapComponent implements OnChanges, OnDestroy, MapEvent { changes.zoom && zoom ? zoom[0] : undefined, changes.center ? center : undefined, changes.bearing && bearing ? bearing[0] : undefined, - changes.pitch && pitch ? pitch[0] : undefined + changes.pitch && pitch ? pitch[0] : undefined, + changes.roll ? changes.roll.currentValue : undefined ); } if (changes.terrain && !changes.terrain.isFirstChange()) { - this.mapService.updateTerrain(changes.terrain.currentValue); + this.mapService.setTerrain(changes.terrain.currentValue); + } + if (changes.projection && !changes.projection.isFirstChange()) { + this.mapService.setProjection(changes.projection.currentValue); + } + if (changes.elevation && !changes.elevation.isFirstChange()) { + this.mapService.setCenterElevation(changes.elevation.currentValue); } } } diff --git a/projects/ngx-maplibre-gl/src/lib/map/map.service.ts b/projects/ngx-maplibre-gl/src/lib/map/map.service.ts index 461237b6..a59db7be 100644 --- a/projects/ngx-maplibre-gl/src/lib/map/map.service.ts +++ b/projects/ngx-maplibre-gl/src/lib/map/map.service.ts @@ -37,7 +37,8 @@ import { type QueryRenderedFeaturesOptions, type ControlPosition, type Subscription, - MapLayerEventType + type MapLayerEventType, + type ProjectionSpecification } from 'maplibre-gl'; import { AsyncSubject } from 'rxjs'; import type { @@ -54,6 +55,7 @@ export interface SetupMap { pitch?: [number]; zoom?: [number]; terrain?: TerrainSpecification; + projection?: ProjectionSpecification; }; mapEvents: MapEvent; } @@ -116,9 +118,14 @@ export class MapService { this.mapCreated.next(undefined); this.mapCreated.complete(); - if (options.mapOptions.terrain) { + if (options.mapOptions.terrain || options.mapOptions.projection) { this.mapInstance.on('load', () => { - this.updateTerrain(options.mapOptions.terrain!); + if (options.mapOptions.projection) { + this.setProjection(options.mapOptions.projection!); + } + if (options.mapOptions.terrain) { + this.setTerrain(options.mapOptions.terrain!); + } }); } } @@ -235,7 +242,13 @@ export class MapService { }); } - updateTerrain(options: TerrainSpecification) { + setProjection(options: ProjectionSpecification) { + return this.zone.runOutsideAngular(() => { + this.mapInstance.setProjection(options); + }); + } + + setTerrain(options: TerrainSpecification) { return this.zone.runOutsideAngular(() => { this.mapInstance.setTerrain(options); }); @@ -247,6 +260,12 @@ export class MapService { }); } + setCenterElevation(elevation: number) { + return this.zone.runOutsideAngular(() => { + this.mapInstance.setCenterElevation(elevation); + }); + } + changeCanvasCursor(cursor: string) { const canvas = this.mapInstance.getCanvasContainer(); canvas.style.cursor = cursor; @@ -274,7 +293,8 @@ export class MapService { zoom?: number, center?: LngLatLike, bearing?: number, - pitch?: number + pitch?: number, + roll?: number ) { return this.zone.runOutsideAngular(() => { (this.mapInstance[movingMethod] as any)({ @@ -283,6 +303,7 @@ export class MapService { center: center != null ? center : this.mapInstance.getCenter(), bearing: bearing != null ? bearing : this.mapInstance.getBearing(), pitch: pitch != null ? pitch : this.mapInstance.getPitch(), + roll: roll != null ? roll : this.mapInstance.getRoll(), }); }); } diff --git a/projects/ngx-maplibre-gl/src/public_api.ts b/projects/ngx-maplibre-gl/src/public_api.ts index 20bd0bcd..9d51f241 100644 --- a/projects/ngx-maplibre-gl/src/public_api.ts +++ b/projects/ngx-maplibre-gl/src/public_api.ts @@ -26,6 +26,7 @@ export * from './lib/control/attribution-control.directive'; export * from './lib/control/scale-control.directive'; export * from './lib/markers-for-clusters/markers-for-clusters.component'; export * from './lib/control/terrain-control.directive'; +export * from './lib/control/globe-control.directive'; // Expose MapService for ngx-maplibre-gl extensions export * from './lib/map/map.service'; diff --git a/projects/showcase/src/app/demo/demo-index.component.ts b/projects/showcase/src/app/demo/demo-index.component.ts index a8cc8938..f9de2046 100644 --- a/projects/showcase/src/app/demo/demo-index.component.ts +++ b/projects/showcase/src/app/demo/demo-index.component.ts @@ -22,7 +22,7 @@ import { import { cloneDeep, groupBy } from 'lodash-es'; import { first } from 'rxjs/operators'; import scrollIntoView from 'scroll-into-view-if-needed'; -import { Category, DEMO_ROUTES } from './routes'; +import { CATEGORIES, DEMO_ROUTES } from './routes'; import { MatDividerModule } from '@angular/material/divider'; import { MatListModule } from '@angular/material/list'; import { MatInputModule } from '@angular/material/input'; @@ -33,7 +33,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; import { LayoutToolbarMenuComponent } from '../shared/layout/layout-toolbar-menu.component'; -type RoutesByCategory = { [P in Category]: Routes }; +interface RoutesByCategory { [key: string]: Routes } @Component({ templateUrl: './demo-index.component.html', @@ -62,7 +62,7 @@ export class DemoIndexComponent implements OnInit { routes: RoutesByCategory; originalRoutes: RoutesByCategory; - categories: Category[]; + categories: string[]; searchTerm: string; sidenavIsOpen = true; isEditMode = !!this.activatedRoute.snapshot.firstChild!.params.demoUrl; @@ -79,15 +79,7 @@ export class DemoIndexComponent implements OnInit { ) )) ); - this.categories = [ - Category.STYLES, - Category.LAYERS, - Category.SOURCES, - Category.USER_INTERACTION, - Category.CAMERA, - Category.CONTROLS_AND_OVERLAYS, - Category.TERRAIN, - ]; + this.categories = Object.values(CATEGORIES); afterNextRender(() => { this.scrollInToActiveExampleLink(); diff --git a/projects/showcase/src/app/demo/examples/3d-buildings.component.ts b/projects/showcase/src/app/demo/examples/3d-buildings.component.ts index 363a5458..07e3cbb5 100644 --- a/projects/showcase/src/app/demo/examples/3d-buildings.component.ts +++ b/projects/showcase/src/app/demo/examples/3d-buildings.component.ts @@ -14,7 +14,7 @@ import { MapComponent, LayerComponent } from '@maplibre/ngx-maplibre-gl'; [pitch]="45" [bearing]="-17.6" (mapLoad)="onLoad($event)" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > @for (imageData of imagesData(); track imageData.id) { diff --git a/projects/showcase/src/app/demo/examples/add-image.component.ts b/projects/showcase/src/app/demo/examples/add-image.component.ts index f2e9491e..84b26617 100644 --- a/projects/showcase/src/app/demo/examples/add-image.component.ts +++ b/projects/showcase/src/app/demo/examples/add-image.component.ts @@ -12,7 +12,7 @@ import { [style]=" 'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL' " - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > diff --git a/projects/showcase/src/app/demo/examples/center-on-symbol.component.ts b/projects/showcase/src/app/demo/examples/center-on-symbol.component.ts index 5305b151..f3ae3e7c 100644 --- a/projects/showcase/src/app/demo/examples/center-on-symbol.component.ts +++ b/projects/showcase/src/app/demo/examples/center-on-symbol.component.ts @@ -18,7 +18,7 @@ import { [center]="center" [cursorStyle]="cursorStyle" (mapLoad)="map = $event" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > @for (geometry of geometries; track geometry) { diff --git a/projects/showcase/src/app/demo/examples/cluster-html.component.ts b/projects/showcase/src/app/demo/examples/cluster-html.component.ts index b28517db..9273de83 100644 --- a/projects/showcase/src/app/demo/examples/cluster-html.component.ts +++ b/projects/showcase/src/app/demo/examples/cluster-html.component.ts @@ -132,7 +132,7 @@ const COLORS = ['#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c']; " [zoom]="[0.3]" [center]="[0, 20]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > @if (earthquakes) { diff --git a/projects/showcase/src/app/demo/examples/custom-marker-icons.component.ts b/projects/showcase/src/app/demo/examples/custom-marker-icons.component.ts index a03f1dae..d16e435e 100644 --- a/projects/showcase/src/app/demo/examples/custom-marker-icons.component.ts +++ b/projects/showcase/src/app/demo/examples/custom-marker-icons.component.ts @@ -11,7 +11,7 @@ import { NgStyle } from '@angular/common'; " [zoom]="[5]" [center]="[-65.017, -16.457]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > @for (feature of geojson.features; track feature) { diff --git a/projects/showcase/src/app/demo/examples/custom-style-id.component.ts b/projects/showcase/src/app/demo/examples/custom-style-id.component.ts index d1a1a25a..4f2d8f4a 100644 --- a/projects/showcase/src/app/demo/examples/custom-style-id.component.ts +++ b/projects/showcase/src/app/demo/examples/custom-style-id.component.ts @@ -10,7 +10,7 @@ import { MapComponent } from '@maplibre/ngx-maplibre-gl'; " [zoom]="[3]" [center]="[-77.38, 39]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > `, diff --git a/projects/showcase/src/app/demo/examples/display-map.component.ts b/projects/showcase/src/app/demo/examples/display-map.component.ts index 4ddb319a..c8b8b1c4 100644 --- a/projects/showcase/src/app/demo/examples/display-map.component.ts +++ b/projects/showcase/src/app/demo/examples/display-map.component.ts @@ -10,7 +10,7 @@ import { MapComponent } from '@maplibre/ngx-maplibre-gl'; " [zoom]="[9]" [center]="[-74.5, 40]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > `, styleUrls: ['./examples.css'], diff --git a/projects/showcase/src/app/demo/examples/drag-a-marker.component.ts b/projects/showcase/src/app/demo/examples/drag-a-marker.component.ts index 84849a5f..f348a090 100644 --- a/projects/showcase/src/app/demo/examples/drag-a-marker.component.ts +++ b/projects/showcase/src/app/demo/examples/drag-a-marker.component.ts @@ -16,7 +16,7 @@ import { " [zoom]="[2]" [center]="[0, 0]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > diff --git a/projects/showcase/src/app/demo/examples/geojson-line.component.ts b/projects/showcase/src/app/demo/examples/geojson-line.component.ts index a4d8f13e..674fc16a 100644 --- a/projects/showcase/src/app/demo/examples/geojson-line.component.ts +++ b/projects/showcase/src/app/demo/examples/geojson-line.component.ts @@ -10,7 +10,7 @@ import { MapComponent, LayerComponent } from '@maplibre/ngx-maplibre-gl'; " [zoom]="[15]" [center]="[-122.486052, 37.830348]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > + + + `, + styleUrls: ['./examples.css'], + standalone: true, + imports: [MapComponent, NgStyle, ControlComponent, GlobeControlDirective], +}) +export class GlobeComponent {} diff --git a/projects/showcase/src/app/demo/examples/heatmap.component.ts b/projects/showcase/src/app/demo/examples/heatmap.component.ts index 5a593063..3bfdbc14 100644 --- a/projects/showcase/src/app/demo/examples/heatmap.component.ts +++ b/projects/showcase/src/app/demo/examples/heatmap.component.ts @@ -15,7 +15,7 @@ import { " [zoom]="[3]" [center]="[-103.59179687498357, 40.66995747013945]" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" > @if (earthquakes) { `, diff --git a/projects/showcase/src/app/demo/examples/language-switch.component.ts b/projects/showcase/src/app/demo/examples/language-switch.component.ts index 78dbdae0..80fefc69 100644 --- a/projects/showcase/src/app/demo/examples/language-switch.component.ts +++ b/projects/showcase/src/app/demo/examples/language-switch.component.ts @@ -13,7 +13,7 @@ import { Map } from 'maplibre-gl'; [zoom]="[2.9]" [center]="[16.05, 48]" (mapLoad)="mapLoaded($event)" - [preserveDrawingBuffer]="true" + [canvasContextAttributes]="{preserveDrawingBuffer: true}" >