public synchronized void put(final K key, final GeoItem item, final boolean show) {

        if (!GeoItem.isValid(item)) {
            Log.d("GeoItemLayer: adding invalid item: " + key + ": " + item);
        }

        final Pair<GeoItem, Boolean> previousItem = itemMap.get(key);
        if (previousItem != null && previousItem.second && !show) {
            //item for key existed and is currently shown, but new key should NOT be shown -> remove from map
            removeFromMap(key, previousItem.first);
        }

        itemMap.put(key, new Pair<>(item, show));

        //draw new item on map if necessary
        if (show) {
            putToMap(key, item, previousItem == null ? null : previousItem.first);
        }
    }
Puts a new GeoItem onto the layer. If an object for same key already exists, it is replaced.
If "show" is false, the item is added to the layer but not (yet) shown.
main/src/main/java/cgeo/geocaching/unifiedmap/geoitemlayer/GeoItemLayer.java