@NonNull
    public static CacheMarker getWaypointMarker(final Resources res, final Waypoint waypoint, final boolean showPin, final boolean applyScaling) {
        final WaypointType waypointType = waypoint.getWaypointType();
        final String id = null == waypointType ? WaypointType.WAYPOINT.id : waypointType.id;

        final HashCodeBuilder hcb = new HashCodeBuilder()
                .append(waypoint.isVisited())
                .append(id)
                .append(waypoint.getMapMarkerId())
                .append(showPin)
                .append(applyScaling);
        final Geocache cache = waypoint.getParentGeocache();
        if (null != cache) {
            hcb.append(getAssignedMarkers(cache))
                    .append(getMarkerIdIfLogged(cache))
                    .append(cache.isDisabled())
                    .append(cache.isArchived())
                    .append(cache.isLinearAlc() ? waypoint.getPrefix() : false)
                    .append(cache.getAssignedEmoji())
                    .append(cache.getType())
                    .append(cache.isFound());
        }
        final int hashcode = hcb.toHashCode();

        synchronized (overlaysCache) {
            CacheMarker marker = overlaysCache.get(hashcode);
            if (marker == null) {
                marker = new CacheMarker(hashcode, createWaypointMarker(res, waypoint, cache, showPin, applyScaling));
                overlaysCache.put(hashcode, marker);
            }
            return marker;
        }
    }
Obtain the drawable for a given waypoint.
Return a drawable from the cache, if a similar drawable was already generated.

@param res      the resources to use
@param waypoint the waypoint to build the drawable for
@return a drawable representing the current waypoint status
main/src/main/java/cgeo/geocaching/utils/MapMarkerUtils.java