Changeset 10635 in josm


Ignore:
Timestamp:
2016-07-25T14:58:28+02:00 (8 years ago)
Author:
simon04
Message:

fix #13201: Support Geo URLs with negative values

Location:
trunk
Files:
2 edited

Legend:

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

    r10630 r10635  
    1515public final class GeoUrlToBounds {
    1616
    17     public static final Pattern PATTERN = Pattern.compile("geo:(?<lat>[0-9.]+),(?<lon>[0-9.]+)(\\?z=(?<zoom>[0-9]+))?");
     17    public static final Pattern PATTERN = Pattern.compile("geo:(?<lat>[+-]?[0-9.]+),(?<lon>[+-]?[0-9.]+)(\\?z=(?<zoom>[0-9]+))?");
    1818
    1919    private GeoUrlToBounds() {
  • trunk/test/unit/org/openstreetmap/josm/tools/GeoUrlToBoundsTest.java

    r10630 r10635  
    3333                is(OsmUrlToBounds.positionToBounds(12.34, 56.78, 18))
    3434        );
     35        assertThat(
     36                GeoUrlToBounds.parse("geo:-37.786971,-122.399677"),
     37                is(OsmUrlToBounds.positionToBounds(-37.786971, -122.399677, 18))
     38        );
    3539    }
    3640
Note: See TracChangeset for help on using the changeset viewer.