Changeset 12090 in josm for trunk/src


Ignore:
Timestamp:
2017-05-08T22:03:16+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14756 - Download dialog should also parse URLs which dont contain "#map="

File:
1 edited

Legend:

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

    r11847 r12090  
    4747        if (b != null)
    4848            return b;
    49         if (url.contains("#map")) {
     49        if (url.contains("#map") || url.contains("/#")) {
    5050            // probably it's a URL following the new scheme?
    5151            return parseHashURLs(url);
     
    9595     */
    9696    private static Bounds parseHashURLs(String url) {
    97         int startIndex = url.indexOf("#map=");
     97        int startIndex = url.indexOf('#');
    9898        if (startIndex == -1) return null;
    9999        int endIndex = url.indexOf('&', startIndex);
    100100        if (endIndex == -1) endIndex = url.length();
    101         String coordPart = url.substring(startIndex+5, endIndex);
     101        String coordPart = url.substring(startIndex+(url.contains("#map=") ? "#map=".length() : "#".length()), endIndex);
    102102        String[] parts = coordPart.split("/");
    103103        if (parts.length < 3) {
Note: See TracChangeset for help on using the changeset viewer.