¿Crear un marcador sin agregarlo al mapa?
- Cómo crear instancia de la clase Marker, pero sin agregarla al mapa.
- SupportMapFragment en DialogFragment
- Google Maps Android: el mapa de repente no se muestra
- NullPointerException cuando se utiliza RelativeLayout como InfoWindow personalizado
- GoogleMaps v2 para Android: No se puede eliminar el marcador mientras se está procesando el mapa
- Google Maps Android API v2 SoporteMapFragmento de pérdida de memoria
- ¿Cómo ajustar el nivel de zoom para ajustar el límite y, a continuación, el mapa del centro en marcador de desplazamiento?
- ActionBarSherlock + ID de duplicado de la API de Google Maps v2
- Código para agregar marcadores al mapa usando android google maps v2
Puede utilizar LazyMarker.java desde Android Maps Extensions .
No crea físicamente el marcador hasta que usted llama setVisible(true)
en él.
Puede hacerlo estableciendo la visibility
en false
Marker marker = mMap.addMarker(new MarkerOptions() .position( new LatLng(arg0.latitude, arg0.longitude)) .draggable(true).visible(false));
Editar
Marker m = new Marker(new z() { @Override public IBinder asBinder() { return null; } @Override public void showInfoWindow() throws RemoteException { } @Override public void setVisible(boolean paramBoolean) throws RemoteException { } @Override public void setTitle(String paramString) throws RemoteException { } @Override public void setSnippet(String paramString) throws RemoteException { } @Override public void setPosition(LatLng paramLatLng) throws RemoteException { } @Override public void setDraggable(boolean paramBoolean) throws RemoteException { } @Override public void remove() throws RemoteException { } @Override public boolean isVisible() throws RemoteException { return false; } @Override public boolean isInfoWindowShown() throws RemoteException { return false; } @Override public boolean isDraggable() throws RemoteException { return false; } @Override public void hideInfoWindow() throws RemoteException { } @Override public int hashCodeRemote() throws RemoteException { return 0; } @Override public String getTitle() throws RemoteException { return null; } @Override public String getSnippet() throws RemoteException { return null; } @Override public LatLng getPosition() throws RemoteException { return null; } @Override public String getId() throws RemoteException { return null; } @Override public boolean g(z paramz) throws RemoteException { return false; } });
Y luego agregarlo cuando quieras así
mMap.addMarker(new MarkerOptions().position((m.getPosition())));
Espero eso ayude
- Vinculación con la biblioteca compartida versionada en Android NDK
- Admob con Android: no se puede analizar android: configChanges in manifal