Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r9081 r9095 59 59 private static final String PATTERN_HEADER = "\\{header\\(([^,]+),([^}]+)\\)\\}"; 60 60 61 private static final String URL_GET_ENCODING_PARAMS = "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER={layer}&STYLE={ Style}&"61 private static final String URL_GET_ENCODING_PARAMS = "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER={layer}&STYLE={style}&" 62 62 + "FORMAT={format}&tileMatrixSet={TileMatrixSet}&tileMatrix={TileMatrix}&tileRow={TileRow}&tileCol={TileCol}"; 63 63 … … 648 648 } 649 649 650 switch (transferMode) { 651 case KVP: 652 url = baseUrl + URL_GET_ENCODING_PARAMS; 653 break; 654 case REST: 650 if (currentLayer.baseUrl != null && transferMode == null) { 655 651 url = currentLayer.baseUrl; 656 break; 657 default: 658 url = ""; 659 break; 652 } else { 653 switch (transferMode) { 654 case KVP: 655 url = baseUrl + URL_GET_ENCODING_PARAMS; 656 break; 657 case REST: 658 url = currentLayer.baseUrl; 659 break; 660 default: 661 url = ""; 662 break; 663 } 660 664 } 661 665 … … 672 676 .replaceAll("\\{TileRow\\}", Integer.toString(tiley)) 673 677 .replaceAll("\\{TileCol\\}", Integer.toString(tilex)) 674 .replaceAll(" \\{Style\\}", this.currentLayer.style);678 .replaceAll("(?i)\\{style\\}", this.currentLayer.style); 675 679 } 676 680 -
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
r9081 r9095 30 30 private ImageryInfo testImageryWALLONIE = getImagery("test/data/wmts/WMTSCapabilities-Wallonie.xml"); 31 31 private ImageryInfo testImageryOntario = getImagery("test/data/wmts/WMTSCapabilities-Ontario.xml"); 32 private ImageryInfo testImagery12168 = getImagery("test/data/wmts/bug12168-WMTSCapabilities.xml"); 32 33 private ImageryInfo testLotsOfLayers = getImagery("test/data/wmts/getCapabilities-lots-of-layers.xml"); 33 34 … … 210 211 } 211 212 213 @Test 214 public void test12168() throws IOException { 215 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); 216 WMTSTileSource testSource = new WMTSTileSource(testImagery12168); 217 testSource.initProjection(Main.getProjection()); 218 assertEquals( 219 "http://www.ngi.be/cartoweb/1.0.0/topo/default/3857/7/1/1.png", 220 testSource.getTileUrl(1, 1, 1)); 221 } 222 223 212 224 // XXX: disabled as this needs user action 213 225 //@Test
Note:
See TracChangeset
for help on using the changeset viewer.