public static BitmapDescriptor toBitmapDescriptor(final Drawable d) {
        final Canvas canvas = new Canvas();
        final int width = d.getIntrinsicWidth();
        final int height = d.getIntrinsicHeight();
        final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        canvas.setBitmap(bitmap);
        d.setBounds(0, 0, width, height);
        d.draw(canvas);
        return BitmapDescriptorFactory.fromBitmap(bitmap);
    }
rely on unique hashcode of CacheMarker
main/src/main/java/cgeo/geocaching/maps/google/v2/BitmapDescriptorCache.java