Changeset 24351 in osm for applications/editors/josm/plugins/slippymap/src
- Timestamp:
- 2010-11-23T19:42:07+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
r23190 r24351 296 296 } 297 297 298 public static class BingMaps extends OsmTileSource.AbstractOsmTileSource { 299 public BingMaps() { 300 super("Bing Aerial Maps", "http://ecn.t2.tiles.virtualearth.net/tiles/"); 301 } 302 303 @Override 304 public int getMaxZoom() { 305 return 22; 306 } 307 308 @Override 309 public String getTileUrl(int zoom, int tilex, int tiley) { 310 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"; 312 } 313 314 public TileUpdate getTileUpdate() { 315 return TileUpdate.IfNoneMatch; 316 } 317 } 318 319 private static String computeQuadTree(int zoom, int tilex, int tiley) { 320 String k = ""; 321 for(int i = zoom; i > 0; i--) { 322 int digit = 0; 323 int mask = 1 << (i - 1); 324 if ((tilex & mask) != 0) { 325 digit += 1; 326 } 327 if ((tiley & mask) != 0) { 328 digit += 2; 329 } 330 k += String.valueOf(digit); 331 } 332 return k; 333 } 334 335 public static void main(String[] args) { 336 System.out.println("Expected: 021333011020221201"); 337 System.out.println("Actual: " + computeQuadTree(18, 62985, 94388)); 338 } 298 339 299 340 public static class HaitiImagery extends OsmTileSource.AbstractOsmTileSource { … … 404 445 sources.add(new FreeMapySk()); 405 446 sources.add(new NearMap()); 447 sources.add(new BingMaps()); 406 448 sources.add(new HaitiImagery()); 407 449 sources.addAll(getCustomSources());
Note:
See TracChangeset
for help on using the changeset viewer.