Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions.downloadtasks;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.util.concurrent.Future;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.gui.progress.ProgressMonitor;
|
---|
9 | import org.openstreetmap.josm.tools.OsmUrlToBounds;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Specialized task for downloading OSM notes within bounds.
|
---|
13 | * <p>
|
---|
14 | * It handles one URL pattern: openstreetmap website URL with {@code #map?} argument.
|
---|
15 | * @since 8195
|
---|
16 | */
|
---|
17 | public class DownloadNotesUrlBoundsTask extends DownloadNotesTask {
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) {
|
---|
21 | return download(newLayer, OsmUrlToBounds.parse(url), null);
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public String[] getPatterns() {
|
---|
26 | return new String[]{
|
---|
27 | "https?://www\\.(osm|openstreetmap)\\.org/(.*)?#map=\\p{Digit}+/.*/.*&layers=[A-MO-Z]*N[A-MO-Z]*"};
|
---|
28 | }
|
---|
29 |
|
---|
30 | @Override
|
---|
31 | public String getTitle() {
|
---|
32 | return tr("Download OSM Notes within Bounds");
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.