有时可能是feature吧......
我想了俩解决方法
- 好在Layer都有mapView的引用。添加以下代码至
LocationLayer.java
// ...
if (compassIndicatorArrowBitmap != null) {
canvas.rotate(mapView.getCurrentRotateDegrees(), goal[0], goal[1]); // 新增
// ...
- MapView添加一个onCurrentRotateDegreesChanged事件。这样至少用户可以在旋转时设置指向,这也是Demo中的思想,但Demo中是由
onSensorChanged不断发出事件来做到刷新的。不想改这个代码,因为在处理touchEvent的时候没调用setCurrentRotateDegrees,我又懒得看处理过程。