Changeset 28559 in osm for applications/editors/josm/plugins/piclayer/src/org
- Timestamp:
- 2012-08-16T11:45:11+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
r27662 r28559 48 48 import org.openstreetmap.josm.data.coor.LatLon; 49 49 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 50 import org.openstreetmap.josm.data.projection.Projection; 50 51 import org.openstreetmap.josm.gui.MapView; 51 52 import org.openstreetmap.josm.gui.layer.Layer; 52 53 import org.openstreetmap.josm.plugins.piclayer.actions.LoadPictureCalibrationAction; 54 import org.openstreetmap.josm.plugins.piclayer.actions.LoadPictureCalibrationFromWorldAction; 53 55 import org.openstreetmap.josm.plugins.piclayer.actions.ResetCalibrationAction; 54 56 import org.openstreetmap.josm.plugins.piclayer.actions.SavePictureCalibrationAction; … … 121 123 private static final int pinHeight = 64; 122 124 125 protected final Projection projection; 126 123 127 /** 124 128 * Constructor … … 137 141 pinTiledImage = new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource("/images/v6_64.png"))).getImage(); 138 142 } 143 144 projection = Main.getProjection(); 139 145 } 140 146 … … 201 207 new SavePictureCalibrationAction(this), 202 208 new LoadPictureCalibrationAction(this), 209 new LoadPictureCalibrationFromWorldAction(this), 203 210 SeparatorLayerAction.INSTANCE, 204 211 new RenameLayerAction(null,this), … … 302 309 * so we get the result at the point 'en' and not some average. 303 310 */ 304 double naturalScale = Main.getProjection().getDefaultZoomInPPD();311 double naturalScale = projection.getDefaultZoomInPPD(); 305 312 naturalScale *= 0.01; // make a little smaller 306 313 307 LatLon ll1 = Main.getProjection().eastNorth2latlon(314 LatLon ll1 = projection.eastNorth2latlon( 308 315 new EastNorth(en.east() - naturalScale, en.north())); 309 LatLon ll2 = Main.getProjection().eastNorth2latlon(316 LatLon ll2 = projection.eastNorth2latlon( 310 317 new EastNorth(en.east() + naturalScale, en.north())); 311 318 … … 316 323 /* see getMetersPerEasting */ 317 324 private double getMetersPerNorthing(EastNorth en) { 318 double naturalScale = Main.getProjection().getDefaultZoomInPPD();325 double naturalScale = projection.getDefaultZoomInPPD(); 319 326 naturalScale *= 0.01; 320 327 321 LatLon ll1 = Main.getProjection().eastNorth2latlon(328 LatLon ll1 = projection.eastNorth2latlon( 322 329 new EastNorth(en.east(), en.north()- naturalScale)); 323 LatLon ll2 = Main.getProjection().eastNorth2latlon(330 LatLon ll2 = projection.eastNorth2latlon( 324 331 new EastNorth(en.east(), en.north() + naturalScale)); 325 332 … … 337 344 if ( image == null ) 338 345 return; 339 String projcode = Main.getProjection().toCode();346 String projcode = projection.toCode(); 340 347 341 348 // TODO: bounding box only supported when coordinates are in meters -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromKML.java
r27662 r28559 8 8 import javax.imageio.ImageIO; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.data.coor.EastNorth; 12 11 import org.openstreetmap.josm.data.coor.LatLon; … … 53 52 LatLon coord2 = new LatLon(cal.getSouth(), cal.getWest()); 54 53 55 EastNorth en1 = Main.getProjection().latlon2eastNorth(coord1);56 EastNorth en2 = Main.getProjection().latlon2eastNorth(coord2);54 EastNorth en1 = projection.latlon2eastNorth(coord1); 55 EastNorth en2 = projection.latlon2eastNorth(coord2); 57 56 58 57
Note:
See TracChangeset
for help on using the changeset viewer.