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

Geomap: Fix route layer zoom behavior #63409

Merged
merged 6 commits into from
Mar 4, 2023
Merged

Geomap: Fix route layer zoom behavior #63409

merged 6 commits into from
Mar 4, 2023

Conversation

drew08t
Copy link
Contributor

@drew08t drew08t commented Feb 18, 2023

What this PR does / why we need it:
Currently route layer has unusual rendering behavior when zooming. This occurs when segments are small enough to share a pixel and are not rendered.

Before:
Feb-17-2023 16-17-49

After (1000 point route layer):
Feb-17-2023 16-19-53

Closes #63323

@drew08t drew08t added this to the 9.5.0 milestone Feb 18, 2023
@drew08t drew08t self-assigned this Feb 18, 2023
@drew08t drew08t requested a review from a team as a code owner February 18, 2023 00:14
@drew08t drew08t added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Feb 18, 2023
@nmarrs nmarrs added add to changelog and removed no-changelog Skip including change in changelog/release notes labels Feb 21, 2023
@nmarrs nmarrs changed the title Geomap: Fix Zoom Bug Geomap: Fix zoom behavior in route layer Feb 21, 2023
@nmarrs nmarrs changed the title Geomap: Fix zoom behavior in route layer Geomap: Fix route layer zoom behavior Feb 21, 2023
if (deltaX > 2 || deltaY > 2) {
flowStyle.setGeometry(LS);
styles.push(flowStyle);
j = i + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic is a little hard for me to follow / understand, what index is j tracking? Are we basically determining at what resolution it is necessary to draw a line vs a single point or?

This logic may be clearer if we broke it out into a util func with a few unit tests for good measure 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion, will pull it out and try to simplify!

@drew08t drew08t removed the request for review from a team February 23, 2023 22:08
@github-actions
Copy link
Contributor

Backend code coverage report for PR #63409

Plugin Main PR Difference
elasticsearch 87.8% 87.8% 0%

@github-actions
Copy link
Contributor

Frontend code coverage report for PR #63409
No changes

@@ -117,6 +117,25 @@ export const getNextLayerName = (panel: GeomapPanel) => {
return `Layer ${Date.now()}`;
};

export function isSegmentVisible(
Copy link
Contributor

Choose a reason for hiding this comment

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

Great job on this refactor! I think just adding a few unit tests for this util function would be good 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created two follow-up issues to address this. Unfortunately, because testing needs to occur postrender with canvas, Jest has limitations.

#64182
#64183

Copy link
Contributor

@nmarrs nmarrs left a comment

Choose a reason for hiding this comment

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

Zoom zoom

@drew08t drew08t merged commit 1aadafe into main Mar 4, 2023
@drew08t drew08t deleted the drew08t/geomap-zoom-bug branch March 4, 2023 00:06
baldm0mma pushed a commit that referenced this pull request Mar 6, 2023
* Geomap: Fix Zoom Bug

* Add handling for case where no segments created

* Simplify segment checks and pull logic into utils

* Rename pixel variables

* Roll back change to raw data response json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Geomap: Zoom behavior
4 participants