diff --git a/src/routes/apiGeofence.js b/src/routes/apiGeofence.js index c8cda3f91..e4d9cdc0a 100644 --- a/src/routes/apiGeofence.js +++ b/src/routes/apiGeofence.js @@ -20,7 +20,7 @@ module.exports = async (fastify, options, next) => { } try { - const url = await geofenceTileGenerator.generateGeofenceTile(fastify.geofence, fastify.query.tileserverPregen, req.params.area) + const url = await geofenceTileGenerator.generateGeofenceTile(fastify.geofence.geofence, fastify.query.tileserverPregen, req.params.area) return { status: 'ok', url, @@ -140,7 +140,7 @@ module.exports = async (fastify, options, next) => { } const areas = {} - for (const fence of fastify.geofence) { + for (const fence of fastify.geofence.geofence) { areas[fence.name] = require('crypto').createHash('md5').update(JSON.stringify(fence.path)).digest('hex') } @@ -173,7 +173,7 @@ module.exports = async (fastify, options, next) => { return { status: 'ok', - geofence: fastify.geofence, + geofence: fastify.geofence.geofence, } }) @@ -202,7 +202,7 @@ module.exports = async (fastify, options, next) => { type: 'FeatureCollection', features: [], } - const inGeoJSON = fastify.geofence + const inGeoJSON = fastify.geofence.geofence for (let i = 0; i < inGeoJSON.length; i++) { const inGeofence = inGeoJSON[i]