Can I Change Right_Click to double tap on Mobile?

is there any way to replace RIGHT_CLICK with touch when i visit my web with iphone, because polyline drawing feature need to use RIGHT_CLICK but on iphone it can only tap, can i change right click to double tap?

Hi @Yen_Woody,

I recommend checking out the ScreenSpaceEventType documentation.

https://cesium.com/learn/cesiumjs/ref-doc/ScreenSpaceEventType.html

This documentation shows you what types of input CesiumJS recognizes. You can use this documentation to create your own custom logic for converting between input types.

-Sam

I’ve read it but still don’t quite understand, can I use PINCH_START instead of right-click for touch?

@Yen_Woody

It just depends on your use case! I believe that on touch screens, a touch input is equivalent to a LEFT_CLICK. Thus, you could replicate a “double-tap” input by accepting two rapid left clicks. Once you receive a double tap input, you could trigger a RIGHT_CLICK event.

-Sam

1 Like

well, i try to use PINCH_START and it work

@Yen_Woody

Great! I am happy to hear that you found a solution.

-Sam