本文整理汇总了Java中com.google.android.gms.maps.model.Marker.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.remove方法的具体用法?Java Marker.remove怎么用?Java Marker.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.model.Marker
的用法示例。
在下文中一共展示了Marker.remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: settaMarkersGiaPresenti
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Imposta un marker per ogni parcheggio già presente in zona
*/
void settaMarkersGiaPresenti() {
// rimuovi tutti i markers
for(Marker m : mMarkerListPresenti)
m.remove();
mMarkerListPresenti.clear();
// aggiungi un marker per ogni posizione
for (Parcheggio p : ElencoParcheggi.getInstance().getListParcheggi()) {
LatLng coordParcheggio = p.getCoordinate();
Marker marker = mMappa.addMarker(new MarkerOptions()
.position(coordParcheggio)
.title(p.getIndirizzo())
.icon(BitmapDescriptorFactory.defaultMarker(138)));
// Associo al marker un tag che corrisponde al parcheggio in questo modo posso
// poi eliminarlo direttamente
marker.setTag(p);
mMarkerListPresenti.add(marker);
}
mMainActivity.modificaTxtMarkerPresenti(ElencoParcheggi.getInstance().getListParcheggi().size());
}
示例2: removeMarker
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Removes the given marker from the map layout
*
* @param marker marker to remove
* @return true if marker has been removed, false if it has not been found
*/
public boolean removeMarker(Marker marker) {
synchronized (customMarkersMap) {
if (customMarkersMap.containsValue(marker)){
Iterator<com.ubudu.gmaps.model.Marker> iterator = customMarkersMap.keySet().iterator();
while(iterator.hasNext()) {
com.ubudu.gmaps.model.Marker m = iterator.next();
Marker googleMarker = customMarkersMap.get(m);
if(googleMarker.equals(marker)) {
googleMarker.remove();
iterator.remove();
return true;
}
}
}
}
return false;
}
示例3: onToggleAction
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
protected void onToggleAction() {
if (shouldShow()) {
for (final LatLng latLng : this.boatSpawns) {
final MarkerOptions markerOptions = createMarkerOptions();
markerOptions.position(latLng);
this.boatMarkers.add(this.mapController.addMarker(markerOptions));
}
} else {
for (final Marker marker : this.boatMarkers) {
marker.remove();
}
this.boatMarkers.clear();
}
}
示例4: onToggleAction
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
protected void onToggleAction() {
if (shouldShow()) {
for (final LatLng latLng : this.vehicleSpawns) {
final MarkerOptions markerOptions = createMarkerOptions();
markerOptions.position(latLng);
this.vehicleMarkers.add(this.mapController.addMarker(markerOptions));
}
} else {
for (final Marker marker : this.vehicleMarkers) {
marker.remove();
}
this.vehicleMarkers.clear();
}
}
示例5: removeMarkerFromMap
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private void removeMarkerFromMap(PharmacyObjectMap pharmacy) {
Marker marker = getKeyFromValue(pharmacy);
if (marker != null) {
marker.remove();
}
}
示例6: clearPolygons
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
public static void clearPolygons(Context context) {
// Remove all polygons from map
for (Polygon polygon : mPolygonsToClear) {
polygon.remove();
}
for (Circle circle : mPolygonsRedToClear) {
circle.remove();
}
for (Marker marker : mIntersectingToClear) {
marker.remove();
}
mIntersecting.clear();
mIntersectingToClear.clear();
mPolygonsRedToClear.clear();
mPolygonsRed.clear();
// Clear ArrayList holding polygons
mPolygonsToClear.clear();
// Clear ArrayList holding polygon point LatLng objects
mPolygonPointsGreen.clear();
DatabaseHelper myDb = DatabaseHelper.getInstance(context);
// Clear ArrayList containing hole LatLng objects
mHoles.clear();
// Reset transparency on all markers
SpawnLocation.markerResetTransparency();
// Remove from database
myDb.removeAllHoles();
myDb.removePolygons();
myDb.removeCircles();
myDb.removeIntersections();
myDb.close();
}
示例7: removePhoto
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void removePhoto(Photo photo) {
for (Map.Entry<Marker, Photo> entry : markers.entrySet()) {
Photo currentPhoto = entry.getValue();
Marker currentMarker = entry.getKey();
if (currentPhoto.getId().equals(photo.getId())) {
currentMarker.remove();
markers.remove(currentMarker);
break;
}
}
}
示例8: removeZone
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
public void removeZone(String name) {
synchronized (zoneVsMarkerAndPolygonMap) {
for (Zone zone : zoneVsMarkerAndPolygonMap.keySet()) {
if (zone.getName().equals(name)) {
Pair<Marker, Polygon> markerAndPolygon = zoneVsMarkerAndPolygonMap.get(zone);
Marker m = markerAndPolygon.first;
Polygon p = markerAndPolygon.second;
m.remove();
p.remove();
zoneVsMarkerAndPolygonMap.remove(zone);
break;
}
}
}
}
示例9: removeZones
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Removes all zones
*/
public void removeZones() {
synchronized (zoneVsMarkerAndPolygonMap) {
for (Zone zone : zoneVsMarkerAndPolygonMap.keySet()) {
Pair<Marker, Polygon> markerAndPolygon = zoneVsMarkerAndPolygonMap.get(zone);
Marker m = markerAndPolygon.first;
Polygon p = markerAndPolygon.second;
m.remove();
p.remove();
zoneVsMarkerAndPolygonMap.remove(zone);
}
}
}
示例10: settaMarkers
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Imposta un marker per ogni parcheggio e, se disponibile, per la posizione attuale
*/
public void settaMarkers() {
// rimuovi tutti i markers già presenti nella mappa
for(Marker m : mListMarker)
m.remove();
mListMarker.clear();
mMarkerSelezionato = null;
if(mPosizioneUtente != null)
mPosizioneUtente.remove();
mPosizioneUtente = null;
// aggiungi un marker per ogni parcheggio
for (Parcheggio p : ElencoParcheggi.getInstance().getListParcheggi()) {
LatLng coordParcheggio = p.getCoordinate();
Marker marker = getMappaGoogle().addMarker(new MarkerOptions()
.position(coordParcheggio)
.title(p.getIndirizzoUI())
.icon(BitmapDescriptorFactory.defaultMarker(54)));
mListMarker.add(marker);
}
// aggiungi un marker nella posizione dell'utente. Se le coordinate riportate sono
// esattamente quelle iniziali (ovvero siamo nella ricerca all'avvio) non viene mostrato
// il marker nella posizione dell'utente
if(ElencoParcheggi.getInstance().getCoordAttuali() != COORD_INIZIALI) {
mPosizioneUtente = getMappaGoogle().addMarker(new MarkerOptions()
.position(ElencoParcheggi.getInstance().getCoordAttuali())
.title(mMainActivity.getString(R.string.tua_posizione)));
}
}
示例11: eliminaTuttiMarkers
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Metodo per eliminare tutti i marker dalla mappa, oltre ai relativi riferimenti
*/
public void eliminaTuttiMarkers() {
if (mMarkerProvvisorio != null)
mMarkerProvvisorio.remove();
for(Marker m : mMarkerListDaInviare)
m.remove();
mMarkerListDaInviare.clear();
mMarkerProvvisorio = null;
mMainActivity.modificaTxtMarkerInSospeso(false);
mMainActivity.modificaTxtMarkerDaCaricare(mMarkerListDaInviare.size());
mMainActivity.creaToast(R.string.markers_eliminati);
}
示例12: remove
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Remove from the map
*/
public void remove() {
if (polygon != null) {
polygon.remove();
polygon = null;
}
for (Marker marker : markers) {
marker.remove();
}
for (PolygonHoleMarkers hole : holes) {
hole.remove();
}
}
示例13: eliminaMarkersVerdi
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Elimina i markers 'verdi' e i loro riferimenti dalla mappa
*/
void eliminaMarkersVerdi() {
for (Marker m : mMarkerListPresenti)
m.remove();
mMarkerListPresenti.clear();
mMainActivity.modificaTxtMarkerPresenti(0);
}
示例14: remove
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* Remove from the map
*/
public void remove() {
if (polyline != null) {
polyline.remove();
polyline = null;
}
for (Marker marker : markers) {
marker.remove();
}
}
示例15: delete
import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void delete(Marker marker) {
if (markers.remove(marker)) {
marker.remove();
update();
}
}