diff --git a/src/js/FootprintFetcher.js b/src/js/FootprintFetcher.js index 332d2ad90fb8b320285ce8759bf1ba8e9eac9bd8..045af2d4368b389e0b59d9cdbf814778eeb7bac3 100644 --- a/src/js/FootprintFetcher.js +++ b/src/js/FootprintFetcher.js @@ -64,65 +64,11 @@ export async function FetchFootprints(collection, page, step){ // check for pyGeo API if (!collection.url.includes('stac')) { + collectionUrl = collection.url.split('&limit=')[0]; - // set offset for 5 & 10 steps - offsetMulitiplier = (page * 10 - step); - pageInfo = "&offset=" + offsetMulitiplier; - - - // checks for 5 change in step - if (step <= 10) - { - - // splice limit and change to new limit - collectionUrl = collection.url.split('&limit=')[0]; - collection.url = collectionUrl; - - - // update page pageInfo - pageInfo = "&offset=" + offsetMulitiplier + "&limit=" + step; - - - } - // checks for 50 & 100 step - else if (step == 50 || step == 100) - { - - // splice limit and change to new limit - collectionUrl = collection.url.split('&limit=')[0]; - collection.url = collectionUrl; - - // check for first page - if (page == 1) - { - // set multiplier to 0 - offsetMulitiplier = 0; - } - // check for second page - else if (page == 2) - { - // set multiplier to step - offsetMulitiplier = step; - - } - else - { - // check for 50 and set pages according - if (step == 50) - { - offsetMulitiplier = page * step - 50; - } - // check for 100 and set pages according - else - { - offsetMulitiplier = page * step - 100; - } - } - - // update page pageInfo - pageInfo = "&offset=" + offsetMulitiplier + "&limit=" + step; - } - + offsetMulitiplier = (page - 1) * step; + + collection.url = `${collectionUrl}&offset=${offsetMulitiplier}&limit=${step}`; } // reset offset