-
Notifications
You must be signed in to change notification settings - Fork 46
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 popup display while zoomed out #226
Conversation
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
1. remove redundant else 2. add comments Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 91.09% 91.43% +0.34%
==========================================
Files 7 8 +1
Lines 247 257 +10
Branches 33 34 +1
==========================================
+ Hits 225 235 +10
Misses 16 16
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
b2066ad
to
df39954
Compare
|
||
export function isTooltipEnabledLayer( | ||
layer: MapLayerSpecification | ||
): layer is DocumentLayerSpecification { | ||
return ( | ||
layer.type !== 'opensearch_vector_tile_map' && | ||
layer.type !== 'custom_map' && | ||
layer.source.showTooltips === true | ||
layer.source.showTooltips === true && | ||
!!layer.source.tooltipFields?.length |
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.
Will the last condition !!layer.source.tooltipFields?.length
returns false if tooltipFields are not provided after enabling toolTips?
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.
showTooltips is a flag where user controls whether to show toolTip or not, however, tooltipFields contains list of tooltip fields. The last condition checks whether length of tooltipFields is > 0 or not
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.
Yes, I got it. But, I'm trying to understand what will be the value of !!layer.source.tooltipFields?.length
if no tooltipFields are provided. If it is not an optional field it's value will be false. But, what will be the value when it is optional?
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.
false
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
df39954
to
136c2e5
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-226-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 88bfeb9724f0a6f2e98be6b5ca016cb0f30c568a
# Push it to GitHub
git push --set-upstream origin backport/backport-226-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
* Update tool tip condition * Clean up code Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> (cherry picked from commit 88bfeb9)
Description
While zoom out, maps will have multiple copies of world map. Before this fix, popup will be displayed always at first copy even if users are hovering over another copy. This will make sure that hover shows up on where pointer is hovered.
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
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.