Skip to content

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

@xixiaxixi

Description

@xixiaxixi

有时可能是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,我又懒得看处理过程。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions