Ignore:
Timestamp:
2013-01-28T14:06:52+01:00 (11 years ago)
Author:
bastiK
Message:

add session support for marker layers (see #4029)

The data is exported to a separate GPX file that contains one waypoint for each marker.
This is not very elegant, because most of the time, all the info is already contained in the original GPX File.
However, when dealing with audio markers, they can be synchronized, or additional markers are added
at certain playback positions. This info must be retained.
Another complication is, that two or more MarkerLayers can be merged to one.

All these problems are avoided by explicitly exporting the markers to a separate file (as done in this commit).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/WebMarker.java

    r4282 r5684  
    66import java.awt.event.ActionEvent;
    77import java.net.URL;
     8import java.util.Collections;
    89
    910import javax.swing.JOptionPane;
     
    1112import org.openstreetmap.josm.Main;
    1213import org.openstreetmap.josm.data.coor.LatLon;
     14import org.openstreetmap.josm.data.gpx.GpxConstants;
     15import org.openstreetmap.josm.data.gpx.GpxLink;
     16import org.openstreetmap.josm.data.gpx.WayPoint;
    1317import org.openstreetmap.josm.tools.OpenBrowser;
    1418
     
    3842        }
    3943    }
     44
     45    @Override
     46    public WayPoint convertToWayPoint() {
     47        WayPoint wpt = super.convertToWayPoint();
     48        GpxLink link = new GpxLink(webUrl.toString());
     49        link.type = "web";
     50        wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link));
     51        return wpt;
     52    }
    4053}
Note: See TracChangeset for help on using the changeset viewer.