Modify

Opened 7 days ago

Closed 6 days ago

#18123 closed enhancement (fixed)

[PATCH] Add Yandex as a imagery source in osm-obj-info

Reported by: taylor.smock Owned by: Rub21
Priority: normal Milestone:
Component: Plugin osm-obj-info Version:
Keywords: yandex Cc:

Description

Yandex has given permission for OSM use ( see https://wiki.openstreetmap.org/wiki/Contributors#Yandex.Panoramas ).

I've got a pull request here: https://github.com/JOSM/osm-obj-info/pull/9, and I've attached the patch from git format-patch -1 HEAD.

This is related to https://github.com/JOSM/osm-obj-info/issues/8 .

For the plugins that are on GitHub, should I file bugs and patches github or on trac?

The patch refactors the calls to open a browser to another function (which de-duplicates a significant portion of the code), and looking at it again, it can probably be modified further so that many of the functions no longer exist. For example:

lbLinkYandex.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
        OSMObjInfoActions.openImageInBrowser("https://yandex.com/maps/?l=stv,sta&ll={longitude},{latitude}&z=18", lbMapillary.getText());
    }
});

with OSMObjInfoActions.openImageInBrowser being

public static void openImageInBrowser(String imageUrl, String coords) {
    if (coords == null || coords.isEmpty()) return;
    String[] arrCoords = coords.split(",");
    openInBrowser(imageUrl.replace("{latitude}", arrCoords[0]).replace("{longitude}", arrCoords[1]));
}

instead of

lbLinkYandex.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
        OSMObjInfoActions.openInBrowserYandex(lbMapillary.getText());
    }
});

Attachments (1)

0001-Add-Yandex-as-a-possible-imagery-source.patch (13.3 KB) - added by taylor.smock 7 days ago.
Add Yandex as imagery source, refactor some code for deduplication

Download all attachments as: .zip

Change History (2)

Changed 7 days ago by taylor.smock

Add Yandex as imagery source, refactor some code for deduplication

comment:1 Changed 6 days ago by Don-vip

Resolution: fixed
Status: newclosed

Done: https://github.com/JOSM/osm-obj-info/releases/tag/v1.3

For GitHub plugins, it's easier for everyone to work exclusively there (unless you need a core change, or we don't see the merge request)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rub21.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.