com.google.android.gms.maps.model.Marker.setRotation()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(282)

本文整理了Java中com.google.android.gms.maps.model.Marker.setRotation()方法的一些代码示例,展示了Marker.setRotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Marker.setRotation()方法的具体详情如下:
包路径:com.google.android.gms.maps.model.Marker
类名称:Marker
方法名:setRotation

Marker.setRotation介绍

暂无

代码示例

代码示例来源:origin: googlemaps/android-samples

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
  if (!checkReady()) {
    return;
  }
  float rotation = seekBar.getProgress();
  for (Marker marker : mMarkerRainbow) {
    marker.setRotation(rotation);
  }
}

代码示例来源:origin: IndoorAtlas/android-sdk-examples

private void updateHeading(double heading) {
  if (mHeadingMarker != null) {
    mHeadingMarker.setRotation((float)heading);
  }
}

代码示例来源:origin: car2go/AnyMaps

@Override
public void setRotation(float rotation) {
  marker.setRotation(rotation);
}

代码示例来源:origin: mg6maciej/android-maps-extensions

public void setRotation(float rotation) {
  if (marker != null) {
    marker.setRotation(rotation);
  } else {
    markerOptions.rotation(rotation);
  }
}

代码示例来源:origin: amanjeetsingh150/UberCarAnimation

@Override
  public void onAnimationUpdate(ValueAnimator valueAnimator) {
    v = valueAnimator.getAnimatedFraction();
    double lng = v * latLngs.get(1).longitude + (1 - v)
        * latLngs.get(0).longitude;
    double lat = v * latLngs.get(1).latitude + (1 - v)
        * latLngs.get(0).latitude;
    LatLng newPos = new LatLng(lat, lng);
    marker.setPosition(newPos);
    marker.setAnchor(0.5f, 0.5f);
    marker.setRotation(getBearing(latLngs.get(0), newPos));
    mMap.animateCamera(CameraUpdateFactory.newCameraPosition
        (new CameraPosition.Builder().target(newPos)
            .zoom(15.5f).build()));
  }
});

代码示例来源:origin: ShowMeHills/ShowMeHills

if (compassMarker != null)
  compassMarker.setRotation( (float) Math.toDegrees(dv[0]));

代码示例来源:origin: Phantast/smartnavi

actualMarker[0].setRotation(actualMarker[0].getRotation() * (-1));
  float rotation = (float) Core.azimuth;
  actualMarker[0].setRotation(rotation);
} catch (Exception e) {
  e.printStackTrace();

代码示例来源:origin: IndoorAtlas/android-sdk-examples

private void showBlueDot(LatLng center, double accuracyRadius, double bearing) {
  if (mCircle == null) {
    // location can received before map is initialized, ignoring those updates
    if (mMap != null) {
      mCircle = mMap.addCircle(new CircleOptions()
          .center(center)
          .radius(accuracyRadius)
          .fillColor(0x201681FB)
          .strokeColor(0x500A78DD)
          .zIndex(1.0f)
          .visible(true)
          .strokeWidth(5.0f));
      mMarker = mMap.addMarker(new MarkerOptions()
          .position(center)
          .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_blue_dot))
          .anchor(0.5f, 0.5f)
          .rotation((float)bearing)
          .flat(true));
    }
  } else {
    // move existing markers position to received location
    mCircle.setCenter(center);
    mCircle.setRadius(accuracyRadius);
    mMarker.setPosition(center);
    mMarker.setRotation((float)bearing);
  }
}

代码示例来源:origin: IndoorAtlas/android-sdk-examples

private void showBlueDot(LatLng center, double accuracyRadius, double bearing) {
  if (mCircle == null) {
    // location can received before map is initialized, ignoring those updates
    if (mMap != null) {
      mCircle = mMap.addCircle(new CircleOptions()
        .center(center)
        .radius(accuracyRadius)
        .fillColor(ACTIVE_LEVEL_BLUE_DOT_COLOR)
        .strokeColor(0x00000000)
        .zIndex(1.0f)
        .visible(true));
      mMarker = mMap.addMarker(new MarkerOptions()
        .position(center)
        .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_blue_dot))
        .anchor(0.5f, 0.5f)
        .rotation((float)bearing)
        .flat(true));
      mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(center, 17.0f));
    }
  } else {
    mCircle.setCenter(center);
    mCircle.setRadius(accuracyRadius);
    mMarker.setPosition(center);
    mMarker.setRotation((float)bearing);
  }
}

相关文章