MapView icon indicating copy to clipboard operation
MapView copied to clipboard

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

Open xixiaxixi opened this issue 4 years ago • 0 comments

有时可能是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 avatar Jul 21 '21 09:07 xixiaxixi