Changeset 12778 in osm for applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java
- Timestamp:
- 2009-01-01T18:28:53+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java
r9400 r12778 31 31 * Action that sets a marker into a marker layer. The first parameter of the action 32 32 * is used as the text of the marker, the second (if it exists) as an icon. 33 * 33 * 34 34 * @author cdaller 35 35 * … … 40 40 public static final String MARKER_LAYER_NAME = "surveyorwaypointlayer"; 41 41 private WaypointDialog dialog; 42 42 43 43 /** 44 44 * Default Constructor. 45 45 */ 46 46 public SetWaypointAction() { 47 47 48 48 } 49 49 … … 61 61 markerTitle = markerTitle + " " + tr("start"); 62 62 } else { 63 markerTitle = markerTitle + " " + tr("end"); 63 markerTitle = markerTitle + " " + tr("end"); 64 64 } 65 65 } 66 66 67 67 if(dialog == null) { 68 68 dialog = new WaypointDialog(); 69 69 } 70 70 71 71 String markerText = markerTitle; 72 72 String inputText = dialog.openDialog(SurveyorPlugin.getSurveyorFrame(), "Waypoint Description"); … … 75 75 markerText = markerText + " " + inputText; 76 76 } 77 77 78 78 String iconName = getParameters().size() > 1 ? getParameters().get(1) : null; 79 80 // add the waypoint to the marker layer AND to the gpx layer 79 80 // add the waypoint to the marker layer AND to the gpx layer 81 81 // (easy export of data + waypoints): 82 82 MarkerLayer layer = getMarkerLayer(); … … 87 87 synchronized(LiveGpsLock.class) { 88 88 //layer.data.add(new Marker(event.getCoordinates(), markerText, iconName)); 89 89 layer.data.add(new Marker(event.getCoordinates(), markerText, iconName, null, -1.0, 0.0)); 90 90 if(gpsLayer != null) { 91 91 gpsLayer.data.waypoints.add(waypoint); 92 92 } 93 93 } 94 94 95 95 Main.map.repaint(); 96 96 } 97 97 98 98 /** 99 99 * Returns the marker layer with the name {@link #MARKER_LAYER_NAME}. … … 103 103 if(markerLayer == null) { 104 104 markerLayer = LayerUtil.findGpsLayer(MARKER_LAYER_NAME, MarkerLayer.class); 105 105 106 106 if(markerLayer == null) { 107 107 // not found, add a new one 108 108 //markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null); 109 109 markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null, null); 110 110 Main.main.addLayer(markerLayer); 111 111 } … … 113 113 return markerLayer; 114 114 } 115 115 116 116 /** 117 117 * Returns the gpx layer that is filled by the live gps data. … … 126 126 break; 127 127 } 128 } 128 } 129 129 } 130 130 return liveGpsLayer;
Note:
See TracChangeset
for help on using the changeset viewer.