private synchronized void drawRouteAndTracks() {
        // draw individual route
        routeObjs.removeAll();
        final CachedRoute individualRoute = cache.get(KEY_INDIVIDUAL_ROUTE);
        if (individualRoute != null && !individualRoute.isHidden && individualRoute.track != null && !individualRoute.track.isEmpty()) {
            for (List<LatLng> segment : individualRoute.track) {
                routeObjs.addPolyline(new PolylineOptions()
                        .addAll(segment)
                        .color(MapLineUtils.getRouteColor())
                        .width(MapLineUtils.getRouteLineWidth(false))
                        .zIndex(ZINDEX_ROUTE)
                );
            }
            for (RouteItem item : individualRoutePoints) {
                routeObjs.addMarker(new MarkerOptions()
                        .icon(BitmapDescriptorCache.toBitmapDescriptor(ResourcesCompat.getDrawable(CgeoApplication.getInstance().getResources(), R.drawable.marker_routepoint, null)))
                        .position(GP_CONVERTER.to(item.getPoint()))
                        .anchor(0.5f, 0.5f));
            }
        }
        // draw tracks
        trackObjs.removeAll();
        synchronized (cache) {
            for (CachedRoute c : cache.values()) {
                // route hidden, no route or route too short?
                if (c != individualRoute && !c.isHidden && c.track != null && !c.track.isEmpty()) {
                    for (List<LatLng> segment : c.track) {
                        trackObjs.addPolyline(new PolylineOptions()
                                .addAll(segment)
                                .color(c.color)
                                .width(MapLineUtils.getWidthFromRaw(c.width, false))
                                .zIndex(ZINDEX_TRACK)
                        );
                    }
                }
            }
        }
    }
maximum distance (in meters) up to which two points in the trail get connected by a drawn line
main/src/main/java/cgeo/geocaching/maps/google/v2/GooglePositionAndHistory.java