public final class StreetsideDownloader extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StreetsideDownloader.DOWNLOAD_MODE
Possible download modes.
|
Modifier and Type | Field and Description |
---|---|
private static ThreadPoolExecutor |
executor
Executor that will run the petitions.
|
private static double |
MAX_AREA
Max area to be downloaded
|
private static boolean |
stoppedDownload
Indicates whether the last download request has been rejected because it requested an area that was too big.
|
Modifier | Constructor and Description |
---|---|
private |
StreetsideDownloader() |
Modifier and Type | Method and Description |
---|---|
static void |
downloadOSMArea()
Downloads all images of the area covered by the OSM data.
|
static void |
downloadVisibleArea()
If some part of the current view has not been downloaded, it is downloaded.
|
static void |
getImages(Bounds bounds)
Gets the images within the given bounds.
|
static void |
getImages(LatLon minLatLon,
LatLon maxLatLon)
Gets all the images in a square.
|
static StreetsideDownloader.DOWNLOAD_MODE |
getMode()
Returns the current download mode.
|
private static boolean |
isAreaTooBig(double area)
Checks if the area for which Streetside images should be downloaded is too big.
|
private static boolean |
isInBounds(LatLon latlon)
Checks if the given
LatLon object lies inside the bounds of the
image. |
private static boolean |
isViewDownloaded(Bounds view) |
private static void |
run(Runnable t) |
static void |
stopAll()
Stops all running threads.
|
private static final double MAX_AREA
private static ThreadPoolExecutor executor
private static boolean stoppedDownload
private StreetsideDownloader()
public static void getImages(LatLon minLatLon, LatLon maxLatLon)
minLatLon
- The minimum latitude and longitude of the rectangle.maxLatLon
- The maximum latitude and longitude of the rectanglepublic static void getImages(Bounds bounds)
bounds
- A Bounds
object containing the area to be downloaded.public static StreetsideDownloader.DOWNLOAD_MODE getMode()
StreetsideDownloader.DOWNLOAD_MODE
public static void downloadVisibleArea()
private static boolean isViewDownloaded(Bounds view)
private static boolean isInBounds(LatLon latlon)
LatLon
object lies inside the bounds of the
image.latlon
- The coordinates to check.public static void downloadOSMArea()
private static boolean isAreaTooBig(double area)
area
- area to checktrue
if the area is too bigpublic static void stopAll()