Last change
on this file since 6244 was 6244, checked in by Don-vip, 11 years ago |
fix #9091 - rework osm/gpx download tasks - take into account recent changes from OSM server:
- new hashtag scheme
- GPX traces now returned as Bzip2-compressed files
|
File size:
1006 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions.downloadtasks;
|
---|
3 |
|
---|
4 | import java.util.concurrent.Future;
|
---|
5 |
|
---|
6 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
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 | "http://www\\.(osm|openstreetmap)\\.org/\\?lat=.*&lon=.*",
|
---|
26 | "http://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.