From 2d0177af39445576af0652dc485a617c322f3143 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Fri, 13 Dec 2024 16:24:57 -0500 Subject: [PATCH 1/7] Adds basic map libre map. Uses geolocation. --- package-lock.json | 299 +++++++++++++++++- package.json | 1 + src/renderer/src/components/Map.tsx | 47 +++ .../src/contexts/SharedLocationContext.tsx | 91 ++++++ src/renderer/src/routes/(MapTabs)/_Map.tsx | 5 +- src/renderer/src/routes/__root.tsx | 9 +- 6 files changed, 433 insertions(+), 19 deletions(-) create mode 100644 src/renderer/src/components/Map.tsx create mode 100644 src/renderer/src/contexts/SharedLocationContext.tsx diff --git a/package-lock.json b/package-lock.json index 5692a26..8a8b79e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", + "maplibre-gl": "^4.7.1", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" @@ -51,7 +52,6 @@ "@tanstack/router-plugin": "^1.81.9", "@testing-library/dom": "10.4.0", "@testing-library/react": "16.1.0", - "@testing-library/user-event": "14.5.2", "@types/eslint__js": "^8.42.3", "@types/lint-staged": "^13.3.0", "@types/node": "^20.17.6", @@ -2789,6 +2789,31 @@ "node": ">= 12.13.0" } }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "license": "ISC", + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@mapbox/jsonlint-lines-primitives": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", @@ -2797,6 +2822,12 @@ "node": ">= 0.6" } }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", + "license": "ISC" + }, "node_modules/@mapbox/sphericalmercator": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@mapbox/sphericalmercator/-/sphericalmercator-1.2.0.tgz", @@ -2808,12 +2839,36 @@ "xyz": "bin/xyz.js" } }, + "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==", + "license": "BSD-2-Clause" + }, "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==", "license": "BSD-2-Clause" }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "license": "ISC", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@mapeo/crypto": { "version": "1.0.0-alpha.10", "resolved": "https://registry.npmjs.org/@mapeo/crypto/-/crypto-1.0.0-alpha.10.tgz", @@ -4335,20 +4390,6 @@ } } }, - "node_modules/@testing-library/user-event": { - "version": "14.5.2", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", - "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12", - "npm": ">=6" - }, - "peerDependencies": { - "@testing-library/dom": ">=7.21.4" - } - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -4559,6 +4600,15 @@ "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==", "license": "MIT" }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -4612,6 +4662,23 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", + "license": "MIT" + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" + } + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -4652,6 +4719,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/pbf": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", + "license": "MIT" + }, "node_modules/@types/prop-types": { "version": "15.7.13", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", @@ -4719,6 +4792,15 @@ "@types/node": "*" } }, + "node_modules/@types/supercluster": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -7696,6 +7778,12 @@ "stream-shift": "^1.0.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==", + "license": "ISC" + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -9668,6 +9756,12 @@ "node": ">=6.9.0" } }, + "node_modules/geojson-vt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", + "license": "ISC" + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -9802,6 +9896,12 @@ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", "license": "MIT" }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", + "license": "MIT" + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -11118,6 +11218,12 @@ "node": ">=8" } }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", + "license": "ISC" + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -11128,6 +11234,15 @@ "json-buffer": "3.0.1" } }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -11823,6 +11938,100 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/maplibre-gl": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", + "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "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/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", + "@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", + "geojson-vt": "^4.0.2", + "gl-matrix": "^3.4.3", + "global-prefix": "^4.0.0", + "kdbush": "^4.0.2", + "murmurhash-js": "^1.0.0", + "pbf": "^3.3.0", + "potpack": "^2.0.0", + "quickselect": "^3.0.0", + "supercluster": "^8.0.1", + "tinyqueue": "^3.0.0", + "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, + "node_modules/maplibre-gl/node_modules/global-prefix": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", + "license": "MIT", + "dependencies": { + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/maplibre-gl/node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/maplibre-gl/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/maplibre-gl/node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "license": "ISC" + }, + "node_modules/maplibre-gl/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, "node_modules/matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -12701,6 +12910,12 @@ "imul": "^1.0.0" } }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "license": "MIT" + }, "node_modules/mutexify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.4.0.tgz", @@ -13670,6 +13885,19 @@ "node": ">= 14.16" } }, + "node_modules/pbf": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, "node_modules/pe-library": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pe-library/-/pe-library-1.0.1.tgz", @@ -13917,6 +14145,12 @@ "node": "^12.20.0 || >=14" } }, + "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==", + "license": "ISC" + }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -14181,6 +14415,12 @@ "integrity": "sha512-gC13b/bWrqQoKY2EmROCZ+AR0jitc6DnDGaQ6Ls9QpKmuSgJB1eQ7H3KETtQm7qSdMWMKCmsshyCmUwMLh3OAA==", "license": "MIT" }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "license": "MIT" + }, "node_modules/protomux": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/protomux/-/protomux-3.10.0.tgz", @@ -14847,6 +15087,15 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "license": "MIT", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -16370,6 +16619,15 @@ "node": ">= 8.0" } }, + "node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "license": "ISC", + "dependencies": { + "kdbush": "^4.0.2" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -17946,6 +18204,17 @@ } } }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "license": "MIT", + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", diff --git a/package.json b/package.json index d2f9620..07c6c34 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", + "maplibre-gl": "^4.7.1", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" diff --git a/src/renderer/src/components/Map.tsx b/src/renderer/src/components/Map.tsx new file mode 100644 index 0000000..689134f --- /dev/null +++ b/src/renderer/src/components/Map.tsx @@ -0,0 +1,47 @@ +import React, { useEffect, useRef } from 'react' + +import 'maplibre-gl/dist/maplibre-gl.css' + +import maplibregl from 'maplibre-gl' + +import { useSharedLocationContext } from '../contexts/SharedLocationContext' + +export const Map = () => { + const mapContainerRef = useRef(null) + const mapRef = useRef(null) + const { location, isLoading } = useSharedLocationContext() + + useEffect(() => { + if (!mapContainerRef.current) return + const map = new maplibregl.Map({ + container: mapContainerRef.current, + style: 'https://demotiles.maplibre.org/style.json', + center: [0, 0], + zoom: 2, + }) + + // not sure if this is necessary. not in the designs. + map.addControl( + new maplibregl.ScaleControl({ maxWidth: 100, unit: 'metric' }), + 'bottom-left', + ) + + mapRef.current = map + + return () => { + map.remove() + } + }, []) + + useEffect(() => { + if (!isLoading && location && mapRef.current) { + mapRef.current.setCenter([ + location.coords.longitude, + location.coords.latitude, + ]) + mapRef.current.setZoom(12) + } + }, [location, isLoading]) + + return
+} diff --git a/src/renderer/src/contexts/SharedLocationContext.tsx b/src/renderer/src/contexts/SharedLocationContext.tsx new file mode 100644 index 0000000..31fa18f --- /dev/null +++ b/src/renderer/src/contexts/SharedLocationContext.tsx @@ -0,0 +1,91 @@ +import React, { createContext, useContext, useEffect, useState } from 'react' + +interface Location { + coords: { + latitude: number + longitude: number + } +} +interface SharedLocationContextValue { + location: Location | null + error: Error | null + isLoading: boolean +} + +const SharedLocationContext = createContext( + null, +) + +export const SharedLocationContextProvider = ({ + children, +}: { + children: React.ReactNode +}) => { + const [location, setLocation] = useState(null) + const [error, setError] = useState(null) + const [isLoading, setIsLoading] = useState(true) + + useEffect(() => { + async function fetchLocation() { + setIsLoading(true) + + if ('geolocation' in navigator) { + navigator.geolocation.getCurrentPosition( + (pos) => { + setLocation({ + coords: { + latitude: pos.coords.latitude, + longitude: pos.coords.longitude, + }, + }) + setIsLoading(false) + }, + (err) => { + console.warn('Geolocation failed, fallback to IP-based:', err) + fetchIPLocation() + }, + { timeout: 5000 }, + ) + } else { + fetchIPLocation() + } + } + + async function fetchIPLocation() { + try { + const res = await fetch('https://ipapi.co/json/') + if (!res.ok) throw new Error('IP geolocation request failed') + const data = await res.json() + if (data && data.latitude && data.longitude) { + setLocation({ + coords: { latitude: data.latitude, longitude: data.longitude }, + }) + } else { + setError(new Error('Could not retrieve IP-based location')) + } + } catch (e: unknown) { + setError(e as Error) + } finally { + setIsLoading(false) + } + } + + fetchLocation() + }, []) + + return ( + + {children} + + ) +} + +export function useSharedLocationContext() { + const context = useContext(SharedLocationContext) + if (!context) { + throw new Error( + 'useSharedLocationContext must be used within a SharedLocationContextProvider', + ) + } + return context +} diff --git a/src/renderer/src/routes/(MapTabs)/_Map.tsx b/src/renderer/src/routes/(MapTabs)/_Map.tsx index 70826f1..893be30 100644 --- a/src/renderer/src/routes/(MapTabs)/_Map.tsx +++ b/src/renderer/src/routes/(MapTabs)/_Map.tsx @@ -4,6 +4,7 @@ import { styled } from '@mui/material/styles' import { Outlet, createFileRoute } from '@tanstack/react-router' import { VERY_LIGHT_GREY, WHITE } from '../../colors' +import { Map } from '../../components/Map' import { Tabs } from '../../components/Tabs' const Container = styled('div')({ @@ -35,7 +36,9 @@ export function MapLayout() {
}> -
map component here
+
+ +
) diff --git a/src/renderer/src/routes/__root.tsx b/src/renderer/src/routes/__root.tsx index 7f8173e..ad9a86c 100644 --- a/src/renderer/src/routes/__root.tsx +++ b/src/renderer/src/routes/__root.tsx @@ -7,6 +7,7 @@ import { Outlet, createRootRoute } from '@tanstack/react-router' import { theme } from '../Theme' import { ApiProvider } from '../contexts/ApiContext' import { IntlProvider } from '../contexts/IntlContext' +import { SharedLocationContextProvider } from '../contexts/SharedLocationContext' const queryClient = new QueryClient() @@ -17,9 +18,11 @@ export const Route = createRootRoute({ - }> - - + + }> + + + From f7b8f46c5aa1034f9459c69a839466a16e9dfc95 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Fri, 13 Dec 2024 17:07:35 -0500 Subject: [PATCH 2/7] Adjusts the map test to test the tabs and not the map because web workers don't exist by default in a test environment --- src/renderer/src/routes/(MapTabs)/_Map.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/routes/(MapTabs)/_Map.test.tsx b/src/renderer/src/routes/(MapTabs)/_Map.test.tsx index 34a7182..8a2f953 100644 --- a/src/renderer/src/routes/(MapTabs)/_Map.test.tsx +++ b/src/renderer/src/routes/(MapTabs)/_Map.test.tsx @@ -6,7 +6,7 @@ import { createRouter, } from '@tanstack/react-router' import { render, screen } from '@testing-library/react' -import { expect, test } from 'vitest' +import { expect, test, vi } from 'vitest' import { IntlProvider } from '../../contexts/IntlContext' import { MapLayout } from './_Map' @@ -33,8 +33,10 @@ const catchAllRoute = createRoute({ const routeTree = rootRoute.addChildren([mapRoute.addChildren([catchAllRoute])]) const router = createRouter({ routeTree }) - test('clicking tabs navigate to correct tab', () => { + vi.mock('../../components/Map', () => ({ + Map: () =>
Mocked Map
, + })) // @ts-expect-error - typings render(, { wrapper: Wrapper }) const settingsButton = screen.getByText('Settings') From 776ec65f5398df33654df09df13112b2ac730917 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Tue, 7 Jan 2025 09:38:00 -0500 Subject: [PATCH 3/7] Removes location for mapping. Uses react maplibre plugin wrapper for map libre. --- package-lock.json | 296 ++++++++++++++++-- package.json | 3 +- src/renderer/src/App.tsx | 5 +- src/renderer/src/components/Map.tsx | 75 ++--- .../src/contexts/SharedLocationContext.tsx | 91 ------ 5 files changed, 313 insertions(+), 157 deletions(-) delete mode 100644 src/renderer/src/contexts/SharedLocationContext.tsx diff --git a/package-lock.json b/package-lock.json index 5c2a320..fcd9ed6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,12 +14,13 @@ "@comapeo/ipc": "2.0.2", "@formatjs/intl": "^3.0.1", "@mapeo/default-config": "5.0.0", + "@vis.gl/react-maplibre": "^1.0.0-alpha.4", "debug": "^4.3.7", "dotenv": "^16.4.5", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", - "maplibre-gl": "^4.7.1", + "maplibre-gl": "^5.0.0", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" @@ -4613,9 +4614,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==", "license": "MIT" }, "node_modules/@types/geojson-vt": { @@ -5056,6 +5057,45 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@vis.gl/react-maplibre": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@vis.gl/react-maplibre/-/react-maplibre-1.0.0-alpha.4.tgz", + "integrity": "sha512-MWz0lNaSJVHQYgZDZv72GdtHly6ySg2UhqW4JkluH7dtUZ//MFMzd3mfcxZvlwG9mNhnxjL+wfYTXKEaDub3Gw==", + "license": "MIT", + "dependencies": { + "@maplibre/maplibre-gl-style-spec": "^19.2.1" + }, + "peerDependencies": { + "maplibre-gl": ">=4.0.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, + "node_modules/@vis.gl/react-maplibre/node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.3.3", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.3.tgz", + "integrity": "sha512-cOZZOVhDSulgK0meTsTkmNXb1ahVvmTmWmfx9gRBwc6hq98wS9JP35ESIoNq3xqEan+UN+gn8187Z6E4NKhLsw==", + "license": "ISC", + "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/@vis.gl/react-maplibre/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==", + "license": "MIT" + }, "node_modules/@vitejs/plugin-react": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.3.tgz", @@ -5830,6 +5870,15 @@ "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==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/asar": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/asar/-/asar-3.2.0.tgz", @@ -5875,6 +5924,15 @@ "node": ">=12" } }, + "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==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -6317,6 +6375,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "dependencies": { + "typewise-core": "^1.2" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -7786,9 +7863,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==", "license": "ISC" }, "node_modules/eastasianwidth": { @@ -9202,6 +9279,18 @@ "dev": true, "license": "Apache-2.0" }, + "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==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -9899,6 +9988,15 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -10680,6 +10778,15 @@ "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==", + "license": "MIT", + "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", @@ -10837,6 +10944,18 @@ "b4a": "^1.1.1" } }, + "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==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -10926,6 +11045,15 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -10945,7 +11073,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "devOptional": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -11787,7 +11914,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "devOptional": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -11948,9 +12074,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", - "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.0.0.tgz", + "integrity": "sha512-WG8IYFK2gfJYXvWjlqg1yavo/YO/JlNkblAJMt19sjIafP5oJzTgXFiOLUIYkjtrv5pKiAWuSYsx4CD3ithJqw==", "license": "BSD-3-Clause", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", @@ -11960,14 +12086,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", @@ -11988,6 +12114,26 @@ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, + "node_modules/maplibre-gl/node_modules/@maplibre/maplibre-gl-style-spec": { + "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==", + "license": "ISC", + "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": "^3.0.0", + "rw": "^1.3.3", + "tinyqueue": "^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" + } + }, "node_modules/maplibre-gl/node_modules/global-prefix": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", @@ -14628,7 +14774,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "devOptional": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -14641,7 +14786,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", @@ -15480,7 +15624,6 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -15566,6 +15709,21 @@ "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==", + "license": "MIT", + "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", @@ -15862,6 +16020,41 @@ "atomic-sleep": "^1.0.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==", + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "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.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -15939,6 +16132,43 @@ "dev": true, "license": "CC0-1.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==", + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -17679,6 +17909,21 @@ "typescript": ">=4.8.4 <5.8.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==", + "license": "MIT", + "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==", + "license": "MIT" + }, "node_modules/uint8array-extras": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz", @@ -17706,6 +17951,21 @@ "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "license": "MIT" }, + "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==", + "license": "MIT", + "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": "2.0.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", diff --git a/package.json b/package.json index 12b9a66..5c5082a 100644 --- a/package.json +++ b/package.json @@ -55,12 +55,13 @@ "@comapeo/ipc": "2.0.2", "@formatjs/intl": "^3.0.1", "@mapeo/default-config": "5.0.0", + "@vis.gl/react-maplibre": "^1.0.0-alpha.4", "debug": "^4.3.7", "dotenv": "^16.4.5", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", - "maplibre-gl": "^4.7.1", + "maplibre-gl": "^5.0.0", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 357ead1..eb67abb 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -9,7 +9,6 @@ import { } from './contexts/ActiveProjectIdProvider' import { ApiProvider } from './contexts/ApiContext' import { IntlProvider } from './contexts/IntlContext' -import { SharedLocationContextProvider } from './contexts/SharedLocationContext' import { routeTree } from './routeTree.gen' const queryClient = new QueryClient() @@ -33,9 +32,7 @@ export const App = () => ( - - - + diff --git a/src/renderer/src/components/Map.tsx b/src/renderer/src/components/Map.tsx index 689134f..9e13207 100644 --- a/src/renderer/src/components/Map.tsx +++ b/src/renderer/src/components/Map.tsx @@ -1,47 +1,36 @@ -import React, { useEffect, useRef } from 'react' - -import 'maplibre-gl/dist/maplibre-gl.css' - +import React from 'react' +import { Map as ReactMaplibre } from '@vis.gl/react-maplibre' import maplibregl from 'maplibre-gl' -import { useSharedLocationContext } from '../contexts/SharedLocationContext' - -export const Map = () => { - const mapContainerRef = useRef(null) - const mapRef = useRef(null) - const { location, isLoading } = useSharedLocationContext() - - useEffect(() => { - if (!mapContainerRef.current) return - const map = new maplibregl.Map({ - container: mapContainerRef.current, - style: 'https://demotiles.maplibre.org/style.json', - center: [0, 0], - zoom: 2, - }) - - // not sure if this is necessary. not in the designs. - map.addControl( - new maplibregl.ScaleControl({ maxWidth: 100, unit: 'metric' }), - 'bottom-left', - ) - - mapRef.current = map - - return () => { - map.remove() - } - }, []) - - useEffect(() => { - if (!isLoading && location && mapRef.current) { - mapRef.current.setCenter([ - location.coords.longitude, - location.coords.latitude, - ]) - mapRef.current.setZoom(12) - } - }, [location, isLoading]) +import 'maplibre-gl/dist/maplibre-gl.css' - return
+import { useMapStyleUrl } from '@comapeo/core-react' + +export function Map() { + const styleUrlQuery = useMapStyleUrl() + const styleUrl = + styleUrlQuery.data ?? 'https://demotiles.maplibre.org/style.json' + const center = [-72.312023, -10.38787] + + return ( + { + console.error('Map error:', evt.error) + }} + onLoad={() => { + console.log('Map loaded successfully!') + }} + /> + ) } diff --git a/src/renderer/src/contexts/SharedLocationContext.tsx b/src/renderer/src/contexts/SharedLocationContext.tsx deleted file mode 100644 index 31fa18f..0000000 --- a/src/renderer/src/contexts/SharedLocationContext.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import React, { createContext, useContext, useEffect, useState } from 'react' - -interface Location { - coords: { - latitude: number - longitude: number - } -} -interface SharedLocationContextValue { - location: Location | null - error: Error | null - isLoading: boolean -} - -const SharedLocationContext = createContext( - null, -) - -export const SharedLocationContextProvider = ({ - children, -}: { - children: React.ReactNode -}) => { - const [location, setLocation] = useState(null) - const [error, setError] = useState(null) - const [isLoading, setIsLoading] = useState(true) - - useEffect(() => { - async function fetchLocation() { - setIsLoading(true) - - if ('geolocation' in navigator) { - navigator.geolocation.getCurrentPosition( - (pos) => { - setLocation({ - coords: { - latitude: pos.coords.latitude, - longitude: pos.coords.longitude, - }, - }) - setIsLoading(false) - }, - (err) => { - console.warn('Geolocation failed, fallback to IP-based:', err) - fetchIPLocation() - }, - { timeout: 5000 }, - ) - } else { - fetchIPLocation() - } - } - - async function fetchIPLocation() { - try { - const res = await fetch('https://ipapi.co/json/') - if (!res.ok) throw new Error('IP geolocation request failed') - const data = await res.json() - if (data && data.latitude && data.longitude) { - setLocation({ - coords: { latitude: data.latitude, longitude: data.longitude }, - }) - } else { - setError(new Error('Could not retrieve IP-based location')) - } - } catch (e: unknown) { - setError(e as Error) - } finally { - setIsLoading(false) - } - } - - fetchLocation() - }, []) - - return ( - - {children} - - ) -} - -export function useSharedLocationContext() { - const context = useContext(SharedLocationContext) - if (!context) { - throw new Error( - 'useSharedLocationContext must be used within a SharedLocationContextProvider', - ) - } - return context -} From c810576d4d35c5a477f3534f889bdc4b5b61222b Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Tue, 7 Jan 2025 09:51:42 -0500 Subject: [PATCH 4/7] Adds patch to allow CORS. --- ...map-setup.patch => @comapeo+core+2.1.0.patch} | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) rename patches/{@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch => @comapeo+core+2.1.0.patch} (57%) diff --git a/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch b/patches/@comapeo+core+2.1.0.patch similarity index 57% rename from patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch rename to patches/@comapeo+core+2.1.0.patch index a3b842c..60d9cf0 100644 --- a/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch +++ b/patches/@comapeo+core+2.1.0.patch @@ -1,8 +1,20 @@ diff --git a/node_modules/@comapeo/core/src/fastify-plugins/maps.js b/node_modules/@comapeo/core/src/fastify-plugins/maps.js -index d3df66e..b53baad 100644 +index d3df66e..a574f60 100644 --- a/node_modules/@comapeo/core/src/fastify-plugins/maps.js +++ b/node_modules/@comapeo/core/src/fastify-plugins/maps.js -@@ -86,13 +86,14 @@ export async function plugin(fastify, opts) { +@@ -22,6 +22,11 @@ export const FALLBACK_MAP_PREFIX = 'fallback' + + /** @type {FastifyPluginAsync} */ + export async function plugin(fastify, opts) { ++ fastify.addHook('onSend', (request, reply, payload, done) => { ++ reply.header('Access-Control-Allow-Origin', '*') ++ reply.header('Access-Control-Allow-Methods', 'GET, OPTIONS') ++ done() ++ }) + if (opts.customMapPath) { + const { customMapPath } = opts + +@@ -86,13 +91,14 @@ export async function plugin(fastify, opts) { }) } From 3e40dede529311c5601462203c4815936754cfd3 Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Tue, 7 Jan 2025 11:54:22 -0500 Subject: [PATCH 5/7] Removes patch. Uses map libre style as map libre not compatible with mapbox styles. --- ...0+001+fix-smp-fallback-map-setup.patch.patch} | 16 ++-------------- src/renderer/src/components/Map.tsx | 9 ++------- 2 files changed, 4 insertions(+), 21 deletions(-) rename patches/{@comapeo+core+2.1.0.patch => @comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch} (57%) diff --git a/patches/@comapeo+core+2.1.0.patch b/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch similarity index 57% rename from patches/@comapeo+core+2.1.0.patch rename to patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch index 60d9cf0..a3b842c 100644 --- a/patches/@comapeo+core+2.1.0.patch +++ b/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch @@ -1,20 +1,8 @@ diff --git a/node_modules/@comapeo/core/src/fastify-plugins/maps.js b/node_modules/@comapeo/core/src/fastify-plugins/maps.js -index d3df66e..a574f60 100644 +index d3df66e..b53baad 100644 --- a/node_modules/@comapeo/core/src/fastify-plugins/maps.js +++ b/node_modules/@comapeo/core/src/fastify-plugins/maps.js -@@ -22,6 +22,11 @@ export const FALLBACK_MAP_PREFIX = 'fallback' - - /** @type {FastifyPluginAsync} */ - export async function plugin(fastify, opts) { -+ fastify.addHook('onSend', (request, reply, payload, done) => { -+ reply.header('Access-Control-Allow-Origin', '*') -+ reply.header('Access-Control-Allow-Methods', 'GET, OPTIONS') -+ done() -+ }) - if (opts.customMapPath) { - const { customMapPath } = opts - -@@ -86,13 +91,14 @@ export async function plugin(fastify, opts) { +@@ -86,13 +86,14 @@ export async function plugin(fastify, opts) { }) } diff --git a/src/renderer/src/components/Map.tsx b/src/renderer/src/components/Map.tsx index 9e13207..5645e0c 100644 --- a/src/renderer/src/components/Map.tsx +++ b/src/renderer/src/components/Map.tsx @@ -4,12 +4,7 @@ import maplibregl from 'maplibre-gl' import 'maplibre-gl/dist/maplibre-gl.css' -import { useMapStyleUrl } from '@comapeo/core-react' - export function Map() { - const styleUrlQuery = useMapStyleUrl() - const styleUrl = - styleUrlQuery.data ?? 'https://demotiles.maplibre.org/style.json' const center = [-72.312023, -10.38787] return ( @@ -18,13 +13,13 @@ export function Map() { initialViewState={{ longitude: center[0], latitude: center[1], - zoom: 12, + zoom: 6, }} dragPan={true} scrollZoom={true} doubleClickZoom={true} style={{ width: '100%', height: '100%' }} - mapStyle={styleUrl} + mapStyle="https://demotiles.maplibre.org/style.json" onError={(evt) => { console.error('Map error:', evt.error) }} From 652142d1a9437cee739531b80d162a2e3576852c Mon Sep 17 00:00:00 2001 From: Cindy Green Date: Tue, 7 Jan 2025 13:34:52 -0500 Subject: [PATCH 6/7] Pins exact version of packages. Removes unnecessary map libre prop. Fixes naming of patch package. --- package-lock.json | 61 ++++++++++++++++++- package.json | 4 +- ....1.0+001+fix-smp-fallback-map-setup.patch} | 0 src/renderer/src/components/Map.tsx | 6 +- 4 files changed, 63 insertions(+), 8 deletions(-) rename patches/{@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch => @comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch} (100%) diff --git a/package-lock.json b/package-lock.json index fcd9ed6..1964848 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,13 +14,11 @@ "@comapeo/ipc": "2.0.2", "@formatjs/intl": "^3.0.1", "@mapeo/default-config": "5.0.0", - "@vis.gl/react-maplibre": "^1.0.0-alpha.4", "debug": "^4.3.7", "dotenv": "^16.4.5", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", - "maplibre-gl": "^5.0.0", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" @@ -60,6 +58,7 @@ "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/sodium-native": "^2.3.9", + "@vis.gl/react-maplibre": "1.0.0-alpha.4", "@vitejs/plugin-react": "^4.3.3", "electron": "33.2.0", "eslint": "9.17.0", @@ -67,6 +66,7 @@ "husky": "^9.1.7", "jsdom": "25.0.1", "lint-staged": "^15.2.10", + "maplibre-gl": "5.0.0", "npm-run-all2": "^7.0.1", "patch-package": "^8.0.0", "prettier": "^3.3.3", @@ -2812,6 +2812,7 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "dev": true, "license": "ISC", "dependencies": { "get-stream": "^6.0.1", @@ -2825,6 +2826,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -2845,6 +2847,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", + "dev": true, "license": "ISC" }, "node_modules/@mapbox/sphericalmercator": { @@ -2862,6 +2865,7 @@ "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==", + "dev": true, "license": "BSD-2-Clause" }, "node_modules/@mapbox/unitbezier": { @@ -2874,6 +2878,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "@mapbox/point-geometry": "~0.1.0" @@ -2883,6 +2888,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "dev": true, "license": "ISC", "engines": { "node": ">=6.0.0" @@ -4623,6 +4629,7 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "dev": true, "license": "MIT", "dependencies": { "@types/geojson": "*" @@ -4685,12 +4692,14 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", + "dev": true, "license": "MIT" }, "node_modules/@types/mapbox__vector-tile": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "dev": true, "license": "MIT", "dependencies": { "@types/geojson": "*", @@ -4742,6 +4751,7 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", + "dev": true, "license": "MIT" }, "node_modules/@types/prop-types": { @@ -4815,6 +4825,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "dev": true, "license": "MIT", "dependencies": { "@types/geojson": "*" @@ -5061,6 +5072,7 @@ "version": "1.0.0-alpha.4", "resolved": "https://registry.npmjs.org/@vis.gl/react-maplibre/-/react-maplibre-1.0.0-alpha.4.tgz", "integrity": "sha512-MWz0lNaSJVHQYgZDZv72GdtHly6ySg2UhqW4JkluH7dtUZ//MFMzd3mfcxZvlwG9mNhnxjL+wfYTXKEaDub3Gw==", + "dev": true, "license": "MIT", "dependencies": { "@maplibre/maplibre-gl-style-spec": "^19.2.1" @@ -5075,6 +5087,7 @@ "version": "19.3.3", "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.3.tgz", "integrity": "sha512-cOZZOVhDSulgK0meTsTkmNXb1ahVvmTmWmfx9gRBwc6hq98wS9JP35ESIoNq3xqEan+UN+gn8187Z6E4NKhLsw==", + "dev": true, "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", @@ -5094,6 +5107,7 @@ "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==", + "dev": true, "license": "MIT" }, "node_modules/@vitejs/plugin-react": { @@ -5874,6 +5888,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5928,6 +5943,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6379,6 +6395,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "dev": true, "license": "MIT", "dependencies": { "bytewise-core": "^1.2.2", @@ -6389,6 +6406,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "dev": true, "license": "MIT", "dependencies": { "typewise-core": "^1.2" @@ -7866,6 +7884,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz", "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw==", + "dev": true, "license": "ISC" }, "node_modules/eastasianwidth": { @@ -9283,6 +9302,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" @@ -9858,6 +9878,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", + "dev": true, "license": "ISC" }, "node_modules/get-caller-file": { @@ -9992,6 +10013,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10007,6 +10029,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", + "dev": true, "license": "MIT" }, "node_modules/glob": { @@ -10782,6 +10805,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10948,6 +10972,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, "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -11049,6 +11074,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11073,6 +11099,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "devOptional": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -11358,6 +11385,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", + "dev": true, "license": "ISC" }, "node_modules/keyv": { @@ -11374,6 +11402,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11914,6 +11943,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "devOptional": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -12077,6 +12107,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.0.0.tgz", "integrity": "sha512-WG8IYFK2gfJYXvWjlqg1yavo/YO/JlNkblAJMt19sjIafP5oJzTgXFiOLUIYkjtrv5pKiAWuSYsx4CD3ithJqw==", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", @@ -12118,6 +12149,7 @@ "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==", + "dev": true, "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", @@ -12138,6 +12170,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", + "dev": true, "license": "MIT", "dependencies": { "ini": "^4.1.3", @@ -12152,6 +12185,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "dev": true, "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -12161,6 +12195,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, "license": "ISC", "engines": { "node": ">=16" @@ -12170,12 +12205,14 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "dev": true, "license": "ISC" }, "node_modules/maplibre-gl/node_modules/which": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, "license": "ISC", "dependencies": { "isexe": "^3.1.1" @@ -13069,6 +13106,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "dev": true, "license": "MIT" }, "node_modules/mutexify": { @@ -14044,6 +14082,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "ieee754": "^1.1.12", @@ -14304,6 +14343,7 @@ "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==", + "dev": true, "license": "ISC" }, "node_modules/prebuild-install": { @@ -14574,6 +14614,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "dev": true, "license": "MIT" }, "node_modules/protomux": { @@ -14774,6 +14815,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "devOptional": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -14786,6 +14828,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", @@ -15244,6 +15287,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "dev": true, "license": "MIT", "dependencies": { "protocol-buffers-schema": "^3.3.1" @@ -15624,6 +15668,7 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -15713,6 +15758,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", @@ -16024,6 +16070,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16033,6 +16080,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16042,6 +16090,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "dev": true, "license": "MIT", "dependencies": { "bytewise": "^1.1.0", @@ -16136,6 +16185,7 @@ "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==", + "dev": true, "license": "MIT", "dependencies": { "extend-shallow": "^3.0.0" @@ -16148,6 +16198,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dev": true, "license": "MIT", "dependencies": { "assign-symbols": "^1.0.0", @@ -16161,6 +16212,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4" @@ -16863,6 +16915,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "dev": true, "license": "ISC", "dependencies": { "kdbush": "^4.0.2" @@ -17913,6 +17966,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "dev": true, "license": "MIT", "dependencies": { "typewise-core": "^1.2.0" @@ -17922,6 +17976,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==", + "dev": true, "license": "MIT" }, "node_modules/uint8array-extras": { @@ -17955,6 +18010,7 @@ "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==", + "dev": true, "license": "MIT", "dependencies": { "arr-union": "^3.1.0", @@ -18484,6 +18540,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "dev": true, "license": "MIT", "dependencies": { "@mapbox/point-geometry": "0.1.0", diff --git a/package.json b/package.json index 5c5082a..aa200ef 100644 --- a/package.json +++ b/package.json @@ -55,13 +55,11 @@ "@comapeo/ipc": "2.0.2", "@formatjs/intl": "^3.0.1", "@mapeo/default-config": "5.0.0", - "@vis.gl/react-maplibre": "^1.0.0-alpha.4", "debug": "^4.3.7", "dotenv": "^16.4.5", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.1", "electron-store": "^10.0.0", - "maplibre-gl": "^5.0.0", "sodium-native": "^4.3.1", "tiny-typed-emitter": "^2.1.0", "valibot": "^0.42.1" @@ -101,6 +99,7 @@ "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/sodium-native": "^2.3.9", + "@vis.gl/react-maplibre": "1.0.0-alpha.4", "@vitejs/plugin-react": "^4.3.3", "electron": "33.2.0", "eslint": "9.17.0", @@ -108,6 +107,7 @@ "husky": "^9.1.7", "jsdom": "25.0.1", "lint-staged": "^15.2.10", + "maplibre-gl": "5.0.0", "npm-run-all2": "^7.0.1", "patch-package": "^8.0.0", "prettier": "^3.3.3", diff --git a/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch b/patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch similarity index 100% rename from patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch.patch rename to patches/@comapeo+core+2.1.0+001+fix-smp-fallback-map-setup.patch diff --git a/src/renderer/src/components/Map.tsx b/src/renderer/src/components/Map.tsx index 5645e0c..963b241 100644 --- a/src/renderer/src/components/Map.tsx +++ b/src/renderer/src/components/Map.tsx @@ -1,6 +1,5 @@ import React from 'react' -import { Map as ReactMaplibre } from '@vis.gl/react-maplibre' -import maplibregl from 'maplibre-gl' +import { Map as ReactMapLibre } from '@vis.gl/react-maplibre' import 'maplibre-gl/dist/maplibre-gl.css' @@ -8,8 +7,7 @@ export function Map() { const center = [-72.312023, -10.38787] return ( - Date: Tue, 7 Jan 2025 14:57:32 -0500 Subject: [PATCH 7/7] Removes react import. --- src/renderer/src/components/Map.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/src/components/Map.tsx b/src/renderer/src/components/Map.tsx index 963b241..efec363 100644 --- a/src/renderer/src/components/Map.tsx +++ b/src/renderer/src/components/Map.tsx @@ -1,4 +1,3 @@ -import React from 'react' import { Map as ReactMapLibre } from '@vis.gl/react-maplibre' import 'maplibre-gl/dist/maplibre-gl.css'