Problems with mobile phone rotation and zoom operation

I want to operate on the mobile phone: when the positions of both fingers change, turn on the zoom operation; Turn on the rotation operation when the position of one finger remains unchanged and the other finger changes.

Now the effect can be achieved in the browser of iPhone x, but not in Android phones; My research found that the points of two fingers in iPhone x can change at the same time, but in Android phones, the position of one finger changes and then the position of the other finger changes. I’m very confused about this.

Here is my sample code:

  handler.setInputAction(
        function (mouseMovement) {
            var distance=mouseMovement.distance;
            var angleAndHeight=mouseMovement.angleAndHeight;
            //console.log("_positions:"+JSON.stringify(handler._positions))
            //console.log("_previousPositions:"+JSON.stringify(handler._previousPositions))
            var positions=handler._positions;
            var previousPositions=handler._previousPositions;
            var position1 = positions.values[0];
            var position2 = positions.values[1];
            var previousPosition1 = previousPositions.values[0];
            var previousPosition2 = previousPositions.values[1];
            console.log("position1:"+isObjectValueEqual(position1,previousPosition1));
            console.log("position2:"+isObjectValueEqual(position2,previousPosition2));
            console.log("position1:"+JSON.stringify(position1)+"position2:"+JSON.stringify(position2)+"previousPosition1:"+JSON.stringify(previousPosition1)+"previousPosition2:"+JSON.stringify(previousPosition2))
            if(isObjectValueEqual(position1,previousPosition1)||isObjectValueEqual(position2,previousPosition2))
            {
                controller.enableZoom = false;
                controller.enableTilt = true;
            }
            else{
                controller.enableZoom = true;
                controller.enableTilt = false;
            }
   
        },
        Cesium.ScreenSpaceEventType.PINCH_MOVE
    );```

@linbossgebest

Thank you for your community forum post and welcome to the community! :grinning: :rocket:

I am not sure exactly what you mean when you are describing your UX goals. Is it possible to provide an example that showcases what you are looking for?

In general, it looks like you are off to a great start with your code. I see a handler object which is definitely necessary here. I also see that you are using Cesium.ScreenSpaceEventType.PINCH_MOVE, which seems appropriate as well. You could consider detecting other types of input from the ScreenSpaceEventType object such as PINCH_START if appropriate.

https://cesium.com/learn/cesiumjs/ref-doc/global.html?classFilter=event#ScreenSpaceEventType

I am looking forward to learning more! Please do not hesitate to reach out if you have any other questions or concerns.

-Sam