Skip to content

Commit

Permalink
feat: handle bbox in geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Nov 18, 2021
1 parent 1600cd3 commit 0572079
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ async function getLayerCategoryId (page, layerId) {
}
// Process the features
if (parameters.features) {
const collection = JSON.stringify({
let geoJson = {
type: 'FeatureCollection',
features: parameters.features
})
writeTmpFile(tmpGeoJsonFile, collection)
const loaderSelector = '#dropFileInput'
}
if (parameters.bbox) geoJson.bbox = parameters.bbox
writeTmpFile(tmpGeoJsonFile, JSON.stringify(geoJson))
try {
const loader = await page.$(loaderSelector)
const loader = await page.$('#dropFileInput')
await loader.uploadFile(path.join(tmpDir, tmpGeoJsonFile))
} catch (error) {
console.error(`Upload features file failed: ${error}`)
Expand Down

0 comments on commit 0572079

Please sign in to comment.