Changeset 19887 in osm for applications/editors/josm/plugins/slippymap/src
- Timestamp:
- 2010-02-06T13:17:41+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java
r19521 r19887 299 299 300 300 public static class Custom extends OsmTileSource.AbstractOsmTileSource { 301 302 String extension; 303 String path; 304 301 305 public Custom(String name, String url) { 302 306 super(name, url); … … 306 310 this.extension = extension; 307 311 } 308 String extension; 312 public Custom(String name, String url, String extension, String path) { 313 super(name, url); 314 this.extension = extension; 315 this.path = path; 316 } 317 309 318 @Override 310 319 public String getExtension() { … … 313 322 return extension; 314 323 } 324 325 @Override 326 public int getMaxZoom() { 327 return 21; 328 } 329 330 @Override 331 public String getTilePath(int zoom, int tilex, int tiley) { 332 if (path == null) 333 return super.getTilePath(zoom,tilex,tiley); 334 String tilepath = path; 335 tilepath=tilepath.replaceAll("%z",String.valueOf(zoom)); 336 tilepath=tilepath.replaceAll("%x",String.valueOf(tilex)); 337 tilepath=tilepath.replaceAll("%y",String.valueOf(tiley)); 338 return tilepath; 339 } 340 315 341 public TileUpdate getTileUpdate() { 316 342 return TileUpdate.IfNoneMatch; … … 327 353 // slippymap.custom_tile_source_1.url=http://a.ooc.openstreetmap.org/npe 328 354 // slippymap.custom_tile_source_1.ext=png 355 // slippymap.custom_tile_source_1.path=/%z/%x/%y 329 356 330 357 if (!(short_key.endsWith("name"))) … … 332 359 String url_key = short_key.replaceFirst("name","url"); 333 360 String ext_key = short_key.replaceFirst("name","ext"); 361 String path_key = short_key.replaceFirst("name","path"); 334 362 String name = customSources.get(key); 335 363 String url = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + url_key); 336 364 String ext = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + ext_key); 337 // ext may be null, but that's OK 338 System.out.println("found new tile source: '" +name+"' url:'"+url+"'"+"' ext:'"+ext+"'"); 339 ret.add(new Custom(name, url, ext)); 365 String path = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + path_key); 366 // ext and path may be null, but that's OK 367 System.out.println("found new tile source: '" +name+"' url:'"+url+"'"+"' ext:'"+ext+"' path:'"+path+"'"); 368 ret.add(new Custom(name, url, ext, path)); 340 369 } 341 370 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.