Changeset 5684 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-01-28T14:06:52+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r5505 r5684 14 14 import java.util.Arrays; 15 15 import java.util.Collection; 16 import java.util.Collections;17 16 import java.util.HashMap; 18 17 import java.util.HashSet; … … 64 63 SessionSaveAsDialog dlg = new SessionSaveAsDialog(); 65 64 dlg.showDialog(); 66 if (dlg.getValue() != 2) return;65 if (dlg.getValue() != 1) return; 67 66 68 67 zipRequired = false; … … 138 137 139 138 public SessionSaveAsDialog() { 140 super(Main.parent, tr("Save Session"), new String[] {tr(" Cancel"), tr("Save As")});139 super(Main.parent, tr("Save Session"), new String[] {tr("Save As"), tr("Cancel")}); 141 140 initialize(); 142 setButtonIcons(new String[] {" cancel", "save_as"});143 setDefaultButton( 2);141 setButtonIcons(new String[] {"save_as", "cancel"}); 142 setDefaultButton(1); 144 143 setRememberWindowGeometry(getClass().getName() + ".geometry", 145 144 WindowGeometry.centerInWindow(Main.parent, new Dimension(350, 450))); -
trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java
r5681 r5684 28 28 public static List<String> WPT_KEYS = Arrays.asList("ele", "time", "magvar", "geoidheight", 29 29 "name", "cmt", "desc", "src", META_LINKS, "sym", "number", "type", 30 "fix", "sat", "hdop", "vdop", "pdop", "ageofdgpsdata", "dgpsid" );30 "fix", "sat", "hdop", "vdop", "pdop", "ageofdgpsdata", "dgpsid", META_EXTENSIONS); 31 31 32 32 } -
trunk/src/org/openstreetmap/josm/data/gpx/IWithAttributes.java
r5681 r5684 5 5 6 6 /** 7 * Object with attributes .7 * Object with attributes (in the context of GPX data). 8 8 */ 9 9 public interface IWithAttributes { 10 11 /** 12 * Returns the Object value to which the specified key is mapped, 13 * or {@code null} if this map contains no mapping for the key. 14 * 15 * @param key the key whose associated value is to be returned 16 * @return the value 17 */ 18 Object get(String key); 10 19 11 20 /** … … 18 27 */ 19 28 String getString(String key); 20 29 21 30 /** 22 * Returns the Collection value to which the specified key is mapped, 31 * Returns the Collection value to which the specified key is mapped, 23 32 * or {@code null} if this map contains no Collection mapping for the key. 24 * 33 * 25 34 * @param key the key whose associated value is to be returned 26 * @return the Collection value to which the specified key is mapped, 35 * @return the Collection value to which the specified key is mapped, 27 36 * or {@code null} if this map contains no Collection mapping for the key 28 37 * @since 5502 29 38 */ 30 Collection<?> getCollection(String key); 39 Collection getCollection(String key); 40 41 /** 42 * Put a key / value pair as a new attribute. 43 * 44 * Overrides key / value pair with the same key (if present). 45 * 46 * @param key the key 47 * @param value the value 48 */ 49 void put(String key, Object value); 50 51 /** 52 * Add a key / value pair that is not part of the GPX schema as an extension. 53 * 54 * @param key the key 55 * @param value the value 56 */ 57 void addExtension(String key, String value); 58 31 59 } -
trunk/src/org/openstreetmap/josm/data/gpx/WithAttributes.java
r5681 r5684 20 20 */ 21 21 public Map<String, Object> attr = new HashMap<String, Object>(0); 22 23 /** 24 * Returns the Object value to which the specified key is mapped, 25 * or {@code null} if this map contains no mapping for the key. 26 * 27 * @param key the key whose associated value is to be returned 28 * @return the value 29 */ 30 @Override 31 public Object get(String key) { 32 return attr.get(key); 33 } 22 34 23 35 /** … … 45 57 */ 46 58 @Override 47 public Collection <?>getCollection(String key) {59 public Collection getCollection(String key) { 48 60 Object value = attr.get(key); 49 return (value instanceof Collection<?>) ? (Collection<?>)value : null; 61 return (value instanceof Collection) ? (Collection)value : null; 62 } 63 64 /** 65 * Put a key / value pair as a new attribute. 66 * 67 * Overrides key / value pair with the same key (if present). 68 * 69 * @param key the key 70 * @param value the value 71 */ 72 @Override 73 public void put(String key, Object value) { 74 attr.put(key, value); 75 } 76 77 /** 78 * Add a key / value pair that is not part of the GPX schema as an extension. 79 * 80 * @param key the key 81 * @param value the value 82 */ 83 @Override 84 public void addExtension(String key, String value) { 85 if (!attr.containsKey(META_EXTENSIONS)) { 86 attr.put(META_EXTENSIONS, new Extensions()); 87 } 88 Extensions ext = (Extensions) attr.get(META_EXTENSIONS); 89 ext.put(key, value); 50 90 } 51 91 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarker.java
r4282 r5684 4 4 import java.awt.event.ActionEvent; 5 5 import java.net.URL; 6 import java.util.Collections; 6 7 7 8 import org.openstreetmap.josm.Main; 8 9 import org.openstreetmap.josm.data.coor.LatLon; 10 import org.openstreetmap.josm.data.gpx.GpxConstants; 11 import org.openstreetmap.josm.data.gpx.GpxLink; 12 import org.openstreetmap.josm.data.gpx.WayPoint; 9 13 import org.openstreetmap.josm.tools.AudioPlayer; 10 14 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider; … … 77 81 return TemplateEntryProperty.forAudioMarker(parentLayer.getName()); 78 82 } 83 84 @Override 85 public WayPoint convertToWayPoint() { 86 WayPoint wpt = super.convertToWayPoint(); 87 GpxLink link = new GpxLink(audioUrl.toString()); 88 link.type = "audio"; 89 wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link)); 90 wpt.addExtension("offset", Double.toString(offset)); 91 wpt.addExtension("sync-offset", Double.toString(syncOffset)); 92 return wpt; 93 } 79 94 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java
r4282 r5684 8 8 import java.awt.event.ActionListener; 9 9 import java.net.URL; 10 import java.util.Collections; 10 11 11 12 import javax.swing.Icon; … … 21 22 import org.openstreetmap.josm.Main; 22 23 import org.openstreetmap.josm.data.coor.LatLon; 24 import org.openstreetmap.josm.data.gpx.GpxConstants; 25 import org.openstreetmap.josm.data.gpx.GpxLink; 26 import org.openstreetmap.josm.data.gpx.WayPoint; 23 27 import org.openstreetmap.josm.tools.ImageProvider; 24 28 … … 83 87 } 84 88 89 @Override 90 public WayPoint convertToWayPoint() { 91 WayPoint wpt = super.convertToWayPoint(); 92 GpxLink link = new GpxLink(imageUrl.toString()); 93 link.type = "image"; 94 wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link)); 95 return wpt; 96 } 97 85 98 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r5681 r5684 8 8 import java.net.MalformedURLException; 9 9 import java.net.URL; 10 import java.text.DateFormat; 11 import java.text.SimpleDateFormat; 10 12 import java.util.ArrayList; 11 13 import java.util.Collection; 14 import java.util.Date; 12 15 import java.util.HashMap; 13 16 import java.util.LinkedList; 14 17 import java.util.List; 15 18 import java.util.Map; 19 import java.util.TimeZone; 16 20 17 21 import javax.swing.Icon; … … 23 27 import org.openstreetmap.josm.data.coor.EastNorth; 24 28 import org.openstreetmap.josm.data.coor.LatLon; 29 import org.openstreetmap.josm.data.gpx.Extensions; 25 30 import org.openstreetmap.josm.data.gpx.GpxConstants; 26 31 import org.openstreetmap.josm.data.gpx.GpxLink; … … 181 186 Marker.markerProducers.add(new MarkerProducers() { 182 187 @SuppressWarnings("unchecked") 188 @Override 183 189 public Marker createMarker(WayPoint wpt, File relativePath, MarkerLayer parentLayer, double time, double offset) { 184 190 String uri = null; … … 217 223 } 218 224 else if (url.toString().endsWith(".wav")) { 219 return new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset); 225 AudioMarker audioMarker = new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset); 226 Extensions exts = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS); 227 if (exts != null && exts.containsKey("offset")) { 228 try { 229 double syncOffset = Double.parseDouble(exts.get("sync-offset")); 230 audioMarker.syncOffset = syncOffset; 231 } catch (NumberFormatException nfe) {} 232 } 233 return audioMarker; 220 234 } else if (url.toString().endsWith(".png") || url.toString().endsWith(".jpg") || url.toString().endsWith(".jpeg") || url.toString().endsWith(".gif")) { 221 235 return new ImageMarker(wpt.getCoor(), url, parentLayer, time, offset); … … 234 248 * @param relativePath An path to use for constructing relative URLs or 235 249 * <code>null</code> for no relative URLs 250 * @param parentLayer the <code>MarkerLayer</code> that will contain the created <code>Marker</code> 251 * @param time time of the marker in seconds since epoch 236 252 * @param offset double in seconds as the time offset of this marker from 237 253 * the GPX file from which it was derived (if any). … … 247 263 } 248 264 265 private static final DateFormat timeFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); 266 static { 267 TimeZone tz = TimeZone.getTimeZone("UTC"); 268 timeFormatter.setTimeZone(tz); 269 } 270 249 271 public static final String MARKER_OFFSET = "waypointOffset"; 250 272 public static final String MARKER_FORMATTED_OFFSET = "formattedWaypointOffset"; … … 254 276 public static final String LABEL_PATTERN_DESC = "{desc}"; 255 277 256 257 278 private final TemplateEngineDataProvider dataProvider; 258 279 private final String text; … … 260 281 public final Icon symbol; 261 282 public final MarkerLayer parentLayer; 262 public double time; /* absolute time of marker since epoch */283 public double time; /* absolute time of marker in seconds since epoch */ 263 284 public double offset; /* time offset in seconds from the gpx point from which it was derived, 264 285 may be adjusted later to sync with other data, so not final */ … … 296 317 } 297 318 319 /** 320 * Convert Marker to WayPoint so it can be exported to a GPX file. 321 * 322 * Override in subclasses to add all necessary attributes. 323 * 324 * @return the corresponding WayPoint with all relevant attributes 325 */ 326 public WayPoint convertToWayPoint() { 327 WayPoint wpt = new WayPoint(getCoor()); 328 wpt.put("time", timeFormatter.format(new Date(Math.round(time * 1000)))); 329 if (text != null) { 330 wpt.addExtension("text", text); 331 } else if (dataProvider != null) { 332 for (String key : dataProvider.getTemplateKeys()) { 333 Object value = dataProvider.getTemplateValue(key, false); 334 if (value != null && GpxConstants.WPT_KEYS.contains(key)) { 335 wpt.put(key, value); 336 } 337 } 338 } 339 return wpt; 340 } 341 298 342 public final void setCoor(LatLon coor) { 299 343 if(this.coor == null) { … … 343 387 * @param mv map view 344 388 * @param mousePressed true if the left mouse button is pressed 389 * @param showTextOrIcon true if text and icon shall be drawn 345 390 */ 346 391 public void paint(Graphics g, MapView mv, boolean mousePressed, boolean showTextOrIcon) { … … 398 443 } 399 444 400 private String formatOffset 445 private String formatOffset() { 401 446 int wholeSeconds = (int)(offset + 0.5); 402 447 if (wholeSeconds < 60) -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r5681 r5684 32 32 import org.openstreetmap.josm.data.Bounds; 33 33 import org.openstreetmap.josm.data.coor.LatLon; 34 import org.openstreetmap.josm.data.gpx.Extensions; 34 35 import org.openstreetmap.josm.data.gpx.GpxConstants; 35 36 import org.openstreetmap.josm.data.gpx.GpxData; … … 108 109 } 109 110 } 110 Marker m = Marker.createMarker(wpt, indata.storageFile, this, time, time - firstTime); 111 Double offset = null; 112 // If we have an explicit offset, take it. 113 // Otherwise, for a group of markers with the same Link-URI (e.g. an 114 // audio file) calculate the offset relative to the first marker of 115 // that group. This way the user can jump to the corresponding 116 // playback positions in a long audio track. 117 Extensions exts = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS); 118 if (exts != null && exts.containsKey("offset")) { 119 try { 120 offset = Double.parseDouble(exts.get("offset")); 121 } catch (NumberFormatException nfe) {} 122 } 123 if (offset == null) { 124 offset = time - firstTime; 125 } 126 Marker m = Marker.createMarker(wpt, indata.storageFile, this, time, offset); 111 127 if (m != null) { 112 128 data.add(m); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerProducers.java
r1169 r5684 24 24 * @return A Marker object, or <code>null</code>. 25 25 */ 26 publicMarker createMarker(WayPoint wp, File relativePath, MarkerLayer parentLayer, double time, double offset);26 Marker createMarker(WayPoint wp, File relativePath, MarkerLayer parentLayer, double time, double offset); 27 27 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/WebMarker.java
r4282 r5684 6 6 import java.awt.event.ActionEvent; 7 7 import java.net.URL; 8 import java.util.Collections; 8 9 9 10 import javax.swing.JOptionPane; … … 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.coor.LatLon; 14 import org.openstreetmap.josm.data.gpx.GpxConstants; 15 import org.openstreetmap.josm.data.gpx.GpxLink; 16 import org.openstreetmap.josm.data.gpx.WayPoint; 13 17 import org.openstreetmap.josm.tools.OpenBrowser; 14 18 … … 38 42 } 39 43 } 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 } 40 53 } -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r5681 r5684 340 340 currentState = states.pop(); 341 341 convertUrlToLink(currentWayPoint.attr); 342 if (currentExtensions != null && !currentExtensions.isEmpty()) { 343 currentWayPoint.attr.put(META_EXTENSIONS, currentExtensions); 344 } 342 345 data.waypoints.add(currentWayPoint); 343 346 } -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r5681 r5684 11 11 import java.util.Collection; 12 12 import java.util.Map; 13 import java.util.Map.Entry; 13 14 14 15 import org.openstreetmap.josm.data.Bounds; 15 16 import org.openstreetmap.josm.data.coor.LatLon; 17 import org.openstreetmap.josm.data.gpx.Extensions; 16 18 import org.openstreetmap.josm.data.gpx.GpxConstants; 17 19 import org.openstreetmap.josm.data.gpx.GpxData; … … 20 22 import org.openstreetmap.josm.data.gpx.GpxTrack; 21 23 import org.openstreetmap.josm.data.gpx.GpxTrackSegment; 24 import org.openstreetmap.josm.data.gpx.IWithAttributes; 22 25 import org.openstreetmap.josm.data.gpx.WayPoint; 23 26 … … 42 45 private GpxData data; 43 46 private String indent = ""; 47 public String creator = "JOSM GPX export"; 44 48 45 49 private final static int WAY_POINT = 0; … … 49 53 public void write(GpxData data) { 50 54 this.data = data; 55 // We write JOSM specific meta information into gpx 'extensions' elements. 56 // In particular it is noted whether the gpx data is from the OSM server 57 // (so the rendering of clouds of anonymous TrackPoints can be improved) 58 // and some extra synchronization info for export of AudioMarkers. 59 // It is checked in advance, if any extensions are used, so we know whether 60 // a namespace declaration is necessary. 61 boolean hasExtensions = data.fromServer; 62 if (!hasExtensions) { 63 for (WayPoint wpt : data.waypoints) { 64 Extensions extensions = (Extensions) wpt.get(META_EXTENSIONS); 65 if (extensions != null && !extensions.isEmpty()) { 66 hasExtensions = true; 67 break; 68 } 69 } 70 } 71 51 72 out.println("<?xml version='1.0' encoding='UTF-8'?>"); 52 73 out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\"\n" + 53 ( data.fromServer? String.format(" xmlns:josm=\"%s\"\n", JOSM_EXTENSIONS_NAMESPACE_URI) : "") +74 (hasExtensions ? String.format(" xmlns:josm=\"%s\"\n", JOSM_EXTENSIONS_NAMESPACE_URI) : "") + 54 75 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + 55 76 " xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\">"); … … 63 84 } 64 85 65 @SuppressWarnings("unchecked") 66 private void writeAttr(Map<String, Object> attr) { 86 private void writeAttr(IWithAttributes obj) { 67 87 for (String key : WPT_KEYS) { 68 Object value = attr.get(key); 69 if (value != null) { 70 if (key.equals(META_LINKS)) { 71 for (GpxLink link : (Collection<GpxLink>) value) { 88 if (key.equals(META_LINKS)) { 89 @SuppressWarnings("unchecked") 90 Collection<GpxLink> lValue = obj.getCollection(key); 91 if (lValue != null) { 92 for (GpxLink link : lValue) { 72 93 gpxLink(link); 73 94 } 74 } else { 75 simpleTag(key, value.toString()); 95 } 96 } else if (key.equals(META_EXTENSIONS)) { 97 Extensions extensions = (Extensions) obj.get(key); 98 if (extensions != null) { 99 gpxExtensions(extensions); 100 } 101 } else { 102 String value = obj.getString(key); 103 if (value != null) { 104 simpleTag(key, value); 76 105 } 77 106 } … … 157 186 for (GpxRoute rte : data.routes) { 158 187 openln("rte"); 159 writeAttr(rte .attr);188 writeAttr(rte); 160 189 for (WayPoint pnt : rte.routePoints) { 161 190 wayPoint(pnt, ROUTE_POINT); … … 168 197 for (GpxTrack trk : data.tracks) { 169 198 openln("trk"); 170 writeAttr(trk .getAttributes());199 writeAttr(trk); 171 200 for (GpxTrackSegment seg : trk.getSegments()) { 172 201 openln("trkseg"); … … 259 288 } else { 260 289 openAtt(type, coordAttr); 261 writeAttr(pnt .attr);290 writeAttr(pnt); 262 291 closeln(type); 263 292 } 264 293 } 265 294 } 295 296 private void gpxExtensions(Extensions extensions) { 297 if (extensions != null && !extensions.isEmpty()) { 298 openln("extensions"); 299 for (Entry<String, String> e : extensions.entrySet()) { 300 simpleTag("josm:" + e.getKey(), e.getValue()); 301 } 302 closeln("extensions"); 303 } 304 } 266 305 } -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r5505 r5684 8 8 import java.util.ArrayList; 9 9 import java.util.Date; 10 import java.util.HashMap;11 10 import java.util.List; 12 import java.util.Map;13 11 14 import org.openstreetmap.josm.data.Preferences;15 12 import org.openstreetmap.josm.data.coor.LatLon; 16 import org.openstreetmap.josm.data.imagery.ImageryInfo;17 13 import org.openstreetmap.josm.gui.layer.GpxLayer; 18 import org.openstreetmap.josm.gui.layer.ImageryLayer;19 14 import org.openstreetmap.josm.gui.layer.Layer; 20 15 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer; … … 95 90 } 96 91 97 98 99 92 } -
trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionImporter.java
r5501 r5684 13 13 import javax.xml.xpath.XPathFactory; 14 14 15 import org.w3c.dom.Element; 16 15 17 import org.openstreetmap.josm.gui.layer.Layer; 16 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 17 19 import org.openstreetmap.josm.io.GpxImporter; 18 20 import org.openstreetmap.josm.io.IllegalDataException; 19 import org.w3c.dom.Element;20 21 21 22 public class GpxTracksSessionImporter implements SessionLayerImporter { … … 36 37 } 37 38 38 GpxImporter importer = new GpxImporter();39 39 InputStream in = support.getInputStream(fileStr); 40 GpxImporter.GpxImporterData importData = importer.loadLayers(in, support.getFile(fileStr), support.getLayerName(), null, progressMonitor);40 GpxImporter.GpxImporterData importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), null, progressMonitor); 41 41 42 42 support.addPostLayersTask(importData.getPostLayerTask()); -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java
r5391 r5684 30 30 31 31 private ImageryLayer layer; 32 32 private JCheckBox export; 33 33 34 public ImagerySessionExporter(ImageryLayer layer) { 34 35 this.layer = layer; … … 42 43 this((ImageryLayer) layer); 43 44 } 44 45 private JCheckBox export;46 45 47 46 @Override -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
r5391 r5684 8 8 import java.util.Map; 9 9 10 import org.w3c.dom.Element; 11 import org.w3c.dom.Node; 12 import org.w3c.dom.NodeList; 13 10 14 import org.openstreetmap.josm.data.Preferences; 11 15 import org.openstreetmap.josm.data.imagery.ImageryInfo; … … 16 20 import org.openstreetmap.josm.io.IllegalDataException; 17 21 import org.openstreetmap.josm.io.session.SessionReader.ImportSupport; 18 import org.w3c.dom.Element;19 import org.w3c.dom.Node;20 import org.w3c.dom.NodeList;21 22 22 23 /** -
trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java
r5501 r5684 35 35 import javax.swing.SwingConstants; 36 36 37 import org.w3c.dom.Element; 38 37 39 import org.openstreetmap.josm.actions.SaveAction; 38 40 import org.openstreetmap.josm.gui.layer.Layer; … … 44 46 import org.openstreetmap.josm.tools.GBC; 45 47 import org.openstreetmap.josm.tools.ImageProvider; 46 import org.w3c.dom.Element;47 48 48 49 public class OsmDataSessionExporter implements SessionLayerExporter { -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r5670 r5684 63 63 registerSessionLayerImporter("tracks", GpxTracksSessionImporter.class); 64 64 registerSessionLayerImporter("geoimage", GeoImageSessionImporter.class); 65 registerSessionLayerImporter("markers", MarkerSessionImporter.class); 65 66 } 66 67 … … 305 306 if (scaleEl != null && scaleEl.hasAttribute("meter-per-pixel")) { 306 307 try { 307 Double meterPerPixel = Double.parseDouble(scaleEl.getAttribute("meter-per-pixel"));308 double meterPerPixel = Double.parseDouble(scaleEl.getAttribute("meter-per-pixel")); 308 309 Projection proj = Main.getProjection(); 309 310 // Get a "typical" distance in east/north units that -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r5670 r5684 28 28 import javax.xml.transform.stream.StreamResult; 29 29 30 import org.w3c.dom.Document; 31 import org.w3c.dom.Element; 32 import org.w3c.dom.Text; 33 30 34 import org.openstreetmap.josm.Main; 31 35 import org.openstreetmap.josm.data.coor.EastNorth; … … 38 42 import org.openstreetmap.josm.gui.layer.WMSLayer; 39 43 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer; 44 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 40 45 import org.openstreetmap.josm.tools.MultiMap; 41 46 import org.openstreetmap.josm.tools.Utils; 42 import org.w3c.dom.Document;43 import org.w3c.dom.Element;44 import org.w3c.dom.Text;45 47 46 48 public class SessionWriter { … … 54 56 registerSessionLayerExporter(GpxLayer.class , GpxTracksSessionExporter.class); 55 57 registerSessionLayerExporter(GeoImageLayer.class , GeoImageSessionExporter.class); 58 registerSessionLayerExporter(MarkerLayer.class, MarkerSessionExporter.class); 56 59 } 57 60
Note:
See TracChangeset
for help on using the changeset viewer.