public void showPositionOnTrack(final Geopoint coords) {
        // calculate new position on track only if minimum distance reached
        if (lastShownPosition != null && coords.distanceTo(lastShownPosition) < 0.05f) {
            return;
        }
        lastShownPosition = coords;
        // find position
        float minDistance = 0.1f;
        int x = -1;
        int index = 0;
        for (Entry entry : entries) {
            final float distance = ((Geopoint) entry.getData()).distanceTo(coords);
            if (distance < minDistance) {
                x = index;
                minDistance = distance;
            }
            index++;
        }
        // display hairpin line for found position + adapt x axis labelling
        offset = x < 0 ? 0f : entries.get(x).getX();
        chart.highlightValue(offset, x < 0 ? -1 : 0);
        chart.invalidate();
    }
find position on track closest to given coords (max 100m) and highlight it
main/src/main/java/cgeo/geocaching/unifiedmap/layers/ElevationChart.java