本文整理匯總了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();
}
}