Skip to content

Commit

Permalink
fix: geofence API caused by rtree (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinrre authored Oct 31, 2023
1 parent ae3a8a7 commit d5c6c39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes/apiGeofence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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')
}

Expand Down Expand Up @@ -173,7 +173,7 @@ module.exports = async (fastify, options, next) => {

return {
status: 'ok',
geofence: fastify.geofence,
geofence: fastify.geofence.geofence,
}
})

Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit d5c6c39

Please sign in to comment.