From 855229851a2d1a85c64ac602326b6f7b82b42db1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:22:41 +0000 Subject: [PATCH] chore(deps): bump @watergis/maplibre-gl-export from 2.0.1 to 3.8.2 in /ui (#382) * chore(deps): bump @watergis/maplibre-gl-export in /ui Bumps [@watergis/maplibre-gl-export](https://github.com/watergis/maplibre-gl-export) from 2.0.1 to 3.8.2. - [Release notes](https://github.com/watergis/maplibre-gl-export/releases) - [Commits](https://github.com/watergis/maplibre-gl-export/compare/@watergis/maplibre-gl-export@2.0.1...@watergis/maplibre-gl-export@3.8.2) --- updated-dependencies: - dependency-name: "@watergis/maplibre-gl-export" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * feat: improve language detection in ExportControl --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Aschwanden --- ui/package.json | 2 +- ui/src/views/map/controls/ExportControl.tsx | 27 ++- ui/yarn.lock | 188 +++++++++++++++++++- 3 files changed, 208 insertions(+), 9 deletions(-) diff --git a/ui/package.json b/ui/package.json index 7b350f5e..dced5f04 100644 --- a/ui/package.json +++ b/ui/package.json @@ -13,7 +13,7 @@ "@turf/bearing": "^7.1.0", "@turf/center": "^7.1.0", "@turf/helpers": "^7.1.0", - "@watergis/maplibre-gl-export": "~2.0.1", + "@watergis/maplibre-gl-export": "~3.8.2", "bulma": "^1.0.2", "classnames": "^2.5.1", "dayjs": "^1.11.12", diff --git a/ui/src/views/map/controls/ExportControl.tsx b/ui/src/views/map/controls/ExportControl.tsx index c2b0f797..814088bf 100644 --- a/ui/src/views/map/controls/ExportControl.tsx +++ b/ui/src/views/map/controls/ExportControl.tsx @@ -1,5 +1,6 @@ -import { Format, MaplibreExportControl, PageOrientation, Size } from "@watergis/maplibre-gl-export"; +import { Language, Format, MaplibreExportControl, PageOrientation, Size } from "@watergis/maplibre-gl-export"; import '@watergis/maplibre-gl-export/dist/maplibre-gl-export.css'; +import i18next from "i18next"; import { ControlPosition, useControl } from "react-map-gl/maplibre"; export type ExportControlProps = { @@ -8,6 +9,18 @@ export type ExportControlProps = { // options: ConstructorParameters }; +function getLanguage(): Language { + switch (i18next.language) { + case "de": + return "de" + case "fr": + return "fr" + + default: + return "en" + } +} + function ExportControl(props: ExportControlProps): null { const { position } = props; useControl( @@ -19,6 +32,18 @@ function ExportControl(props: ExportControlProps): null { DPI: 300, Crosshair: false, PrintableArea: true, + Local: getLanguage(), + attributionOptions: { + style: { + "textSize": 16, + "textHaloColor": "#FFFFFF", + "textHaloWidth": 0.8, + "textColor": "#000000", + "fallbackTextFont": ["B612 Mono"] + }, + visibility: "visible", + position: "bottom-right" + } }), { position: position } ); diff --git a/ui/yarn.lock b/ui/yarn.lock index 5f456fa8..24d2d00e 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -3228,7 +3228,7 @@ __metadata: languageName: node linkType: hard -"@mapbox/tiny-sdf@npm:^2.0.5": +"@mapbox/tiny-sdf@npm:^2.0.5, @mapbox/tiny-sdf@npm:^2.0.6": version: 2.0.6 resolution: "@mapbox/tiny-sdf@npm:2.0.6" checksum: 10/61da9df5fea197137bb76c07cbf12336382d0e6fa84426558b05bffc53f27f6a6465cd09e6af7b50a7b0b7283b7b68f0dcc7f7dd05ef4d88658dc325163f422c @@ -3283,6 +3283,26 @@ __metadata: languageName: node linkType: hard +"@maplibre/maplibre-gl-style-spec@npm:^20.3.0": + version: 20.3.1 + resolution: "@maplibre/maplibre-gl-style-spec@npm:20.3.1" + dependencies: + "@mapbox/jsonlint-lines-primitives": "npm:~2.0.2" + "@mapbox/unitbezier": "npm:^0.0.1" + json-stringify-pretty-compact: "npm:^4.0.0" + minimist: "npm:^1.2.8" + quickselect: "npm:^2.0.0" + rw: "npm:^1.3.3" + sort-object: "npm:^3.0.3" + tinyqueue: "npm:^3.0.0" + 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 + checksum: 10/11478919e665c6a0be2c382d330f30bbf198a51131a54933f6a2767a2427b7af74a8e703254c1e4f636191b63a29ee0d3a4b84f4d4a6f3561e92a193b122c4b7 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -4185,6 +4205,15 @@ __metadata: languageName: node linkType: hard +"@types/geojson-vt@npm:3.2.5": + version: 3.2.5 + resolution: "@types/geojson-vt@npm:3.2.5" + dependencies: + "@types/geojson": "npm:*" + checksum: 10/3c77f52c4a82b8087d3e04b86a62027ad1dccf4d339df7c7c191cfcf288564e050b241664e072fc9fd3bb5b71e217dc0dcfb7c467bded4be303ab2b283612b72 + languageName: node + linkType: hard + "@types/geojson@npm:*, @types/geojson@npm:^7946.0.10": version: 7946.0.10 resolution: "@types/geojson@npm:7946.0.10" @@ -4192,6 +4221,13 @@ __metadata: languageName: node linkType: hard +"@types/geojson@npm:^7946.0.14": + version: 7946.0.14 + resolution: "@types/geojson@npm:7946.0.14" + checksum: 10/ae511bee6488ae3bd5a3a3347aedb0371e997b14225b8983679284e22fa4ebd88627c6e3ff8b08bf4cc35068cb29310c89427311ffc9322c255615821a922e71 + languageName: node + linkType: hard + "@types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" @@ -4317,6 +4353,13 @@ __metadata: languageName: node linkType: hard +"@types/mapbox__point-geometry@npm:^0.1.4": + version: 0.1.4 + resolution: "@types/mapbox__point-geometry@npm:0.1.4" + checksum: 10/d315f3e396bebd40f1cab682595f3d1c5ac46c5ddb080cf65dfcd0401dc6a3f235a7ac9ada2d28e6c49485fa5f231458f29fee87069e42a137e20e5865801dd1 + languageName: node + linkType: hard + "@types/mapbox__vector-tile@npm:^1.3.0": version: 1.3.0 resolution: "@types/mapbox__vector-tile@npm:1.3.0" @@ -4328,6 +4371,17 @@ __metadata: languageName: node linkType: hard +"@types/mapbox__vector-tile@npm:^1.3.4": + version: 1.3.4 + resolution: "@types/mapbox__vector-tile@npm:1.3.4" + dependencies: + "@types/geojson": "npm:*" + "@types/mapbox__point-geometry": "npm:*" + "@types/pbf": "npm:*" + checksum: 10/5715d9da88a5ecadb63e3ca4d52272ead2c1d63fcf616841932719788e458fc10dd9919ad01aa9c95b15c83e9074dae9ffc7193a7ae4ae7b8436d26630f0e269 + languageName: node + linkType: hard + "@types/mdast@npm:^4.0.0": version: 4.0.3 resolution: "@types/mdast@npm:4.0.3" @@ -4367,6 +4421,13 @@ __metadata: languageName: node linkType: hard +"@types/pbf@npm:^3.0.5": + version: 3.0.5 + resolution: "@types/pbf@npm:3.0.5" + checksum: 10/9115eb3cc61e535748dd6de98c7a8bd64e02a4052646796013b075fed66fd52a3a2aaae6b75648e9c0361e8ed462a50549ca0af1015e2e48296cd8c31bb54577 + languageName: node + linkType: hard + "@types/prop-types@npm:*": version: 15.7.5 resolution: "@types/prop-types@npm:15.7.5" @@ -4461,6 +4522,15 @@ __metadata: languageName: node linkType: hard +"@types/supercluster@npm:^7.1.3": + version: 7.1.3 + resolution: "@types/supercluster@npm:7.1.3" + dependencies: + "@types/geojson": "npm:*" + checksum: 10/e4c4e6174780ea68f4182b6d17f99d2651f9fb23f254c9ee6cfbb74025f75550057027f2c292662775377a53dd12af4b1908d0cecbe5b0f8490d1ce9fc6e726a + languageName: node + linkType: hard + "@types/trusted-types@npm:^2.0.2": version: 2.0.7 resolution: "@types/trusted-types@npm:2.0.7" @@ -4740,14 +4810,14 @@ __metadata: languageName: node linkType: hard -"@watergis/maplibre-gl-export@npm:~2.0.1": - version: 2.0.1 - resolution: "@watergis/maplibre-gl-export@npm:2.0.1" +"@watergis/maplibre-gl-export@npm:~3.8.2": + version: 3.8.2 + resolution: "@watergis/maplibre-gl-export@npm:3.8.2" dependencies: js-loading-overlay: "npm:^1.2.0" jspdf: "npm:^2.5.1" - maplibre-gl: "npm:^2.4.0" - checksum: 10/451abe9a389b8d30108e4fb24889ef70936a7944ebb40e1e440f792b3052023bcdbcf584e449b2428a963bbf13a273eece5537f407c9560627463febb03e4fa9 + maplibre-gl: "npm:^4.1.0" + checksum: 10/72122609c22ca327ca631462e2726547ee829d68fcc0655c41f9e4a467da58fa5b365bd71a22b69cf327bede7ebebf474dce2646c1bf83086a4dbd3e196795a0 languageName: node linkType: hard @@ -6382,6 +6452,13 @@ __metadata: languageName: node linkType: hard +"earcut@npm:^3.0.0": + version: 3.0.0 + resolution: "earcut@npm:3.0.0" + checksum: 10/4f7394a657c9789a1beb1be617d18eccf7fd9e1aa0a37fd4e8927000ece7f715bf126180d1a7ce562be35e2c4812ed7fe852a1bfe8e104ced31dee172173e547 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -7549,6 +7626,13 @@ __metadata: languageName: node linkType: hard +"geojson-vt@npm:^4.0.2": + version: 4.0.2 + resolution: "geojson-vt@npm:4.0.2" + checksum: 10/2a9e1894321184c48612221b4649d8cc5afa972962ee21b91c09b9d85d9076777164cce6f1d438d0bfb0c7d6b4713f518cf0501de210127f9a601e316197eb91 + languageName: node + linkType: hard + "get-caller-file@npm:^2.0.5": version: 2.0.5 resolution: "get-caller-file@npm:2.0.5" @@ -9606,6 +9690,13 @@ __metadata: languageName: node linkType: hard +"json-stringify-pretty-compact@npm:^4.0.0": + version: 4.0.0 + resolution: "json-stringify-pretty-compact@npm:4.0.0" + checksum: 10/a10d5c423e467872994a49c5c1b56b073f277ce02d899cf567fc625f3783b89406bee6408bfb3b4bdeeff509b6a562f5259227e26754a6186f721809ca895f0c + languageName: node + linkType: hard + "json5@npm:^2.2.0, json5@npm:^2.2.1, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" @@ -9684,6 +9775,13 @@ __metadata: languageName: node linkType: hard +"kdbush@npm:^4.0.2": + version: 4.0.2 + resolution: "kdbush@npm:4.0.2" + checksum: 10/ca1f7a106c129056044ab19851909efcc33680d568066872de996d3bc4d41f81d2a6423e577f20436d1a8b96a6f3c514af8cb94cc54a4d784d9df976b43066f8 + languageName: node + linkType: hard + "keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -10088,6 +10186,40 @@ __metadata: languageName: node linkType: hard +"maplibre-gl@npm:^4.1.0": + version: 4.5.2 + resolution: "maplibre-gl@npm:4.5.2" + dependencies: + "@mapbox/geojson-rewind": "npm:^0.5.2" + "@mapbox/jsonlint-lines-primitives": "npm:^2.0.2" + "@mapbox/point-geometry": "npm:^0.1.0" + "@mapbox/tiny-sdf": "npm:^2.0.6" + "@mapbox/unitbezier": "npm:^0.0.1" + "@mapbox/vector-tile": "npm:^1.3.1" + "@mapbox/whoots-js": "npm:^3.1.0" + "@maplibre/maplibre-gl-style-spec": "npm:^20.3.0" + "@types/geojson": "npm:^7946.0.14" + "@types/geojson-vt": "npm:3.2.5" + "@types/mapbox__point-geometry": "npm:^0.1.4" + "@types/mapbox__vector-tile": "npm:^1.3.4" + "@types/pbf": "npm:^3.0.5" + "@types/supercluster": "npm:^7.1.3" + earcut: "npm:^3.0.0" + geojson-vt: "npm:^4.0.2" + gl-matrix: "npm:^3.4.3" + global-prefix: "npm:^3.0.0" + kdbush: "npm:^4.0.2" + murmurhash-js: "npm:^1.0.0" + pbf: "npm:^3.3.0" + potpack: "npm:^2.0.0" + quickselect: "npm:^3.0.0" + supercluster: "npm:^8.0.1" + tinyqueue: "npm:^3.0.0" + vt-pbf: "npm:^3.1.3" + checksum: 10/112bdb65ced7751cb4ec3d5333e1ef38c6409ca21ad871098c3a6d218fbae21511ea0e6e250f5573ae8d8507e7384b912b9058be255e9a19b077022f9d7b2acc + languageName: node + linkType: hard + "material-colors@npm:^1.2.1": version: 1.2.6 resolution: "material-colors@npm:1.2.6" @@ -11197,6 +11329,18 @@ __metadata: languageName: node linkType: hard +"pbf@npm:^3.3.0": + version: 3.3.0 + resolution: "pbf@npm:3.3.0" + dependencies: + ieee754: "npm:^1.1.12" + resolve-protobuf-schema: "npm:^2.1.0" + bin: + pbf: bin/pbf + checksum: 10/46488694528740097c33443efa240ca7f99538a2b96e9fbd2284d9be45ec91dab6954b9c03df237656ac2757d7f046153a031ad24519b4cfcaa2e7b18ddeb5dd + languageName: node + linkType: hard + "performance-now@npm:^2.1.0": version: 2.1.0 resolution: "performance-now@npm:2.1.0" @@ -11304,6 +11448,13 @@ __metadata: languageName: node linkType: hard +"potpack@npm:^2.0.0": + version: 2.0.0 + resolution: "potpack@npm:2.0.0" + checksum: 10/6dd41692349936b436c29c28cf9ff1268c03ed6ec96c4384b2d9eb95e58e422fab75d428648f475507dd167934984d1002df2010b83e5747b5c358bea371e8f7 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -11468,6 +11619,13 @@ __metadata: languageName: node linkType: hard +"quickselect@npm:^3.0.0": + version: 3.0.0 + resolution: "quickselect@npm:3.0.0" + checksum: 10/8f72bedb8bb14bce5c3767c55f567bc296fa3ca9d98ba385e3867e434463bc633feee1eddf3dfec17914b7e88feeb08c7b313cf47114a8ff11bf964f77f51cfc + languageName: node + linkType: hard + "raf@npm:^3.4.1": version: 3.4.1 resolution: "raf@npm:3.4.1" @@ -12631,7 +12789,7 @@ __metadata: "@vite-pwa/assets-generator": "npm:^0.2.4" "@vitejs/plugin-react-swc": "npm:^3.7.0" "@vitest/coverage-v8": "npm:^2.0.5" - "@watergis/maplibre-gl-export": "npm:~2.0.1" + "@watergis/maplibre-gl-export": "npm:~3.8.2" bulma: "npm:^1.0.2" classnames: "npm:^2.5.1" dayjs: "npm:^1.11.12" @@ -13221,6 +13379,15 @@ __metadata: languageName: node linkType: hard +"supercluster@npm:^8.0.1": + version: 8.0.1 + resolution: "supercluster@npm:8.0.1" + dependencies: + kdbush: "npm:^4.0.2" + checksum: 10/3e517e54087fe24efa274013a5c116b0083d140d3cd855c5004fef61b64dde83510d2a65cd6565349b693751936aede2305f76d84778e6107ae1b3ffa18a5bae + languageName: node + linkType: hard + "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -13423,6 +13590,13 @@ __metadata: languageName: node linkType: hard +"tinyqueue@npm:^3.0.0": + version: 3.0.0 + resolution: "tinyqueue@npm:3.0.0" + checksum: 10/44195ae628e98f4de49acefac1fafa63a7f2b5d8a5c23ace6f49917109db3435db8ec9854f87c0d50f8a8c6a73f1526f3941921618a071e4ee1d246afacf69bb + languageName: node + linkType: hard + "tinyrainbow@npm:^1.2.0": version: 1.2.0 resolution: "tinyrainbow@npm:1.2.0"