Java Code Examples for com.amap.api.maps.AMap#LOCATION_TYPE_MAP_ROTATE

The following examples show how to use com.amap.api.maps.AMap#LOCATION_TYPE_MAP_ROTATE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapsModule.java    From Maps with GNU General Public License v2.0 6 votes vote down vote up
public void onOrientationChanged(float ori) {


        if (mLocation != null && marker != null) {
            CameraPosition currentCP = mGaodeMap.getCameraPosition();

            int mode = readMyLocationMode();
            if (mode == AMap.LOCATION_TYPE_MAP_ROTATE) {
                marker.setRotateAngle(0);
                CameraPosition newCP = new CameraPosition(new LatLng(mLocation.getLatitude(), mLocation.getLongitude()), currentCP.zoom, currentCP.bearing, ori);
                mGaodeMap.animateCamera(CameraUpdateFactory.newCameraPosition(newCP), null);
            } else {
                marker.setRotateAngle(ori);
            }
        }

    }
 
Example 2
Source File: MapsActionInteractorImpl.java    From Maps with GNU General Public License v2.0 5 votes vote down vote up
private int readMyLocationMode() {
    int mode = SettingUtils.readCurrentMyLocationMode();
    if (mode == AMap.LOCATION_TYPE_MAP_FOLLOW){
        return AMap.LOCATION_TYPE_MAP_ROTATE;
    } else if(mode == AMap.LOCATION_TYPE_MAP_ROTATE){
        return AMap.LOCATION_TYPE_MAP_FOLLOW;
    } else if (mode == AMap.LOCATION_TYPE_LOCATE) {
        return AMap.LOCATION_TYPE_MAP_FOLLOW;
    }
    return AMap.LOCATION_TYPE_MAP_FOLLOW;
}