Skip to content
Snippets Groups Projects
Commit 79c94db8 authored by Jacob Cain's avatar Jacob Cain
Browse files

Merge remote-tracking branch 'geokings/main' into capstone-2023

parents e042fd04 83ea8ebb
No related branches found
No related tags found
No related merge requests found
......@@ -64,11 +64,66 @@ export async function FetchFootprints(collection, page, step){
// check for pyGeo API
if (!collection.url.includes('stac'))
{
// 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment