Last change
on this file since 11063 was 7937, checked in by bastiK, 9 years ago |
add subversion property svn:eol=native
|
-
Property svn:eol-style
set to
native
|
File size:
978 bytes
|
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 | * Task allowing to download an OSM url containing coordinates
|
---|
13 | * @since 4996
|
---|
14 | */
|
---|
15 | public class DownloadOsmUrlTask extends DownloadOsmTask {
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) {
|
---|
19 | return download(newLayer, OsmUrlToBounds.parse(url), null);
|
---|
20 | }
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | public String[] getPatterns() {
|
---|
24 | return new String[]{
|
---|
25 | "https?://www\\.(osm|openstreetmap)\\.org/\\?lat=.*&lon=.*",
|
---|
26 | "https?://www\\.(osm|openstreetmap)\\.org/(.*)?#map=\\p{Digit}+/.*/.*"};
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public String getTitle() {
|
---|
31 | return tr("Download OSM URL");
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.