Changeset 14053 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileSource.java
- Timestamp:
- 2009-03-10T13:45:35+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileSource.java
r13035 r14053 5 5 public class OsmTileSource { 6 6 7 8 7 public static final String MAP_MAPNIK = "http://tile.openstreetmap.org"; 8 public static final String MAP_OSMA = "http://tah.openstreetmap.org/Tiles/tile"; 9 9 10 10 protected static abstract class AbstractOsmTileSource implements TileSource { 11 11 12 13 14 12 public int getMaxZoom() { 13 return 18; 14 } 15 15 16 16 public int getMinZoom() { 17 17 return 0; 18 18 } 19 19 20 21 22 20 public String getTileUrl(int zoom, int tilex, int tiley) { 21 return "/" + zoom + "/" + tilex + "/" + tiley + ".png"; 22 } 23 23 24 25 26 27 24 @Override 25 public String toString() { 26 return getName(); 27 } 28 28 29 public String getTileType() { 30 return "png"; 31 } 32 33 } 29 public String getTileType() { 30 return "png"; 31 } 34 32 35 public static class Mapnik extends AbstractOsmTileSource { 33 } 36 34 37 public static String NAME = "Mapnik"; 38 39 public String getName() { 40 return NAME; 41 } 35 public static class Mapnik extends AbstractOsmTileSource { 42 36 43 @Override 44 public String getTileUrl(int zoom, int tilex, int tiley) { 45 return MAP_MAPNIK + super.getTileUrl(zoom, tilex, tiley); 46 } 37 public static String NAME = "Mapnik"; 47 38 48 public TileUpdate getTileUpdate() {49 return TileUpdate.IfNoneMatch;50 39 public String getName() { 40 return NAME; 41 } 51 42 52 } 43 @Override 44 public String getTileUrl(int zoom, int tilex, int tiley) { 45 return MAP_MAPNIK + super.getTileUrl(zoom, tilex, tiley); 46 } 53 47 54 public static class CycleMap extends AbstractOsmTileSource { 55 56 private static final String PATTERN = "http://%s.andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png"; 48 public TileUpdate getTileUpdate() { 49 return TileUpdate.IfNoneMatch; 50 } 51 52 } 53 54 public static class CycleMap extends AbstractOsmTileSource { 55 56 private static final String PATTERN = "http://%s.andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png"; 57 57 public static String NAME = "OSM Cycle Map"; 58 58 … … 68 68 } 69 69 70 71 72 70 public String getName() { 71 return NAME; 72 } 73 73 74 75 76 74 public TileUpdate getTileUpdate() { 75 return TileUpdate.LastModified; 76 } 77 77 78 78 } 79 79 80 80 public static class TilesAtHome extends AbstractOsmTileSource { 81 81 82 82 public static String NAME = "TilesAtHome"; 83 83 84 85 86 84 public int getMaxZoom() { 85 return 17; 86 } 87 87 88 89 90 88 public String getName() { 89 return NAME; 90 } 91 91 92 93 94 95 92 @Override 93 public String getTileUrl(int zoom, int tilex, int tiley) { 94 return MAP_OSMA + super.getTileUrl(zoom, tilex, tiley); 95 } 96 96 97 98 99 100 97 public TileUpdate getTileUpdate() { 98 return TileUpdate.IfModifiedSince; 99 } 100 } 101 101 }
Note:
See TracChangeset
for help on using the changeset viewer.