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

Widgets work on either mask or viewport #661

Conversation

stefano-xy
Copy link
Contributor

@stefano-xy stefano-xy commented Apr 27, 2023

Description

Shortcut: https://app.shortcut.com/cartoteam/story/303989/widgets-wrongly-operate-on-intersection-between-viewport-and-mask

This PR removes the intersection between viewport and (optional) mask, when filtering features and calculating widgets.

New behavior:

  • If a mask is set, filter by that mask only
  • Otherwise filter by viewport

Old behavior:

  • If a mask is set, filter by the intersection of that mask and the viewport
  • Otherwise filter by viewport

Also includes refactoring of getGeometryToIntersect:

  • moved closer to the root of render cycle, it avoids unneeded widget recalculation
  • better typing via JSDoc
  • object returned are GeoJSON Polygon or MultiPolygon and not Feature anymore

@shortcut-integration
Copy link

@stefano-xy stefano-xy marked this pull request as draft April 27, 2023 08:59
@coveralls
Copy link
Collaborator

coveralls commented Apr 27, 2023

Pull Request Test Coverage Report for Build 4873713026

  • 2 of 3 (66.67%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.09%) to 71.605%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/react-core/src/filters/tileFeaturesSpatialIndex.js 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
packages/react-core/src/filters/tileFeatures.js 1 75.0%
Totals Coverage Status
Change from base Build 4834244043: 0.09%
Covered Lines: 1978
Relevant Lines: 2540

💛 - Coveralls

@stefano-xy stefano-xy self-assigned this Apr 27, 2023
@stefano-xy stefano-xy force-pushed the bug/sc-303989/widgets-wrongly-operate-on-intersection-between branch from 614e899 to 891c823 Compare April 27, 2023 11:25
@stefano-xy stefano-xy force-pushed the bug/sc-303989/widgets-wrongly-operate-on-intersection-between branch from 891c823 to ebdd99c Compare April 27, 2023 13:11
@stefano-xy stefano-xy marked this pull request as ready for review April 28, 2023 09:02
@stefano-xy stefano-xy force-pushed the bug/sc-303989/widgets-wrongly-operate-on-intersection-between branch from 325f67d to bb7cc40 Compare April 28, 2023 09:18
@VictorVelarde VictorVelarde requested a review from zbigg April 29, 2023 15:46
Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Thx also for the cleanup 👍🏻 . I'm only missing a short description added in the CHANGELOG, and I'll ping PS in slack for awareness

Copy link
Contributor

@zbigg zbigg left a comment

Choose a reason for hiding this comment

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

LGTM

@stefano-xy stefano-xy merged commit f46c441 into master May 3, 2023
@stefano-xy stefano-xy deleted the bug/sc-303989/widgets-wrongly-operate-on-intersection-between branch May 3, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants