diff --git a/static/client.js b/static/client.js new file mode 120000 index 0000000..9fb4039 --- /dev/null +++ b/static/client.js @@ -0,0 +1 @@ +../ts-client/build/client.js \ No newline at end of file diff --git a/static/index.html b/static/index.html index 858eff4..27d3221 100644 --- a/static/index.html +++ b/static/index.html @@ -36,118 +36,6 @@
- - - + diff --git a/ts-client/client.ts b/ts-client/client.ts index b0df9e6..89e819a 100644 --- a/ts-client/client.ts +++ b/ts-client/client.ts @@ -17,7 +17,10 @@ async function loadPlaces(): Promise> { } function toLeafletPlaces(backendPlaces: Array): GeoJSON { - let result: FeatureCollection; + let result: FeatureCollection = { + type: "FeatureCollection", + features: new Array(), + } for (const place of backendPlaces) { result.features.push({ "type": "Feature", @@ -37,7 +40,7 @@ function toLeafletPlaces(backendPlaces: Array): GeoJSON { return result; } -export default async function setupMap(): Promise { +async function setupMap(): Promise { const backendPlaces = await loadPlaces(); const leafletPlaces = toLeafletPlaces(backendPlaces); diff --git a/ts-client/tsconfig.json b/ts-client/tsconfig.json index 13bf64f..dcd788d 100644 --- a/ts-client/tsconfig.json +++ b/ts-client/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "typeRoots": ["node_modules/@types"], - "rootDir": ".", - "outDir": "build", - "target": "es2020", - "lib": [ - "es2020", - "dom", - ], - "types": [ - "leaflet", - "geojson", - ], - "moduleResolution": "node" - }, - "include": [ - "*.ts" - ], - "exclude": [ - "node_modules" - ] + "compilerOptions": { + "typeRoots": ["node_modules/@types"], + "rootDir": ".", + "outDir": "build", + "target": "es2022", + "module": "es2022", + "lib": [ + "es2022", + "dom", + ], + "types": [ + "leaflet", + "geojson", + ], + "moduleResolution": "node" + }, + "include": [ + "*.ts" + ], + "exclude": [ + "node_modules" + ] }