Use direct call for geojson files
Deploy Spot / deploy (push) Successful in 16s

This commit is contained in:
2026-08-10 23:14:21 +02:00
parent dcd3e7339b
commit d6c897beeb
9 changed files with 62 additions and 30 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ export default {
this.track
] = await Promise.all([
this.api.get('markers', {id_project: this.project.id}),
this.api.get('geojson', {id_project: this.project.id})
this.api.getAsset(this.project.geofilepath)
]);
await this.initMap();
+10
View File
@@ -14,6 +14,16 @@ export default class Api {
return response.data;
}
async getAsset(sAssetPath) {
const oRequest = await fetch(sAssetPath, {headers: {'Accept': 'application/geo+json'}});
if(!oRequest.ok) {
throw new Error('Error HTTP ' + oRequest.status + ': ' + oRequest.statusText);
}
return oRequest.json();
}
async post(sAction, asParams = {}) {
const response = await this.request(sAction, asParams, 'POST');
return response.data;