}
}
for (WayPoint p : data.waypoints) {
points.add(p.getCoor());
}
final WMSLayer layer = askWMSLayer();
if (layer != null) {
PleaseWaitRunnable task = new PleaseWaitRunnable(tr("Precaching WMS")) {
private PrecacheTask precacheTask;
@Override
protected void realRun() throws SAXException, IOException, OsmTransferException {
precacheTask = new PrecacheTask(progressMonitor);
layer.downloadAreaToCache(precacheTask, points, 0, 0);
while (!precacheTask.isFinished() && !progressMonitor.isCanceled()) {
synchronized (this) {
try {
wait(200);
} catch (InterruptedException ex) {