load geojson from db

This commit is contained in:
Anton Tranelis 2024-05-07 13:57:45 +02:00
parent 4575be4522
commit 3a11da1c3f
4 changed files with 14 additions and 14 deletions

22
package-lock.json generated
View File

@ -17,7 +17,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-rnd": "^10.4.1", "react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0", "react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.0-alpha.149" "utopia-ui": "^3.0.0-alpha.152"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^18.2.79", "@types/react": "^18.2.79",
@ -1969,20 +1969,20 @@
} }
}, },
"node_modules/@tanstack/query-core": { "node_modules/@tanstack/query-core": {
"version": "5.32.1", "version": "5.35.1",
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.32.1.tgz", "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.35.1.tgz",
"integrity": "sha512-mCWa1wdGb1jiny4+qYegbSeadcFj+Nq65KFSs4A1DRveoIq7SrTwUhqu7hrB6d54cQH5x59DfJvxusn3w1Cj/g==", "integrity": "sha512-0Dnpybqb8+ps6WgqBnqFEC+1F/xLvUosRAq+wiGisTgolOZzqZfkE2995dEXmhuzINiTM7/a6xSGznU0NIvBkw==",
"funding": { "funding": {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/tannerlinsley" "url": "https://github.com/sponsors/tannerlinsley"
} }
}, },
"node_modules/@tanstack/react-query": { "node_modules/@tanstack/react-query": {
"version": "5.32.1", "version": "5.35.1",
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.32.1.tgz", "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.35.1.tgz",
"integrity": "sha512-+nXLMB0JK0XwTJ+lQt49DPNLrbSppni9N5W5yMR085yW3YaRKRUFhfVTER3TvQd1UycHpoGPFnt1gHiijXERAg==", "integrity": "sha512-i2T7m2ffQdNqlX3pO+uMsnQ0H4a59Ens2GxtlMsRiOvdSB4SfYmHb27MnvFV8rGmtWRaa4gPli0/rpDoSS5LbQ==",
"dependencies": { "dependencies": {
"@tanstack/query-core": "5.32.1" "@tanstack/query-core": "5.35.1"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@ -7245,9 +7245,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/utopia-ui": { "node_modules/utopia-ui": {
"version": "3.0.0-alpha.149", "version": "3.0.0-alpha.152",
"resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.0-alpha.149.tgz", "resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.0-alpha.152.tgz",
"integrity": "sha512-hKYVQSWHsL9wDSeL0aWF/C87zhGDj4PVjg7gLbfHFC9w1cQe62SnN05FjbDlOoGn3av82opZoeTnKRS2AGaAQw==", "integrity": "sha512-/qcnjFMXj0WbCUeTs3dwub/kNgzS+krXtEbWeFqxgzfCEtAAcly+WeEXEfwtOWThyMter6k0ug4aaw3oNvIGQQ==",
"dependencies": { "dependencies": {
"@heroicons/react": "^2.0.17", "@heroicons/react": "^2.0.17",
"@tanstack/react-query": "^5.17.8", "@tanstack/react-query": "^5.17.8",

View File

@ -19,7 +19,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-rnd": "^10.4.1", "react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0", "react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.0-alpha.149" "utopia-ui": "^3.0.0-alpha.152"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^18.2.79", "@types/react": "^18.2.79",

View File

@ -30,7 +30,7 @@ export class itemsApi<T> implements ItemsApi<T>{
async getItems() { async getItems() {
try { try {
return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', "relations.*", "user_created.*", {offers: ['*'], needs: ['*']}] , filter: this.filter, limit: 500 })); return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', "relations.*", "user_created.*", {offers: ['*'], needs: ['*']}] , filter: this.filter, limit: 2000 }));
} catch (error: any) { } catch (error: any) {
console.log(error); console.log(error);
if (error.errors[0]?.message) if (error.errors[0]?.message)

View File

@ -28,7 +28,7 @@ function MapContainer({ layers, map }: { layers: Array<LayerProps>, map: any })
return ( return (
<UtopiaMap zoom={map.zoom || 5} center={map.center? [map.center?.coordinates[1], map.center?.coordinates[0]] : [50.6, 9.5]} height='calc(100dvh - 64px)' width="100%" > <UtopiaMap geo={map.geo} zoom={map.zoom || 5} center={map.center? [map.center?.coordinates[1], map.center?.coordinates[0]] : [50.6, 9.5]} height='calc(100dvh - 64px)' width="100%" >
{layers && apis && {layers && apis &&
layers.map(layer => layers.map(layer =>
<Layer <Layer