Ticket #2547: gpx_link_patch.diff
File gpx_link_patch.diff, 3.9 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/io/GpxWriter.java
### Eclipse Workspace Patch 1.0 #P core
62 62 // for now it works, but future extension could get very complex and unmaintainable 63 63 for (Map.Entry<String, Object> ent : attr.entrySet()) { 64 64 String k = ent.getKey(); 65 if (k.equals( "link")) {65 if (k.equals(GpxData.META_LINKS)) { 66 66 for (GpxLink link : (Collection<GpxLink>) ent.getValue()) { 67 67 gpxLink(link); 68 68 } -
src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
79 79 for (WayPoint wpt : indata.waypoints) { 80 80 /* calculate time differences in waypoints */ 81 81 double time = wpt.time; 82 boolean wpt_has_link = wpt.attr.containsKey( "link");82 boolean wpt_has_link = wpt.attr.containsKey(GpxData.META_LINKS); 83 83 if (firstTime < 0 && wpt_has_link) { 84 84 firstTime = time; 85 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get( "link")) {85 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) { 86 86 lastLinkedFile = oneLink.uri; 87 87 break; 88 88 } 89 89 } 90 90 if (wpt_has_link) { 91 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get( "link")) {91 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) { 92 92 if (!oneLink.uri.equals(lastLinkedFile))firstTime = time; 93 93 lastLinkedFile = oneLink.uri; 94 94 break; -
src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
16 16 import org.openstreetmap.josm.Main; 17 17 import org.openstreetmap.josm.data.coor.EastNorth; 18 18 import org.openstreetmap.josm.data.coor.LatLon; 19 import org.openstreetmap.josm.data.gpx.GpxData; 19 20 import org.openstreetmap.josm.data.gpx.GpxLink; 20 21 import org.openstreetmap.josm.data.gpx.WayPoint; 21 22 import org.openstreetmap.josm.gui.MapView; … … 81 82 // cheapest way to check whether "link" object exists and is a non-empty 82 83 // collection of GpxLink objects... 83 84 try { 84 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get( "link")) {85 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) { 85 86 uri = oneLink.uri; 86 87 break; 87 88 } -
src/org/openstreetmap/josm/io/GpxReader.java
236 236 } 237 237 if (currentState == state.author) { 238 238 currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink); 239 } else if (currentState == state.metadata) {239 } else if (currentState != state.link) { 240 240 Map<String, Object> attr = getAttr(); 241 241 if (!attr.containsKey(GpxData.META_LINKS)) { 242 242 attr.put(GpxData.META_LINKS, new LinkedList<GpxLink>());