private static Drawable createTypeMarker(final Resources res, final Geocache cache, final boolean withBorder, final boolean applyScaling, final boolean scaleForCache) {
        final float scalingFactor;
        if (scaleForCache) {
            scalingFactor = getCacheScalingFactor(applyScaling);
        } else {
            scalingFactor = getWaypointScalingFactor(applyScaling);
        }
        final Drawable markerBg;
        if (withBorder) {
            markerBg = ViewUtils.getDrawable(R.drawable.marker_empty, scalingFactor, true);
        } else {
            markerBg = ViewUtils.getDrawable(R.drawable.marker_background, scalingFactor, true);
        }
        final InsetsBuilder markerBuilder = new InsetsBuilder(res, markerBg.getIntrinsicWidth(), markerBg.getIntrinsicHeight(), true);
        markerBuilder.withInset(new InsetBuilder(markerBg));
        // cache type background color
        final int tintColor = (cache.isArchived() || cache.isDisabled()) ? R.color.cacheType_disabled : cache.getType().typeColor;
        final Drawable backgroundTemp;
        // special case for drawing the userdefined type icon in filter dialog
        if (!"ZZ1".equals(cache.getGeocode())) {
            backgroundTemp = ViewUtils.getDrawable(R.drawable.marker_background, true);
        } else {
            backgroundTemp = ViewUtils.getDrawable(R.drawable.dot_marker_other, true);
        }
        DrawableCompat.setTint(backgroundTemp, ResourcesCompat.getColor(res, tintColor, null));
        markerBuilder.withInset(new InsetBuilder(new ScalableDrawable(backgroundTemp, scalingFactor), Gravity.CENTER));
        markerBuilder.withInset(new InsetBuilder(cache.getType().markerId, Gravity.CENTER, scalingFactor));
        return buildLayerDrawable(markerBuilder, 3, 3);
    }
Create the LayerDrawable representing the cache type icon

@param res   Android Resources
@param cache Geocache to get the icon for
@param withBorder    Draw a round border around the icon (for waypoint markers)
@param applyScaling  S
@return Layered Drawable
main/src/main/java/cgeo/geocaching/utils/MapMarkerUtils.java