private void showPopup(final GeoitemRef item) {
        if (item == null || StringUtils.isEmpty(item.getGeocode())) {
            return;
        }

        try {
            if (item.getType() == CoordinateType.CACHE) {
                final Geocache cache = DataStore.loadCache(item.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
                if (cache != null) {
                    popupGeocodes.add(cache.getGeocode());
                    sheetInfo = new UnifiedMapViewModel.SheetInfo(cache.getGeocode(), 0);
                    sheetShowDetails(sheetInfo);
                    return;
                }
                return;
            }

            if (item.getType() == CoordinateType.WAYPOINT && item.getId() >= 0) {
                popupGeocodes.add(item.getGeocode());
                sheetInfo = new UnifiedMapViewModel.SheetInfo(item.getGeocode(), item.getId());
                sheetShowDetails(sheetInfo);
            }

        } catch (final NotFoundException e) {
            Log.e("NewMap.showPopup", e);
        }
    }
Repaint position overlay but only with a max frequency and if position or heading changes sufficiently.
main/src/main/java/cgeo/geocaching/maps/mapsforge/v6/NewMap.java