- Timestamp:
- 2010-05-17T18:13:34+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r2990 r3261 468 468 g.fillRect(p.x - d.width / 2, p.y - d.height / 2, d.width, d.height); 469 469 } else { 470 if (e.getExifImgDir() != null) { 471 double arrowlength = 25; 472 double arrowwidth = 18; 473 474 double dir = e.getExifImgDir(); 475 // Rotate 90° CCW 476 double headdir = ( dir < 90 ) ? dir + 270 : dir - 90; 477 double leftdir = ( headdir < 90 ) ? headdir + 270 : headdir - 90; 478 double rightdir = ( headdir > 270 ) ? headdir - 270 : headdir + 90; 479 480 double ptx = p.x + Math.cos(Math.toRadians(headdir)) * arrowlength; 481 double pty = p.y + Math.sin(Math.toRadians(headdir)) * arrowlength; 482 483 double ltx = p.x + Math.cos(Math.toRadians(leftdir)) * arrowwidth/2; 484 double lty = p.y + Math.sin(Math.toRadians(leftdir)) * arrowwidth/2; 485 486 double rtx = p.x + Math.cos(Math.toRadians(rightdir)) * arrowwidth/2; 487 double rty = p.y + Math.sin(Math.toRadians(rightdir)) * arrowwidth/2; 488 489 g.setColor(Color.white); 490 int[] xar = {(int) ltx, (int) ptx, (int) rtx, (int) ltx}; 491 int[] yar = {(int) lty, (int) pty, (int) rty, (int) lty}; 492 g.fillPolygon(xar, yar, 4); 493 } 494 470 495 selectedIcon.paintIcon(mv, g, 471 496 p.x - selectedIcon.getIconWidth() / 2, 472 497 p.y - selectedIcon.getIconHeight() / 2); 498 473 499 } 474 500 } … … 528 554 } 529 555 556 557 // compass direction value 558 559 Rational direction = null; 560 561 try { 562 direction = dir.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION); 563 } catch (CompoundException p) { 564 direction = null; 565 } 566 530 567 // Store values 531 568 532 569 e.setExifCoor(new LatLon(lat, lon)); 533 570 e.setPos(e.getExifCoor()); 571 if (direction != null) { 572 e.setExifImgDir(direction.doubleValue()); 573 } 534 574 535 575 } catch (CompoundException p) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r2931 r3261 20 20 private File file; 21 21 private LatLon exifCoor; 22 private Double exifImgDir; 22 23 private Date exifTime; 23 24 Image thumbnail; … … 78 79 return exifCoor; 79 80 } 81 public Double getExifImgDir() { 82 return exifImgDir; 83 } 84 80 85 /** 81 86 * setter methods … … 105 110 this.exifCoor = exifCoor; 106 111 } 112 void setExifImgDir(double exifDir) { 113 this.exifImgDir = exifDir; 114 } 107 115 108 116 @Override -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r3252 r3261 239 239 osd.append(tr("\n{0} km/h", Math.round(entry.getSpeed()))); 240 240 } 241 if (entry.getExifImgDir() != null) { 242 osd.append(tr("\nDirection {0}°", Math.round(entry.getExifImgDir()))); 243 } 241 244 //if (entry.getPos() != null) { 242 245 // osd.append(tr("\nlat: {0}, lon: {1}", Double.toString(entry.getPos().lat()), Double.toString(entry.getPos().lon())));
Note:
See TracChangeset
for help on using the changeset viewer.