Marcador de google maps definido en XML de presentación

¿Es posible definir en la carpeta Layouts (Android) un archivo XML donde especifique cómo se verá mi puntero / marcador? Por ejemplo, me gustaría tener una imagen y un TextView como marcador (no el popup, pero el marcador en sí).

He estado usando Google Maps Utility Library para usar Clusters en Google Maps, pero solo tienen ejemplos de cómo hacerlo usando el marcador blanco normal con el fondo ( ejemplo )

Digamos que quiero exactamente lo que tienen, excepto la pizarra blanca alrededor.

¿Sabes cómo puedo lograr esto?

Gracias por adelantado.

EDITAR:

Estoy intentando combinar este tutorial con Google Maps Utility Library (Clusters). Por ahora tengo esto, pero no funciona:

Custom_cluster_marker_layout.xml

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/image" android:layout_width="55dp" android:layout_height="65dp" android:src="@drawable/cluster" /> <TextView android:id="@+id/num_txt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="19dp" android:layout_marginTop="10dp" android:gravity="center" android:text="0" android:textColor="#ce8223" android:textSize="25dp" android:textStyle="bold" /> </RelativeLayout> 

MeterRender.java

 private class MeterRenderer extends DefaultClusterRenderer<MyMeter> { private TextView mClusterTextView; public MeterRenderer() { super(c, map, mClusterManager); View custom_cluster_view = ((LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.custom_cluster_marker_layout, null); mClusterTextView = (TextView) custom_cluster_view.findViewById(R.id.num_txt); } @Override protected void onBeforeClusterItemRendered(MyMeter meter, MarkerOptions markerOptions) { markerOptions.icon(BitmapDescriptorFactory .fromPath(createBillboardTexture("a", "123"))); } @Override protected void onBeforeClusterRendered(Cluster<MyMeter> cluster, MarkerOptions markerOptions) { View custom_cluster_view = ((LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.custom_cluster_marker_layout, null); mClusterTextView = (TextView) custom_cluster_view.findViewById(R.id.num_txt); mClusterTextView.setText(cluster.getSize()); markerOptions.icon(BitmapDescriptorFactory.fromBitmap(createDrawableFromView(c, custom_cluster_view))); } public Bitmap createDrawableFromView(Context context, View view) { DisplayMetrics displayMetrics = new DisplayMetrics(); ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); view.measure(displayMetrics.widthPixels, displayMetrics.heightPixels); view.layout(0, 0, displayMetrics.widthPixels, displayMetrics.heightPixels); view.buildDrawingCache(); Bitmap bitmap = Bitmap.createBitmap(view.getMeasuredWidth(), view.getMeasuredHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); view.draw(canvas); return bitmap; } } 

Probablemente ya has añadido Marker en tu mapa, así que intenta usar Marker lugar de MarkerOptions

 @Override protected void onBeforeClusterItemRendered(MyMeter meter, Marker marker) { marker.setIcon(BitmapDescriptorFactory .fromPath(createBillboardTexture("a", "123"))); } @Override protected void onBeforeClusterRendered(Cluster<MyMeter> cluster, Marker marker) { View custom_cluster_view = ((LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.custom_cluster_marker_layout, null); mClusterTextView = (TextView) custom_cluster_view.findViewById(R.id.num_txt); mClusterTextView.setText(cluster.getSize()); marker.setIcon(BitmapDescriptorFactory.fromBitmap(createDrawableFromView(c, custom_cluster_view))); } 

Puede usar su propia imagen como marcador. Puede cargar el icono de fuentes.

 fromAsset(String assetName) – Loading from assets folder fromBitmap (Bitmap image) – Loading bitmap image fromFile (String path) – Loading from file fromResource (int resourceId) – Loading from drawable resource // create marker MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps"); // Changing marker icon marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker_icon))); // adding marker googleMap.addMarker(marker); 
  • Cómo agregar valores en google map v2 marcador android?
  • Android google maps marker desactivar la opción de navegación
  • Los marcadores se mueven al realizar el zoom con Google Maps Android API v2
  • Detectar si el usuario "anula la selección" del marcador en el mapa de google
  • Implementar la animación de caída de pines en google maps android
  • Android onMarkerClick no llama después de que InfoWindow se oculte en GoogleMap Google Maps Android API v2
  • Maps de Android ClusteredMarkers - no muestran unclustered?
  • Cambio de z-index (z-order) de marcador de mapa para Maps V2 en Android
  • Mueva la posición de la cámara para ajustar LatLngBounds con respecto a la altura del marcador
  • Android toque en el mapa y obtenga coordenadas
  • Android: cómo volver a cargar marcadores personalizados una vez que la imagen se descarga a través de Picasso?
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.