Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Asc Geostac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Asc Geostac
Commits
79c94db8
Commit
79c94db8
authored
1 year ago
by
Jacob Cain
Browse files
Options
Downloads
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/js/FootprintFetcher.js
+59
-4
59 additions, 4 deletions
src/js/FootprintFetcher.js
with
59 additions
and
4 deletions
src/js/FootprintFetcher.js
+
59
−
4
View file @
79c94db8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment