void repaintPositionOverlay() {
        final long currentTimeMillis = System.currentTimeMillis();
        final boolean usesPreciseAutorotation = Settings.getMapRotation() == Settings.MAPROTATION_AUTO_PRECISE && (!currentLocation.hasSpeed() || currentLocation.getSpeed() <= MAX_SPEED_PRECISE_AUTOROTATION);
        if (currentTimeMillis > (timeLastPositionOverlayCalculation + (usesPreciseAutorotation ? MIN_UPDATE_INTERVAL_PRECISE_AUTOROTATION : MIN_UPDATE_INTERVAL))) {
            timeLastPositionOverlayCalculation = currentTimeMillis;
            final boolean needsRepaintForDistanceOrAccuracy = needsRepaintForDistanceOrAccuracy(viewModel);
            final boolean needsRepaintForHeading = needsRepaintForHeading(viewModel, usesPreciseAutorotation);

            if (needsRepaintForDistanceOrAccuracy) {
                final PositionHistory ph = viewModel.positionHistory.getValue();
                if (ph != null) {
                    ph.rememberTrailPosition(currentLocation);
                }
            }

            if (needsRepaintForDistanceOrAccuracy || needsRepaintForHeading) {
                viewModel.location.postValue(new LocationWrapper(currentLocation, currentHeading, needsRepaintForDistanceOrAccuracy, needsRepaintForHeading));
            }
        }
    }
Repaint position overlay but only with a max frequency and if position or heading changes sufficiently.
main/src/main/java/cgeo/geocaching/unifiedmap/LocUpdater.java