-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Conversation
if (deltaX > 2 || deltaY > 2) { | ||
flowStyle.setGeometry(LS); | ||
styles.push(flowStyle); | ||
j = i + 1; |
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.
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 😃
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.
Great suggestion, will pull it out and try to simplify!
Backend code coverage report for PR #63409
|
Frontend code coverage report for PR #63409 |
@@ -117,6 +117,25 @@ export const getNextLayerName = (panel: GeomapPanel) => { | |||
return `Layer ${Date.now()}`; | |||
}; | |||
|
|||
export function isSegmentVisible( |
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.
Great job on this refactor! I think just adding a few unit tests for this util function would be good 👍
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.
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.
Zoom zoom
* 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
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](https://user-images.githubusercontent.com/60050885/219820050-59df7bf8-68d6-40a5-91d7-9888d3aa65ce.gif)
After (1000 point route layer):
![Feb-17-2023 16-19-53](https://user-images.githubusercontent.com/60050885/219820178-d70937f1-5ac5-4884-ae1b-1e7dce0996d5.gif)
Closes #63323