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

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

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

Marker.getPosition介绍

暂无

代码示例

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

private MarkerWithPosition(Marker marker) {
  this.marker = marker;
  position = marker.getPosition();
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onMarkerDragStart(Marker marker) {
 LatLng position=marker.getPosition();
 Log.d(getClass().getSimpleName(), String.format("Drag from %f:%f",
                         position.latitude,
                         position.longitude));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onMarkerDrag(Marker marker) {
 LatLng position=marker.getPosition();
 Log.d(getClass().getSimpleName(),
    String.format("Dragging to %f:%f", position.latitude,
           position.longitude));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onMarkerDragEnd(Marker marker) {
 LatLng position=marker.getPosition();
 Log.d(getClass().getSimpleName(), String.format("Dragged to %f:%f",
   position.latitude,
   position.longitude));
}

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

private void updatePolyline() {
  mPolyline.setPoints(Arrays.asList(mMarkerA.getPosition(), mMarkerB.getPosition()));
}

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

private void showDistance() {
  double distance = SphericalUtil.computeDistanceBetween(mMarkerA.getPosition(), mMarkerB.getPosition());
  mTextView.setText("The markers are " + formatNumber(distance) + " apart.");
}

代码示例来源:origin: square/assertj-android

public MarkerAssert hasPosition(LatLng position) {
 isNotNull();
 LatLng actualLatLng = actual.getPosition();
 assertThat(actualLatLng) //
   .overridingErrorMessage("Expected position <%s> but was <%s>.", position, actualLatLng) //
   .isEqualTo(position);
 return this;
}

代码示例来源:origin: commonsguy/cw-omnibus

private void addMarker(GoogleMap map, double lat, double lon,
             int title, int snippet) {
  Marker marker=
    map.addMarker(new MarkerOptions().position(new LatLng(lat, lon))
                     .title(getString(title))
                     .snippet(getString(snippet)));

  builder.include(marker.getPosition());
 }
}

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

@Override
  public void onMarkerDragEnd(Marker marker) {
    mMarkerPosition = marker.getPosition();
  }
}

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

@Override
public void onMarkerDrag(Marker marker) {
  mTopText.setText("onMarkerDrag.  Current Position: " + marker.getPosition());
}

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

@Override
protected void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putParcelable(MARKER_POSITION_KEY, mMarker.getPosition());
}

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

@Override
public void onMarkerDragEnd(Marker marker) {
  mStreetViewPanorama.setPosition(marker.getPosition(), 150);
}

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

public boolean onMarkerMoved(Marker marker) {
  if (marker.equals(mCenterMarker)) {
    mCircle.setCenter(marker.getPosition());
    mRadiusMarker.setPosition(toRadiusLatLng(marker.getPosition(), mRadiusMeters));
    return true;
  }
  if (marker.equals(mRadiusMarker)) {
    mRadiusMeters =
        toRadiusMeters(mCenterMarker.getPosition(), mRadiusMarker.getPosition());
    mCircle.setRadius(mRadiusMeters);
    return true;
  }
  return false;
}

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

@Override
public LatLng getPosition() {
  if (virtual != null) {
    return virtual.getPosition();
  }
  LatLng position = calculateClusterPosition();
  return position;
}

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

public LatLng getPosition() {
  if (marker != null) {
    return marker.getPosition();
  } else {
    return markerOptions.getPosition();
  }
}

代码示例来源:origin: j4velin/MapsMeasure

@Override
  public boolean onMarkerClick(final Marker click) {
    addPoint(click.getPosition());
    return true;
  }
});

代码示例来源:origin: SkyTreasure/Airbnb-Android-Google-Map-View

private Polyline initializePolyLine() {
  //polyLinePoints = new ArrayList<LatLng>();
  rectOptions.add(markers.get(0).getPosition());
  return mGoogleMap.addPolyline(rectOptions);
}

代码示例来源:origin: SkyTreasure/Airbnb-Android-Google-Map-View

public static void fixZoomForMarkers(GoogleMap googleMap, List<Marker> markers) {
  if (markers!=null && markers.size() > 0) {
    LatLngBounds.Builder bc = new LatLngBounds.Builder();

    for (Marker marker : markers) {
      bc.include(marker.getPosition());
    }

    googleMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bc.build(), 50),4000,null);
  }
}

代码示例来源:origin: GeoODK/collect

@Override
public void onMarkerDragEnd(Marker marker) {
  mLatLng = marker.getPosition();
  mAcceptLocation.setClickable(true);
  mIsDragged = true;
  mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mLatLng, mMap.getCameraPosition().zoom));
}

代码示例来源:origin: AppLozic/Applozic-Android-SDK

@Override
  public void onMarkerDragEnd(Marker marker) {
    if (myLocationMarker != null) {
      myLocationMarker.remove();
    }
    MarkerOptions newMarkerOptions = new MarkerOptions();
    newMarkerOptions.draggable(true);
    myLocationMarker = googleMap.addMarker(newMarkerOptions.position(marker.getPosition()).title(""));
  }
});

相关文章