Skip to content
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

Refresh custom wms layer+source on update (issue 601) #631

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

qugu2427
Copy link
Contributor

@qugu2427 qugu2427 commented Jul 9, 2024

Description

UpdateLayerConfig() is broken as per #601. Specifically, line 36 maplibreInstance.style.sourceCaches[layerConfig.id].update(maplibreInstance.transform) throws a object reference error. I suspect maplibreInstance.transform is gone by the time it's used. Additionally, there are alot of what seem to be workarounds in the function, namely calling seemingly private methods of MaplibreGL and a spelling mistake. While I am by no means familiar with this codebase, it seems that simply deleting and refreshing the layer+source would be a better option. Especially, since updating wms fields would require a full refresh of tiles anyway.

Issues Resolved

#601

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@qugu2427 qugu2427 changed the title Issue 601 Fix issue 601 Jul 9, 2024
Quinn Guerin added 2 commits July 9, 2024 08:16
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
Quinn Guerin added 2 commits July 9, 2024 15:15
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
@qugu2427 qugu2427 changed the title Fix issue 601 Refresh custom wms layer+source on update (issue 601) Jul 9, 2024
@junqiu-lei
Copy link
Member

Thank you @qugu2427 for raising the PR, could you please add some test screenshot/video in this PR?

@qugu2427
Copy link
Contributor Author

@junqiu-lei sure, here is a video of the issue currently and with the refresh method
with_current_update_func.webm
with_refresh_func.webm

Copy link
Member

@junqiu-lei junqiu-lei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@junqiu-lei
Copy link
Member

The cypress failure of documentsLayer is due to CI runner capacity.

@junqiu-lei junqiu-lei merged commit 605e894 into opensearch-project:main Jul 10, 2024
17 of 19 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2024
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
(cherry picked from commit 605e894)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2024
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
(cherry picked from commit 605e894)
junqiu-lei pushed a commit that referenced this pull request Jul 17, 2024
Signed-off-by: Quinn Guerin <qguerin@icr-team.com>
(cherry picked from commit 605e894)

Co-authored-by: Quinn <10715168+qugu2427@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x bug Something isn't working v2.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants