Ignore:
Timestamp:
2017-12-17T15:37:11+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #15606 - export relation to GPX file or convert to a new GPX layer (patch by cmuelle8, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/ImmutableGpxTrack.java

    r12289 r13210  
    3535        this.attr = Collections.unmodifiableMap(new HashMap<>(attributes));
    3636        this.segments = Collections.unmodifiableList(newSegments);
     37        this.length = calculateLength();
     38        this.bounds = calculateBounds();
     39    }
     40
     41    /**
     42     * Constructs a new {@code ImmutableGpxTrack} from {@code GpxTrackSegment} objects.
     43     * @param segments The segments to build the track from.  Input is not deep-copied,
     44     *                 which means the caller may reuse the same segments to build
     45     *                 multiple ImmutableGpxTrack instances from.  This should not be
     46     *                 a problem, since this object cannot modify {@code this.segments}.
     47     * @param attributes Attributes for the GpxTrack, the input map is copied.
     48     * @since 13210
     49     */
     50    public ImmutableGpxTrack(List<GpxTrackSegment> segments, Map<String, Object> attributes) {
     51        this.attr = Collections.unmodifiableMap(new HashMap<>(attributes));
     52        this.segments = Collections.unmodifiableList(segments);
    3753        this.length = calculateLength();
    3854        this.bounds = calculateBounds();
Note: See TracChangeset for help on using the changeset viewer.