cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Cesium interaction state is stuck in "rotating" state after mouse up

Open easternmotors opened this issue 11 months ago • 3 comments

What happened?

I have some logic in my app that involve the combination of CameraEventType.LEFT_DRAG and KeyboardEventModifier.ALT. I am running into an issue where even after I complete the CameraEventType.LEFT_DRAG event, the controls seem to be stuck in a "rotating" state".

Reproduction steps

On the base Sandcastle example:

  1. Use LEFT_DRAG to start rotating the globe by left clicking and dragging the globe
  2. While still holding down the left mouse button, hold down the ALT modifier -- the globe should stop responding to your mouse movement
  3. Release the left mouse button to complete the LEFT_DRAG event while still holding the ALT modifier
  4. Release the ALT modifier and attempt to move the mouse -- the camera is still in a "rotating" state

Sandcastle example

https://sandcastle.cesium.com/

Environment

Browser: Chrome 122 CesiumJS Version: CesiumJS 1.115 Operating System: Windows 10

easternmotors avatar Mar 19 '24 19:03 easternmotors

Further Questions:

  1. Is this a bug or intended?
  2. Is there a way to disable ALT preventing camera rotation (See Reproduction Steps - Step 2)
  3. Is there a workaround to "clear the rotating state forcefully"?

easternmotors avatar Mar 19 '24 19:03 easternmotors

Thanks for the report @easternmotors. I do this this is a bug and that ScreenSpaceCameraController does not account for this specific scenario.

In the meantime you can adjust the event types (including those with the modifier ALT key) which allow the user to rotate the globe.

ggetz avatar Mar 20 '24 13:03 ggetz

Thanks @ggetz! I tried changing the event types before creating this ticket to see if that would work but I could never get it working. This is what I tried which I think you were describing as a possible workaround but I am still seeing the same issue:

https://sandcastle.cesium.com/#c=jZDBSsQwEIZfZehphSXFq7bFpa4erAhu8WJF0nRWg2lSJmmXKr67SesuonvwMjD5v2/CjDDaOhgk7pAgBY07yNHKvmUP09uiisTU50Y7LjVSFZ2cV3o2mBWo0VdC1JuOC8x5i8QDTEYpT5Bx3OF6QO3KsUObwmOlYf/JjB9SVqyvyufL+9X1MkAfoQDgPj77nwbQmkZuJdJBuMGxNpyaSbn9TtmqKCfhs9JPfqdoGSXWjQqzeQrAhWw7Qw56UgvGYodtp/w2Nq578YaOCWvDMQKaxD/VpJEDyCY9cj0Qilvrk22v1Ea+YxVlSez5P6oyvJH65W5AUnwM2OtpVsyPjLEk9u1x0xmjak6/Jn8B

easternmotors avatar Mar 20 '24 13:03 easternmotors

#11903

EMapGIS avatar Jul 09 '24 10:07 EMapGIS

This was fixed with #12073

jjspace avatar Aug 23 '24 18:08 jjspace