Ignore:
Timestamp:
2022-03-23T00:11:16+01:00 (2 years ago)
Author:
taylor.smock
Message:

DirectDownload: fix #21935 and #21952

#21935: "Error fetching URL" when trying to download a GPS track

This was caused due to a change in where OSM stores GPX data files.
OSM now uses s3 buckets, and redirects using a signed URL. S3 does
not like multiple authentication methods.

#21952: Only the first tag in the Tags column in "Download Track" window is shown

This was caused due to only keeping the last encountered tag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DirectDownload.java

    r35221 r35944  
    55
    66import java.awt.event.ActionEvent;
     7import java.awt.event.KeyEvent;
    78import java.util.ArrayList;
    89import java.util.HashMap;
     10import java.util.List;
    911
    1012import org.openstreetmap.josm.actions.JosmAction;
     
    2022import org.openstreetmap.josm.plugins.PluginInformation;
    2123import org.openstreetmap.josm.spi.preferences.Config;
     24import org.openstreetmap.josm.tools.Shortcut;
    2225
    2326public class DirectDownload extends Plugin {
    24 
    25     private DownloadAction openaction;
    26 
    2727    /**
    2828     * Will be invoked by JOSM to bootstrap the plugin
     
    3333        super(info);
    3434
    35         openaction = new DownloadAction();
    36         MainMenu.add(MainApplication.getMenu().gpsMenu, openaction);
     35        MainMenu.add(MainApplication.getMenu().gpsMenu, new DownloadAction());
    3736    }
    3837
    3938    static class DownloadAction extends JosmAction {
    4039        DownloadAction() {
    41             super(tr("Download Track ..."), "DownloadAction",
    42                     tr("Download GPX track from openstreetmap.org"), null, false);
     40            super(tr("Download Track ..."), "DownloadAction", tr("Download GPX track from openstreetmap.org"),
     41                    Shortcut.registerShortcut("directdownload:downloadgpxaction", tr("DirectDownload: Download GPX Track"),
     42                            KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false);
    4343        }
    4444
     
    4848            go.setVisible(true);
    4949
    50             ArrayList<UserTrack> tracks = go.getSelectedUserTracks();
     50            List<UserTrack> tracks = go.getSelectedUserTracks();
    5151
    5252            if (!((go.getValue() == 1) && (tracks != null))) {
     
    8484                if (Config.getPref().getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
    8585                    MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", track.filename), null, gpxLayer);
    86                     if (ml.data.size() > 0) {
     86                    if (!ml.data.isEmpty()) {
    8787                        MainApplication.getLayerManager().addLayer(ml);
    8888                    }
Note: See TracChangeset for help on using the changeset viewer.