Ticket #24739: 24739.patch
| File 24739.patch, 2.4 KB (added by , 8 weeks ago) |
|---|
-
src/org/openstreetmap/josm/data/gpx/GpxData.java
719 719 * To get bounds as read from metadata, see {@link #getMetaBounds()}.<br> 720 720 * To get downloaded areas, see {@link #dataSources}.<br> 721 721 * 722 * @return the bounds 723 * @see #getMetaBounds() 724 * @see #dataSources 725 */ 726 public synchronized Bounds recalculateBounds() { 727 return recalculateBounds(false); 728 } 729 730 /** 731 * Calculates the bounding box of available data and returns it. 732 * The bounds are not stored internally, but recalculated every time 733 * this function is called.<br> 734 * To get bounds as read from metadata, see {@link #getMetaBounds()}.<br> 735 * To get downloaded areas, see {@link #dataSources}.<br> 736 * 722 737 * FIXME might perhaps use visitor pattern? 738 * @param ignoreWaypoints if true, data from privateWaypoints is ignored 723 739 * @return the bounds 724 740 * @see #getMetaBounds() 725 741 * @see #dataSources 742 * @since xxx 726 743 */ 727 public synchronized Bounds recalculateBounds( ) {744 public synchronized Bounds recalculateBounds(boolean ignoreWaypoints) { 728 745 Bounds bounds = null; 729 for (WayPoint wpt : privateWaypoints) { 730 if (bounds == null) { 731 bounds = new Bounds(wpt.getCoor()); 732 } else { 733 bounds.extend(wpt.getCoor()); 746 if (!ignoreWaypoints) { 747 for (WayPoint wpt : privateWaypoints) { 748 if (bounds == null) { 749 bounds = new Bounds(wpt.getCoor()); 750 } else { 751 bounds.extend(wpt.getCoor()); 752 } 734 753 } 735 754 } 736 755 for (GpxRoute rte : privateRoutes) { -
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
395 395 @Override 396 396 public void visitBoundingBox(BoundingXYVisitor v) { 397 397 if (data != null) { 398 v.visit(data.recalculateBounds( ));398 v.visit(data.recalculateBounds(true)); 399 399 } 400 400 } 401 401
