diff --git a/css/adminSettings.css b/css/adminSettings.css index e31b1279e..5e782953c 100644 --- a/css/adminSettings.css +++ b/css/adminSettings.css @@ -5,7 +5,8 @@ #graphhopperAPIKEY, #mapboxAPIKEY, #maplibreStreetStyleURL, -#maplibreStreetStyleAuth +#maplibreStreetStyleAuth, +#maplibreStreetStylePmtiles { width: 400px; } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 2fd2ac676..d73f36bb2 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -131,7 +131,8 @@ private function addCsp($response): void { 'osrmFootURL', 'graphhopperURL', 'maplibreStreetStyleURL', - 'maplibreStreetStyleAuth' + 'maplibreStreetStyleAuth', + 'maplibreStreetStylePmtiles' ]; foreach ($urlKeys as $key) { $url = $this->config->getAppValue('maps', $key); diff --git a/lib/Controller/PublicUtilsController.php b/lib/Controller/PublicUtilsController.php index 16f239fc9..546287e78 100644 --- a/lib/Controller/PublicUtilsController.php +++ b/lib/Controller/PublicUtilsController.php @@ -195,6 +195,7 @@ public function getOptionsValues(): DataResponse { 'mapboxAPIKEY', 'maplibreStreetStyleURL', 'maplibreStreetStyleAuth', + 'maplibreStreetStylePmtiles', 'graphhopperURL' ]; foreach ($settingsKeys as $k) { diff --git a/lib/Controller/UtilsController.php b/lib/Controller/UtilsController.php index 1d87b94c4..d8b7ecc68 100644 --- a/lib/Controller/UtilsController.php +++ b/lib/Controller/UtilsController.php @@ -134,6 +134,7 @@ public function getOptionsValues($myMapId = null): DataResponse { 'mapboxAPIKEY', 'maplibreStreetStyleURL', 'maplibreStreetStyleAuth', + 'maplibreStreetStylePmtiles', 'graphhopperURL' ]; foreach ($settingsKeys as $k) { @@ -159,6 +160,7 @@ public function setRoutingSettings($values): DataResponse { 'mapboxAPIKEY', 'maplibreStreetStyleURL', 'maplibreStreetStyleAuth', + 'maplibreStreetStylePmtiles', 'graphhopperURL' ]; foreach ($values as $k => $v) { diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php index 7baa601b9..6793e71d0 100644 --- a/lib/Settings/AdminSettings.php +++ b/lib/Settings/AdminSettings.php @@ -28,6 +28,7 @@ public function getForm() { 'mapboxAPIKEY', 'maplibreStreetStyleURL', 'maplibreStreetStyleAuth', + 'maplibreStreetStylePmtiles', 'graphhopperURL' ]; $parameters = []; diff --git a/package-lock.json b/package-lock.json index fd09ebb0d..3dc7d6c0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,9 +39,10 @@ "lrm-graphhopper": "^1.3.0", "mapbox-gl": "^3.13.0", "mapbox-gl-leaflet": "^0.0.16", - "maplibre-gl": "^5.6.1", + "maplibre-gl": "^5.16.0", "nouislider": "^15.8.1", "opening_hours": "^3.9.0", + "pmtiles": "^4.3.2", "ua-parser-js": "^2.0.5", "vue": "^2.7.16", "vue-click-outside": "^1.1.0", @@ -2049,7 +2050,9 @@ } }, "node_modules/@mapbox/tiny-sdf": { - "version": "2.0.6", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz", + "integrity": "sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==", "license": "BSD-2-Clause" }, "node_modules/@mapbox/unitbezier": { @@ -2070,6 +2073,12 @@ "node": ">=6.0.0" } }, + "node_modules/@maplibre/geojson-vt": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-5.0.4.tgz", + "integrity": "sha512-KGg9sma45S+stfH9vPCJk1J0lSDLWZgCT9Y8u8qWZJyjFlP8MNP1WGTxIMYJZjDvVT3PDn05kN1C95Sut1HpgQ==", + "license": "ISC" + }, "node_modules/@maplibre/maplibre-gl-leaflet": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-leaflet/-/maplibre-gl-leaflet-0.1.2.tgz", @@ -2081,7 +2090,9 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "23.3.0", + "version": "24.4.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-24.4.1.tgz", + "integrity": "sha512-UKhA4qv1h30XT768ccSv5NjNCX+dgfoq2qlLVmKejspPcSQTYD4SrVucgqegmYcKcmwf06wcNAa/kRd0NHWbUg==", "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", @@ -2098,6 +2109,65 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, + "node_modules/@maplibre/mlt": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@maplibre/mlt/-/mlt-1.1.2.tgz", + "integrity": "sha512-SQKdJ909VGROkA6ovJgtHNs9YXV4YXUPS+VaZ50I2Mt951SLlUm2Cv34x5Xwc1HiFlsd3h2Yrs5cn7xzqBmENw==", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "@mapbox/point-geometry": "^1.1.0" + } + }, + "node_modules/@maplibre/mlt/node_modules/@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==", + "license": "ISC" + }, + "node_modules/@maplibre/vt-pbf": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.2.1.tgz", + "integrity": "sha512-IxZBGq/+9cqf2qdWlFuQ+ZfoMhWpxDUGQZ/poPHOJBvwMUT1GuxLo6HgYTou+xxtsOsjfbcjI8PZaPCtmt97rA==", + "license": "MIT", + "dependencies": { + "@mapbox/point-geometry": "^1.1.0", + "@mapbox/vector-tile": "^2.0.4", + "@maplibre/geojson-vt": "^5.0.4", + "@types/geojson": "^7946.0.16", + "@types/supercluster": "^7.1.3", + "pbf": "^4.0.1", + "supercluster": "^8.0.1" + } + }, + "node_modules/@maplibre/vt-pbf/node_modules/@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==", + "license": "ISC" + }, + "node_modules/@maplibre/vt-pbf/node_modules/@mapbox/vector-tile": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.4.tgz", + "integrity": "sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^4.0.1" + } + }, + "node_modules/@maplibre/vt-pbf/node_modules/pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "license": "BSD-3-Clause", + "dependencies": { + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, "node_modules/@mdi/js": { "version": "7.4.47", "license": "Apache-2.0" @@ -5963,7 +6033,9 @@ } }, "node_modules/earcut": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", "license": "ISC" }, "node_modules/ee-first": { @@ -7106,6 +7178,12 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, "node_modules/file-entry-cache": { "version": "6.0.1", "dev": true, @@ -7448,7 +7526,9 @@ } }, "node_modules/gl-matrix": { - "version": "3.4.3", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz", + "integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==", "license": "MIT" }, "node_modules/glob": { @@ -7554,38 +7634,6 @@ "which": "bin/which" } }, - "node_modules/global-prefix": { - "version": "4.0.0", - "license": "MIT", - "dependencies": { - "ini": "^4.1.3", - "kind-of": "^6.0.3", - "which": "^4.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/global-prefix/node_modules/isexe": { - "version": "3.1.1", - "license": "ISC", - "engines": { - "node": ">=16" - } - }, - "node_modules/global-prefix/node_modules/which": { - "version": "4.0.0", - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^16.13.0 || >=18.0.0" - } - }, "node_modules/globals": { "version": "13.24.0", "dev": true, @@ -8196,13 +8244,6 @@ "license": "ISC", "peer": true }, - "node_modules/ini": { - "version": "4.1.3", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/inline-style-parser": { "version": "0.1.1", "license": "MIT" @@ -8953,6 +8994,8 @@ }, "node_modules/json-stringify-pretty-compact": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", "license": "MIT" }, "node_modules/json5": { @@ -8982,7 +9025,9 @@ }, "node_modules/kind-of": { "version": "6.0.3", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -9251,35 +9296,34 @@ } }, "node_modules/maplibre-gl": { - "version": "5.6.1", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.16.0.tgz", + "integrity": "sha512-/VDY89nr4jgLJyzmhy325cG6VUI02WkZ/UfVuDbG/piXzo6ODnM+omDFIwWY8tsEsBG26DNDmNMn3Y2ikHsBiA==", "license": "BSD-3-Clause", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/point-geometry": "^1.1.0", + "@mapbox/tiny-sdf": "^2.0.7", "@mapbox/unitbezier": "^0.0.1", - "@mapbox/vector-tile": "^1.3.1", + "@mapbox/vector-tile": "^2.0.4", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^23.3.0", + "@maplibre/maplibre-gl-style-spec": "^24.4.1", + "@maplibre/mlt": "^1.1.2", + "@maplibre/vt-pbf": "^4.2.0", "@types/geojson": "^7946.0.16", "@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.1", + "earcut": "^3.0.2", "geojson-vt": "^4.0.2", - "gl-matrix": "^3.4.3", - "global-prefix": "^4.0.0", + "gl-matrix": "^3.4.4", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", - "pbf": "^3.3.0", - "potpack": "^2.0.0", + "pbf": "^4.0.1", + "potpack": "^2.1.0", "quickselect": "^3.0.0", "supercluster": "^8.0.1", - "tinyqueue": "^3.0.0", - "vt-pbf": "^3.1.3" + "tinyqueue": "^3.0.0" }, "engines": { "node": ">=16.14.0", @@ -9289,6 +9333,35 @@ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, + "node_modules/maplibre-gl/node_modules/@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/@mapbox/vector-tile": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.4.tgz", + "integrity": "sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^4.0.1" + } + }, + "node_modules/maplibre-gl/node_modules/pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "license": "BSD-3-Clause", + "dependencies": { + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, "node_modules/martinez-polygon-clipping": { "version": "0.7.4", "license": "MIT", @@ -10789,6 +10862,15 @@ "node": ">=8" } }, + "node_modules/pmtiles": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-4.3.2.tgz", + "integrity": "sha512-Ath2F2U2E37QyNXjN1HOF+oLiNIbdrDYrk/K3C9K4Pgw2anwQX10y4WYWEH9O75vPiu0gBbSWIAbSG19svyvZg==", + "license": "BSD-3-Clause", + "dependencies": { + "fflate": "^0.8.2" + } + }, "node_modules/polyline": { "version": "0.0.3", "engines": { @@ -15982,7 +16064,9 @@ "version": "0.2.0" }, "@mapbox/tiny-sdf": { - "version": "2.0.6" + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz", + "integrity": "sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==" }, "@mapbox/unitbezier": { "version": "0.0.1" @@ -15996,6 +16080,11 @@ "@mapbox/whoots-js": { "version": "3.1.0" }, + "@maplibre/geojson-vt": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-5.0.4.tgz", + "integrity": "sha512-KGg9sma45S+stfH9vPCJk1J0lSDLWZgCT9Y8u8qWZJyjFlP8MNP1WGTxIMYJZjDvVT3PDn05kN1C95Sut1HpgQ==" + }, "@maplibre/maplibre-gl-leaflet": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-leaflet/-/maplibre-gl-leaflet-0.1.2.tgz", @@ -16003,7 +16092,9 @@ "requires": {} }, "@maplibre/maplibre-gl-style-spec": { - "version": "23.3.0", + "version": "24.4.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-24.4.1.tgz", + "integrity": "sha512-UKhA4qv1h30XT768ccSv5NjNCX+dgfoq2qlLVmKejspPcSQTYD4SrVucgqegmYcKcmwf06wcNAa/kRd0NHWbUg==", "requires": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", @@ -16014,6 +16105,60 @@ "tinyqueue": "^3.0.0" } }, + "@maplibre/mlt": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@maplibre/mlt/-/mlt-1.1.2.tgz", + "integrity": "sha512-SQKdJ909VGROkA6ovJgtHNs9YXV4YXUPS+VaZ50I2Mt951SLlUm2Cv34x5Xwc1HiFlsd3h2Yrs5cn7xzqBmENw==", + "requires": { + "@mapbox/point-geometry": "^1.1.0" + }, + "dependencies": { + "@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==" + } + } + }, + "@maplibre/vt-pbf": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.2.1.tgz", + "integrity": "sha512-IxZBGq/+9cqf2qdWlFuQ+ZfoMhWpxDUGQZ/poPHOJBvwMUT1GuxLo6HgYTou+xxtsOsjfbcjI8PZaPCtmt97rA==", + "requires": { + "@mapbox/point-geometry": "^1.1.0", + "@mapbox/vector-tile": "^2.0.4", + "@maplibre/geojson-vt": "^5.0.4", + "@types/geojson": "^7946.0.16", + "@types/supercluster": "^7.1.3", + "pbf": "^4.0.1", + "supercluster": "^8.0.1" + }, + "dependencies": { + "@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==" + }, + "@mapbox/vector-tile": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.4.tgz", + "integrity": "sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==", + "requires": { + "@mapbox/point-geometry": "~1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^4.0.1" + } + }, + "pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "requires": { + "resolve-protobuf-schema": "^2.1.0" + } + } + } + }, "@mdi/js": { "version": "7.4.47" }, @@ -18534,7 +18679,9 @@ } }, "earcut": { - "version": "3.0.1" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==" }, "ee-first": { "version": "1.1.1", @@ -19290,6 +19437,11 @@ "web-streams-polyfill": "^3.0.3" } }, + "fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==" + }, "file-entry-cache": { "version": "6.0.1", "dev": true, @@ -19508,7 +19660,9 @@ } }, "gl-matrix": { - "version": "3.4.3" + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz", + "integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==" }, "glob": { "version": "7.2.3", @@ -19587,25 +19741,6 @@ } } }, - "global-prefix": { - "version": "4.0.0", - "requires": { - "ini": "^4.1.3", - "kind-of": "^6.0.3", - "which": "^4.0.0" - }, - "dependencies": { - "isexe": { - "version": "3.1.1" - }, - "which": { - "version": "4.0.0", - "requires": { - "isexe": "^3.1.1" - } - } - } - }, "globals": { "version": "13.24.0", "dev": true, @@ -19984,9 +20119,6 @@ "dev": true, "peer": true }, - "ini": { - "version": "4.1.3" - }, "inline-style-parser": { "version": "0.1.1" }, @@ -20405,7 +20537,9 @@ "peer": true }, "json-stringify-pretty-compact": { - "version": "4.0.0" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==" }, "json5": { "version": "2.2.3", @@ -20424,7 +20558,9 @@ } }, "kind-of": { - "version": "6.0.3" + "version": "6.0.3", + "dev": true, + "peer": true }, "known-css-properties": { "version": "0.37.0", @@ -20627,34 +20763,58 @@ "requires": {} }, "maplibre-gl": { - "version": "5.6.1", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.16.0.tgz", + "integrity": "sha512-/VDY89nr4jgLJyzmhy325cG6VUI02WkZ/UfVuDbG/piXzo6ODnM+omDFIwWY8tsEsBG26DNDmNMn3Y2ikHsBiA==", "requires": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/point-geometry": "^1.1.0", + "@mapbox/tiny-sdf": "^2.0.7", "@mapbox/unitbezier": "^0.0.1", - "@mapbox/vector-tile": "^1.3.1", + "@mapbox/vector-tile": "^2.0.4", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^23.3.0", + "@maplibre/maplibre-gl-style-spec": "^24.4.1", + "@maplibre/mlt": "^1.1.2", + "@maplibre/vt-pbf": "^4.2.0", "@types/geojson": "^7946.0.16", "@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.1", + "earcut": "^3.0.2", "geojson-vt": "^4.0.2", - "gl-matrix": "^3.4.3", - "global-prefix": "^4.0.0", + "gl-matrix": "^3.4.4", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", - "pbf": "^3.3.0", - "potpack": "^2.0.0", + "pbf": "^4.0.1", + "potpack": "^2.1.0", "quickselect": "^3.0.0", "supercluster": "^8.0.1", - "tinyqueue": "^3.0.0", - "vt-pbf": "^3.1.3" + "tinyqueue": "^3.0.0" + }, + "dependencies": { + "@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==" + }, + "@mapbox/vector-tile": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.4.tgz", + "integrity": "sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==", + "requires": { + "@mapbox/point-geometry": "~1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^4.0.1" + } + }, + "pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "requires": { + "resolve-protobuf-schema": "^2.1.0" + } + } } }, "martinez-polygon-clipping": { @@ -21532,6 +21692,14 @@ } } }, + "pmtiles": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-4.3.2.tgz", + "integrity": "sha512-Ath2F2U2E37QyNXjN1HOF+oLiNIbdrDYrk/K3C9K4Pgw2anwQX10y4WYWEH9O75vPiu0gBbSWIAbSG19svyvZg==", + "requires": { + "fflate": "^0.8.2" + } + }, "polyline": { "version": "0.0.3" }, diff --git a/package.json b/package.json index 5e7de298a..70d1bf281 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,10 @@ "lrm-graphhopper": "^1.3.0", "mapbox-gl": "^3.13.0", "mapbox-gl-leaflet": "^0.0.16", - "maplibre-gl": "^5.6.1", + "maplibre-gl": "^5.16.0", "nouislider": "^15.8.1", "opening_hours": "^3.9.0", + "pmtiles": "^4.3.2", "ua-parser-js": "^2.0.5", "vue": "^2.7.16", "vue-click-outside": "^1.1.0", diff --git a/src/adminSettings.js b/src/adminSettings.js index 88d2fffd7..327a11420 100644 --- a/src/adminSettings.js +++ b/src/adminSettings.js @@ -45,8 +45,11 @@ $(document).ready(function() { var value = $(this).val(); setMapsRoutingSettings($(this).attr('id'), value); }); - $('body').on('change', '#osrmDEMO', function(e) { - var value = $(this).is(':checked') ? '1' : '0'; - setMapsRoutingSettings($(this).attr('id'), value); - }); + $('body').on('change', + '#osrmDEMO, ' + + '#maplibreStreetStylePmtiles', + function(e) { + var value = $(this).is(':checked') ? '1' : '0'; + setMapsRoutingSettings($(this).attr('id'), value); + }); }); diff --git a/src/components/Map.vue b/src/components/Map.vue index 4c461ff8a..99035517e 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -176,7 +176,9 @@ import L from 'leaflet' import 'mapbox-gl/dist/mapbox-gl' import 'mapbox-gl/dist/mapbox-gl.css' import 'mapbox-gl-leaflet/leaflet-mapbox-gl' +import { Protocol } from "pmtiles"; import '@maplibre/maplibre-gl-leaflet' +import { addProtocol } from 'maplibre-gl' import ResourceType from 'maplibre-gl' import { baseLayersByName, @@ -818,12 +820,20 @@ export default { } if ((gl !== null) - && ('maplibreStreetStyleURL' in this.optionValues && this.optionValues.maplibreStreetStyleURL !== '')) { + && ('maplibreStreetStyleURL' in this.optionValues + && this.optionValues.maplibreStreetStyleURL !== '')) { let token = null - if ('maplibreStreetStyleAuth' in this.optionValues && this.optionValues.maplibreStreetStyleAuth !== '') { + if ('maplibreStreetStyleAuth' in this.optionValues + && this.optionValues.maplibreStreetStyleAuth !== '') { token = this.optionValues.maplibreStreetStyleAuth } + if ('maplibreStreetStylePmtiles' in this.optionValues + && this.optionValues.maplibreStreetStylePmtiles === true) { + let protocol = new Protocol(); + addProtocol("pmtiles", protocol.tile); + } + // wrapper to make tile layer component correctly pass arguments L.myMaplibreGL = (url, options) => { if (token !== null) { diff --git a/templates/adminSettings.php b/templates/adminSettings.php index 0f895620c..35d7b964f 100644 --- a/templates/adminSettings.php +++ b/templates/adminSettings.php @@ -6,6 +6,10 @@ if (!isset($_['osrmDEMO']) || $_['osrmDEMO'] === '1') { $osrmDemoChecked = 'checked="checked"'; } +$mapPmtilesChecked = ''; +if (isset($_['maplibreStreetStylePmtiles']) && $_['maplibreStreetStylePmtiles'] == '1') { + $mapPmtilesChecked = 'checked="checked"'; +} ?>