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

#9018: Dashboard - Zoom in/out on maps connected to a 3D map #10460

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mahmoudadel54
Copy link
Collaborator

Description

This PR includes fixing the inconsistently issue of zoom in/out that happens in 3d map sync with another map [2d or 3d].
The issue in 3D maps was that dependenciesToMapProp.js file updates center and zoom for map object into widgets state for the synced maps, and due that update _updateMapPositionFromNewProps method into Map.js of cesium is called to update the map view.
The issue was in these lines:

const position = {
destination: Cesium.Cartesian3.fromDegrees(
newProps.viewerOptions?.cameraPosition?.longitude ?? newProps.center.x,
newProps.viewerOptions?.cameraPosition?.latitude ?? newProps.center.y,
newProps.viewerOptions?.cameraPosition?.height ?? this.getHeightFromZoom(newProps.zoom ?? 0)
),
orientation: newProps.viewerOptions?.orientation
};

It does not take the new props of center that was updated within dependenciesToMapProp as mentioned above.

I have added 2 enhancements:

  • absolute the substitute value here:
    return a.toFixed(12) - b.toFixed(12) <= 0.000000000001;

    as during test I tried to move from a point with negative coordinates to a point with positive coordinates and vice versa so if the result with negative value, the logic of isNearlyEqual will not be accurate as expected.
  • adding round to zoom values as in some cases the calculated zoom level from height adds a very small tolerance to the zoom level like: zoom = 6, the calculated zoom level = 6.0000008 which will update the view unnecessarily and actually this was my first try to fix the issue mentioned into the demo issue.

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

#9018

What is the current behavior?
#9018

What is the new behavior?
Now the zoom restriction that seems in the issue is fixed

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

…3D map

Description:
- fix inconsistently issue of zoom in/out that happens in 3d map sync with another map [2d or 3d]
…3D map

Description:
- remove unnecessary line space
@mahmoudadel54 mahmoudadel54 added enhancement Internal BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch 3D All issues related to the 3D rendering in CesiumJs labels Jul 8, 2024
@mahmoudadel54 mahmoudadel54 added this to the 2024.02.00 milestone Jul 8, 2024
@mahmoudadel54 mahmoudadel54 self-assigned this Jul 8, 2024
@tdipisa tdipisa linked an issue Jul 8, 2024 that may be closed by this pull request
6 tasks
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D All issues related to the 3D rendering in CesiumJs enhancement Internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard - Zoom in/out on maps connected to a 3D map
2 participants