Skip to content

Commit

Permalink
Merge pull request #5553 from nasa-gibs/WV-3386-mixed-granules
Browse files Browse the repository at this point in the history
WV-3386 Granule footprints do not behave as expected when you have a mix of granules with and without imagery for TEMPO L2 layers
  • Loading branch information
PatchesMaps authored Nov 7, 2024
2 parents fecab4d + ad49283 commit d655c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/js/map/granule/granule-layer-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
const granuleIsWithinRange = isWithinRanges(dateDate, granuleDateRanges) ?? true; // check if the current granule is within a date range, defaults to true
const gaps = identifyGaps(granuleDateRanges); // identify gaps between date ranges
const currentlySelectedGap = !isWithinRange ? gaps.find(([start, end]) => leadingEdgeDate >= start && leadingEdgeDate <= end) : null; // get the gap that the currently selected time is within
const granuleIsWithinSelectedGap = currentlySelectedGap ? dateDate >= currentlySelectedGap[0] && dateDate <= currentlySelectedGap[1] : false; // check if the current granule is within the currently selected gap
const granuleIsWithinSelectedGap = currentlySelectedGap ? dateDate >= currentlySelectedGap[0] && dateDate <= currentlySelectedGap[1] : true; // check if the current granule is within the currently selected gap

if (dateDate <= leadingEdgeDate && isWithinRange && granuleIsWithinRange && isWithinBounds(crs, item)) {
visibleGranules.unshift(item);
} else if (dateDate <= leadingEdgeDate && !isWithinRange && !granuleIsWithinRange && isWithinBounds(crs, item) && granuleIsWithinSelectedGap) {
} else if (dateDate <= leadingEdgeDate && !granuleIsWithinRange && isWithinBounds(crs, item) && granuleIsWithinSelectedGap) {
invisibleGranules.unshift(item);
}

Expand Down

0 comments on commit d655c24

Please sign in to comment.