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

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

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

Marker.getTag介绍

暂无

代码示例

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

@Override
  public void onInfoWindowClick(Marker marker) {
    if (marker.getTag() instanceof Place) {
      Place place = (Place) marker.getTag();
      listener.onPlaceSelected(place);
    }
  }
});

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

@Override
public boolean onMarkerClick(final Marker marker) {
  onClick((CustomTag) marker.getTag());
  // We return true to indicate that we have consumed the event and that we do not wish
  // for the default behavior to occur (which is for the camera to move such that the
  // marker is centered and for the marker's info window to open, if it has one).
  return true;
}

代码示例来源:origin: owntracks/android

@Override
public boolean onMarkerClick(Marker marker) {
  if (marker.getTag() != null) {
    setViewModeContact(String.class.cast(marker.getTag()), false);
  }
  return true;
}

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

@Deprecated
public Object getTag() {
  createMarker();
  return marker.getTag();
}

代码示例来源:origin: google-developer-training/android-advanced

@Override
  public void onInfoWindowClick(Marker marker) {
    // Check the tag
    if (marker.getTag() == "poi") {
      // Set the position to the position of the marker
      StreetViewPanoramaOptions options =
          new StreetViewPanoramaOptions().position(
              marker.getPosition());
      SupportStreetViewPanoramaFragment streetViewFragment
          = SupportStreetViewPanoramaFragment
          .newInstance(options);
      // Replace the fragment and add it to the backstack
      getSupportFragmentManager().beginTransaction()
          .replace(R.id.fragment_container,
              streetViewFragment)
          .addToBackStack(null).commit();
    }
  }
});

代码示例来源:origin: bkhezry/MapDrawingTools

private void updateMarkerLocation(Marker marker, boolean calculate) {
 LatLng latLng = (LatLng) marker.getTag();
 int position = points.indexOf(latLng);
 points.set(position, marker.getPosition());
 marker.setTag(marker.getPosition());
 if (drawingOption.getDrawingType() == DrawingOption.DrawingType.POLYGON) {
  drawPolygon(points);
  if (calculate)
   setAreaLength(points);
 } else if (drawingOption.getDrawingType() == DrawingOption.DrawingType.POLYLINE) {
  drawPolyline(points);
  if (calculate)
   setLength(points);
 }
}

代码示例来源:origin: Bhoomika06/Styled-Map-Pager

@Override
public boolean onMarkerClick(Marker marker) {
  final int mPosition = (int) marker.getTag();
  try {
    if (previousSelectedMarker != null) {

相关文章