How to rotate MapView?

后端 未结 2 1506
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-08 20:29

I am a new developer for Android. Tried to rotate MapView in circular motion. But I don\'t know how to begin.

Do you have a simple code to rotate the

2条回答
  •  轮回少年
    2021-02-08 21:10

    As a general case, you can always created an Affine Transform with the angled rotation you need. In the general case, you do a matrix multiplication of this form:

    |x'|   |cosθ  -sinθ   0| |x|
    |y'| = |sinθ  cosθ    0|*|y|
    |1 |   |0      0      1| |1|
    

    Where (x,y) are your initial coordinates, θ is your angle of rotation, and (x',y') are the resultant transformation.

提交回复
热议问题