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

Fix #10807 updating view also when center prop is changing #10808

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Feb 12, 2025

Description

Now maps correctly center the view when loading a shared link

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

Fix #10807

What is the new behavior?

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@MV88 MV88 added the bug label Feb 12, 2025
@MV88 MV88 added this to the 2025.01.00 milestone Feb 12, 2025
@MV88 MV88 requested a review from allyoucanmap February 12, 2025 17:21
@MV88 MV88 self-assigned this Feb 12, 2025
Comment on lines 306 to 307
if (this.map && ((this.props.projection !== newProps.projection) || (this.props.center !== newProps.center) || this.haveResolutionsChanged(newProps)) || this.haveRotationChanged(newProps) || this.props.limits !== newProps.limits) {
if (this.props.projection !== newProps.projection || (this.props.center !== newProps.center) || this.props.limits !== newProps.limits || this.haveRotationChanged(newProps)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In this PR #10525 was introduced the isNearlyEqual to avoid exact comparation of the center. Shouldn't we use the same approach here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good I guess. i'll update PR

@tdipisa tdipisa requested a review from allyoucanmap February 17, 2025 14:48
@allyoucanmap allyoucanmap merged commit 3fedb7f into geosolutions-it:master Feb 20, 2025
6 checks passed
@allyoucanmap
Copy link
Contributor

@ElenaGallo please test this fix on dev, thanks

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.

Sharing map with marker will not record the correct map center
2 participants