Changeset 31836 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2015-12-16T17:16:48+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java
r31799 r31836 384 384 * Whether the added images must be selected or not. 385 385 */ 386 public static void showPictures(final List<MapillaryAbstractImage> images, 387 final boolean select) { 386 public static void showPictures(final List<MapillaryAbstractImage> images, final boolean select) { 388 387 if (!SwingUtilities.isEventDispatchThread()) { 389 388 SwingUtilities.invokeLater(new Runnable() { … … 394 393 }); 395 394 } else { 396 double minLat = 90; 397 double minLon = 180; 398 double maxLat = -90; 399 double maxLon = -180; 400 for (MapillaryAbstractImage img : images) { 401 if (img.getLatLon().lat() < minLat) 402 minLat = img.getLatLon().lat(); 403 if (img.getLatLon().lon() < minLon) 404 minLon = img.getLatLon().lon(); 405 if (img.getLatLon().lat() > maxLat) 406 maxLat = img.getLatLon().lat(); 407 if (img.getLatLon().lon() > maxLon) 408 maxLon = img.getLatLon().lon(); 395 Bounds zoomBounds; 396 if (images.isEmpty()) { 397 zoomBounds = new Bounds(new LatLon(0, 0)); 398 } else { 399 zoomBounds = new Bounds(images.get(0).getLatLon()); 400 for (MapillaryAbstractImage img : images) { 401 zoomBounds.extend(img.getLatLon()); 402 } 409 403 } 410 Bounds zoomBounds = new Bounds(new LatLon(minLat, minLon),411 new LatLon(maxLat, maxLon));412 404 // The zoom rectangle must have a minimum size. 413 double latExtent = zoomBounds.getMaxLat() 414 - zoomBounds.getMinLat() >= MIN_ZOOM_SQUARE_SIDE 415 ? zoomBounds.getMaxLat() - zoomBounds.getMinLat() 416 : MIN_ZOOM_SQUARE_SIDE; 417 double lonExtent = zoomBounds.getMaxLon() 418 - zoomBounds.getMinLon() >= MIN_ZOOM_SQUARE_SIDE 419 ? zoomBounds.getMaxLon() - zoomBounds.getMinLon() 420 : MIN_ZOOM_SQUARE_SIDE; 405 double latExtent = Math.max(zoomBounds.getMaxLat() - zoomBounds.getMinLat(), MIN_ZOOM_SQUARE_SIDE); 406 double lonExtent = Math.max(zoomBounds.getMaxLon() - zoomBounds.getMinLon(), MIN_ZOOM_SQUARE_SIDE); 421 407 zoomBounds = new Bounds(zoomBounds.getCenter(), latExtent, lonExtent); 422 408
Note:
See TracChangeset
for help on using the changeset viewer.