Changeset 35329 in osm for applications/viewer/jmapviewer


Ignore:
Timestamp:
2020-02-17T15:07:01+01:00 (5 years ago)
Author:
donvip
Message:

see #josm18440 / #josm18726 - switch to {apikey}

Location:
applications/viewer/jmapviewer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java

    r35056 r35329  
    5151    public static final String API_KEY_SETTING = "jmapviewer.bing.api-key";
    5252    /** Placeholder to specify Bing API key in metadata API URL*/
    53     public static final String API_KEY_PLACEHOLDER = "{apiKey}";
     53    public static final String API_KEY_PLACEHOLDER = "{apikey}";
    5454
    5555    /** Bing Metadata API URL */
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java

    r35322 r35329  
    2828 * {!y} - substituted with Yahoo Y tile number
    2929 * {-y} - substituted with reversed Y tile number
    30  * {apiKey} - substituted with API key retrieved for the imagery id
     30 * {apikey} - substituted with API key retrieved for the imagery id
    3131 * {switch:VAL_A,VAL_B,VAL_C,...} - substituted with one of VAL_A, VAL_B, VAL_C. Usually
    3232 *                                  used to specify many tile servers
     
    5050    private static final Pattern PATTERN_SWITCH  = Pattern.compile("\\{switch:([^}]+)\\}");
    5151    private static final Pattern PATTERN_HEADER  = Pattern.compile("\\{header\\(([^,]+),([^}]+)\\)\\}");
    52     private static final Pattern PATTERN_API_KEY = Pattern.compile("\\{apiKey\\}");
     52    private static final Pattern PATTERN_API_KEY = Pattern.compile("\\{apikey\\}");
    5353    private static final Pattern PATTERN_PARAM  = Pattern.compile("\\{((?:\\d+-)?z(?:oom)?(:?[+-]\\d+)?|x|y|!y|-y|switch:([^}]+))\\}");
    5454
  • applications/viewer/jmapviewer/test/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSourceTest.java

    r35320 r35329  
    111111    public void testGetTileUrl_apiKey() {
    112112        System.setProperty("id1.api-key", "wololo");
    113         TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", "http://localhost/{zoom}/{x}/{y}?token={apiKey}&foo=bar", "id1");
     113        TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", "http://localhost/{zoom}/{x}/{y}?token={apikey}&foo=bar", "id1");
    114114        TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS);
    115115        assertEquals("http://localhost/1/2/3?token=wololo&foo=bar", ts.getTileUrl(1, 2, 3));
Note: See TracChangeset for help on using the changeset viewer.