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

Arrow of LocationLayer doesn't rotate when mapView rotating if sensor is off #27

Open
xixiaxixi opened this issue Jul 21, 2021 · 0 comments

Comments

@xixiaxixi
Copy link

有时可能是feature吧......

我想了俩解决方法

  1. 好在Layer都有mapView的引用。添加以下代码至LocationLayer.java
// ...
 if (compassIndicatorArrowBitmap != null) {
     canvas.rotate(mapView.getCurrentRotateDegrees(), goal[0], goal[1]); // 新增
// ...
  1. MapView添加一个onCurrentRotateDegreesChanged事件。这样至少用户可以在旋转时设置指向,这也是Demo中的思想,但Demo中是由onSensorChanged不断发出事件来做到刷新的。不想改这个代码,因为在处理touchEvent的时候没调用setCurrentRotateDegrees,我又懒得看处理过程。
@xixiaxixi xixiaxixi changed the title LocationLayer doesn't rotate when mapView rotating if sensor is off Arrow of LocationLayer doesn't rotate when mapView rotating if sensor is off Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant