Changeset 24354 in osm
- Timestamp:
- 2010-11-23T21:55:55+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java
r24351 r24354 276 276 } 277 277 278 public static class NearMap extends OsmTileSource.AbstractOsmTileSource { 279 public NearMap() { 280 super("NearMap Australia", "http://www.nearmap.com/maps/hl=en&nml=Vert&"); 281 } 282 283 @Override 284 public int getMaxZoom() { 285 return 21; 286 } 287 288 @Override 289 public String getTilePath(int zoom, int tilex, int tiley) { 290 return "z=" + zoom + "&x=" + tilex + "&y=" + tiley; 291 } 292 293 public TileUpdate getTileUpdate() { 294 return TileUpdate.IfNoneMatch; 295 } 296 } 297 298 public static class BingMaps extends OsmTileSource.AbstractOsmTileSource { 299 public BingMaps() { 278 public static class BingAerial extends OsmTileSource.AbstractOsmTileSource { 279 public BingAerial() { 300 280 super("Bing Aerial Maps", "http://ecn.t2.tiles.virtualearth.net/tiles/"); 301 281 } … … 307 287 308 288 @Override 309 public String getTileUrl(int zoom, int tilex, int tiley) { 289 public String getExtension() { 290 return("jpeg"); 291 } 292 293 @Override 294 public String getTilePath(int zoom, int tilex, int tiley) { 310 295 String quadtree = computeQuadTree(zoom, tilex, tiley); 311 return " http://ecn.t2.tiles.virtualearth.net/tiles/a" + quadtree + ".jpeg?g=587&mkt=en-us&n=z";296 return "/tiles/a" + quadtree + "." + getExtension() + "?g=587"; 312 297 } 313 298 … … 318 303 319 304 private static String computeQuadTree(int zoom, int tilex, int tiley) { 320 String k = "";305 StringBuilder k = new StringBuilder(); 321 306 for(int i = zoom; i > 0; i--) { 322 int digit = 0;307 char digit = 48; 323 308 int mask = 1 << (i - 1); 324 309 if ((tilex & mask) != 0) { … … 328 313 digit += 2; 329 314 } 330 k += String.valueOf(digit);331 } 332 return k ;315 k.append(digit); 316 } 317 return k.toString(); 333 318 } 334 319 335 public static void main(String[] args) {336 System.out.println("Expected: 021333011020221201");337 System.out.println("Actual: " + computeQuadTree(18, 62985, 94388));338 }339 340 320 public static class HaitiImagery extends OsmTileSource.AbstractOsmTileSource { 341 321 public HaitiImagery() { … … 441 421 sources.add(new OsmTileSource.CycleMap()); 442 422 sources.add(new OsmTileSource.TilesAtHome()); 423 sources.add(new BingAerial()); 443 424 sources.add(new Coastline()); 444 425 sources.add(new FreeMapySkPokus()); 445 426 sources.add(new FreeMapySk()); 446 427 sources.add(new NearMap()); 447 sources.add(new BingMaps());448 428 sources.add(new HaitiImagery()); 449 429 sources.addAll(getCustomSources());
Note:
See TracChangeset
for help on using the changeset viewer.