Ignore:
Timestamp:
2016-11-27T10:42:36+01:00 (7 years ago)
Author:
simon04
Message:

see #13201 - OsmUrlToBounds: also take Geo URLs into account

This adds Geo URL support to various actions, such as:

  • Download dialog
  • Jump to Position
  • Commandline parameters (OSM or GPS download)
Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/GeoUrlToBounds.java

    r10757 r11329  
    1212/**
    1313 * Parses a Geo URL (as specified in <a href="https://tools.ietf.org/html/rfc5870">RFC 5870</a>) into {@link Bounds}.
     14 *
     15 * Note that Geo URLs are also handled by {@link OsmUrlToBounds}.
    1416 */
    1517public final class GeoUrlToBounds {
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r11302 r11329  
    1717import org.openstreetmap.josm.gui.util.GuiHelper;
    1818
     19/**
     20 * Parses various URL used in OpenStreetMap projects into {@link Bounds}.
     21 */
    1922public final class OsmUrlToBounds {
    2023    private static final String SHORTLINK_PREFIX = "http://osm.org/go/";
     
    2427    }
    2528
     29    /**
     30     * Parses an URL into {@link Bounds}
     31     * @param url the URL to be parsed
     32     * @return the parsed {@link Bounds}, or {@code null}
     33     */
    2634    public static Bounds parse(String url) {
     35        if (url.startsWith("geo:")) {
     36            return GeoUrlToBounds.parse(url);
     37        }
    2738        try {
    2839            // a percent sign indicates an encoded URL (RFC 1738).
Note: See TracChangeset for help on using the changeset viewer.