-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure layer loads when dateBefore set early, then moved back late #2701
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blacha
reviewed
Feb 21, 2023
ajacombs
force-pushed
the
fix/layer-loading
branch
from
March 13, 2023 02:44
3a5be10
to
fa938cf
Compare
blacha
reviewed
Mar 14, 2023
@@ -91,7 +91,7 @@ export class Basemaps extends Component<unknown, { isLayerSwitcherEnabled: boole | |||
}; | |||
|
|||
updateVisibleLayers = (newLayers: string): void => { | |||
if (!Config.map.visibleLayers) Config.map.visibleLayers = newLayers; | |||
if (Config.map.visibleLayers == null) Config.map.visibleLayers = newLayers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think visibleLayers
is defined as string
and not initialised. Might be better to defined as string|null
. Then you can do this check for initialising here.
blacha
previously approved these changes
Mar 20, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to a conflict with the base branch
Mar 20, 2023
blacha
approved these changes
Mar 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the date before slider was moved to a position earlier than any available imagery (causing the map to be empty), and then moved to a position just after an available imagery layer, the attribution text would update to show the change, but the imagery would not load on the map. On moving the date before slider later again, beyond when a second imagery set was available, that second imagery layer would be displayed.
This was caused by
if (!Config.map.visibleLayers)
being true for bothundefined
(its value before the sliders have been moved), and the empty string, its value when the sliders are set to a position where there is no imagery available.Related to this bug, there seemed to be some 'glitchiness' around when imagery layers are loaded. This may be due to transient race conditions between the debouncing added in
scheduleUpdateConfig
competing with equivalent debouncing for the attribution rendering. This was added to minimise network requests as previously changing the date sliders requested a new attribution json file. With this refactored out to client side filtering, the debouncing is no longer needed, as the loading of new layers is triggered inside the attribution update functions which are already debounced.