Loading src/components/presentational/FootprintResults.jsx +3 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,9 @@ export default function FootprintResults(props) { for(const key in featureCollections){ if(featureCollections[key].numberReturned > 0) noFootprintsReturned = false; } if(numFeatures > matched) { setNumFeatures(matched); } return ( <div id="footprintResults" className="scroll-parent"> {hasFootprints && Loading src/js/FootprintFetcher.js +22 −7 Original line number Diff line number Diff line Loading @@ -133,15 +133,30 @@ export async function FetchFootprints(collection, page, step){ } export async function FetchStepRemainder(featureCollection, myStep) { if (!featureCollection || !featureCollection.features) { console.error('Invalid featureCollection:', featureCollection); return []; } let myPage = Math.ceil(featureCollection.features.length / myStep); let skip = featureCollection.features.length % myStep; let newFeatures = []; let fullResponse; if (skip !== 0) { newFeatures = await FetchFootprints(featureCollection, myPage, myStep); fullResponse = await FetchFootprints(featureCollection, myPage, myStep); if (!fullResponse || !fullResponse.features) { console.error('Invalid fullResponse:', fullResponse); return []; } newFeatures = fullResponse.features; // If any features are returned, add the remainder needed to the current collection if (newFeatures.length > 0) { // Handle edge case where you may have requested more features than still available if (newFeatures.length < myStep) { return newFeatures; } else { return newFeatures.slice(skip, newFeatures.length); } } Loading Loading
src/components/presentational/FootprintResults.jsx +3 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,9 @@ export default function FootprintResults(props) { for(const key in featureCollections){ if(featureCollections[key].numberReturned > 0) noFootprintsReturned = false; } if(numFeatures > matched) { setNumFeatures(matched); } return ( <div id="footprintResults" className="scroll-parent"> {hasFootprints && Loading
src/js/FootprintFetcher.js +22 −7 Original line number Diff line number Diff line Loading @@ -133,15 +133,30 @@ export async function FetchFootprints(collection, page, step){ } export async function FetchStepRemainder(featureCollection, myStep) { if (!featureCollection || !featureCollection.features) { console.error('Invalid featureCollection:', featureCollection); return []; } let myPage = Math.ceil(featureCollection.features.length / myStep); let skip = featureCollection.features.length % myStep; let newFeatures = []; let fullResponse; if (skip !== 0) { newFeatures = await FetchFootprints(featureCollection, myPage, myStep); fullResponse = await FetchFootprints(featureCollection, myPage, myStep); if (!fullResponse || !fullResponse.features) { console.error('Invalid fullResponse:', fullResponse); return []; } newFeatures = fullResponse.features; // If any features are returned, add the remainder needed to the current collection if (newFeatures.length > 0) { // Handle edge case where you may have requested more features than still available if (newFeatures.length < myStep) { return newFeatures; } else { return newFeatures.slice(skip, newFeatures.length); } } Loading