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

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

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

Marker.remove介绍

暂无

代码示例

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

public boolean remove(Marker marker) {
  if (mMarkers.remove(marker)) {
    mAllMarkers.remove(marker);
    marker.remove();
    return true;
  }
  return false;
}

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

public void clear() {
  for (Marker marker : mMarkers) {
    marker.remove();
    mAllMarkers.remove(marker);
  }
  mMarkers.clear();
}

代码示例来源:origin: airbnb/AirMapView

@Override public void removeMarker(AirMapMarker<?> marker) {
 Marker nativeMarker = marker.getMarker();
 if (nativeMarker != null) {
  nativeMarker.remove();
  markers.remove(nativeMarker);
 }
}

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

/**
 * Removes all given Features from the map and clears all stored features.
 *
 * @param features features to remove
 */
protected static void removeFeatures(HashMap<Feature, Object> features) {
  // Remove map object from the map
  for (Object mapObject : features.values()) {
    if (mapObject instanceof Marker) {
      ((Marker) mapObject).remove();
    } else if (mapObject instanceof Polyline) {
      ((Polyline) mapObject).remove();
    } else if (mapObject instanceof Polygon) {
      ((Polygon) mapObject).remove();
    }
  }
}

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

/**
 * Given a Marker, Polyline, Polygon or an array of these and removes it from the map
 *
 * @param mapObject map object or array of map objects to remove from the map
 */
public static void removeFromMap(Object mapObject) {
  if (mapObject instanceof Marker) {
    ((Marker) mapObject).remove();
  } else if (mapObject instanceof Polyline) {
    ((Polyline) mapObject).remove();
  } else if (mapObject instanceof Polygon) {
    ((Polygon) mapObject).remove();
  } else if (mapObject instanceof ArrayList) {
    for (Object mapObjectElement : (ArrayList) mapObject) {
      removeFromMap(mapObjectElement);
    }
  }
}

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

public void remove() {
  if (marker != null) {
    marker.remove();
    marker = null;
  } else {
    map = null;
    markerOptions = null;
    listener = null;
  }
}

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

void cleanup() {
  if (virtual != null) {
    virtual.remove();
  }
}

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

void removeVirtual() {
  if (virtual != null) {
    virtual.remove();
    virtual = null;
  }
}

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

@Override
public void remove() {
  marker.remove();
}

代码示例来源:origin: mizutori/AndroidLocationStarterKit

public void clearMalMarkers(){
  for (Marker marker : malMarkers){
    marker.remove();
  }
}

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

/**
 * Remove the currently selected marker.
 */
public void removeSelectedMarker() {
  this.markers.remove(this.selectedMarker);
  this.selectedMarker.remove();
}

代码示例来源:origin: ac-opensource/MarkerBuilder

public void removeArea() {
  if(resizerMarker != null) resizerMarker.remove();
  if(centerMarker != null) centerMarker.remove();
  if(circle != null) circle.remove();
}

代码示例来源:origin: ac-opensource/MarkerBuilder

public void removeArea() {
  if(radiusMarker != null) radiusMarker.remove();
  if(centerMarker != null) centerMarker.remove();
  if(circle != null) circle.remove();
}

代码示例来源:origin: wiglenet/wigle-wifi-wardriving

public void clear() {
  for (Marker marker : mMarkers) {
    marker.remove();
    mAllMarkers.remove(marker);
  }
  mMarkers.clear();
}

代码示例来源:origin: wiglenet/wigle-wifi-wardriving

public boolean remove(Marker marker) {
  if (mMarkers.remove(marker)) {
    mAllMarkers.remove(marker);
    marker.remove();
    return true;
  }
  return false;
}

代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android

public void removeBikeStations(){
  if (mBikeRentalStations != null) {
    for (Map.Entry<Marker, BikeRentalStationInfo> entry : mBikeRentalStations.entrySet()) {
      entry.getKey().remove();
    }
    mBikeRentalStations = null;
  }
}

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

@Override
public void removeMarker(@Nullable FusedContact contact) {
  if(contact == null)
    return;
  Marker m = mMarkers.get(contact.getId());
  if(m != null)
    m.remove();
}

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

@Override
  public void onMapClick(LatLng arg0) {
    if (listVisible) {
      longpressLocation = arg0;
      longPressMarker.remove();
      list.setVisibility(View.INVISIBLE);
      listVisible = false;
    }
  }
});

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

/**
 * Removes the last added point, the line to it and updates the distance
 */
private void removeLast() {
  if (trace.isEmpty()) return;
  points.pop().remove();
  LatLng remove = trace.pop();
  if (!trace.isEmpty())
    distance -= SphericalUtil.computeDistanceBetween(remove, trace.peek());
  if (!lines.isEmpty()) lines.pop().remove();
  updateValueText();
}

代码示例来源: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(""));
  }
});

相关文章