Changeset 30854 in osm for applications/viewer/jmapviewer/src/org
- Timestamp:
- 2014-12-18T22:56:22+01:00 (10 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java
r30850 r30854 45 45 private static final Logger log = FeatureAdapter.getLogger(OsmFileCacheTileLoader.class.getName()); 46 46 47 pr ivate static final String TAGS_FILE_EXT = ".tags";47 protected static final String TAGS_FILE_EXT = "tags"; 48 48 49 49 private static final Charset TAGS_CHARSET = Charset.forName("UTF-8"); … … 392 392 393 393 protected File getTagsFile() { 394 return new File(tileCacheDir + "/" + tile.getZoom() + "_" + tile.getXtile() + "_" + tile.getYtile() 394 return new File(tileCacheDir + "/" + tile.getZoom() + "_" + tile.getXtile() + "_" + tile.getYtile() + "." 395 395 + TAGS_FILE_EXT); 396 396 } 397 397 398 398 protected void saveTileToFile(byte[] rawData) { 399 File file = getTileFile(); 400 file.getParentFile().mkdirs(); 399 401 try ( 400 FileOutputStream f = new FileOutputStream(tileCacheDir + "/" + tile.getZoom() + "_" + tile.getXtile() 401 + "_" + tile.getYtile() + "." + tile.getSource().getTileType()) 402 FileOutputStream f = new FileOutputStream(file) 402 403 ) { 403 404 f.write(rawData); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java
r30248 r30854 63 63 64 64 /** 65 * A tile layer name has to be unique and has to consist only of characters 66 * valid for filenames. 65 * A tile layer name as displayed to the user. 67 66 * 68 67 * @return Name of the tile layer 69 68 */ 70 69 String getName(); 70 71 /** 72 * A unique id for this tile source. 73 * 74 * Unlike the name it has to be unique and has to consist only of characters 75 * valid for filenames. 76 * 77 * @return the id 78 */ 79 String getId(); 71 80 72 81 /** -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractMapQuestTileSource.java
r30223 r30854 31 31 private int SERVER_NUM = 1; 32 32 33 public AbstractMapQuestTileSource(String name, String base_url ) {34 super(name, base_url );33 public AbstractMapQuestTileSource(String name, String base_url, String id) { 34 super(name, base_url, id); 35 35 } 36 36 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java
r30336 r30854 20 20 * @param name Source name as displayed in GUI 21 21 * @param base_url Source URL 22 * @param id unique id for the tile source; contains only characters that 23 * are safe for file names; can be null 22 24 */ 23 public AbstractOsmTileSource(String name, String base_url ) {24 super(name, base_url );25 public AbstractOsmTileSource(String name, String base_url, String id) { 26 super(name, base_url, id); 25 27 } 26 28 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
r30248 r30854 10 10 protected String name; 11 11 protected String baseUrl; 12 protected String id; 12 13 13 public AbstractTMSTileSource(String name, String base_url ) {14 public AbstractTMSTileSource(String name, String base_url, String id) { 14 15 this.name = name; 15 16 this.baseUrl = base_url; … … 17 18 baseUrl = baseUrl.substring(0,baseUrl.length()-1); 18 19 } 20 this.id = id; 19 21 } 20 22 … … 22 24 public String getName() { 23 25 return name; 26 } 27 28 @Override 29 public String getId() { 30 return id; 24 31 } 25 32 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
r30758 r30854 52 52 * Constructs a new {@code BingAerialTileSource}. 53 53 */ 54 public BingAerialTileSource( ) {55 super("Bing Aerial Maps", "http://example.com/" );54 public BingAerialTileSource(String id) { 55 super("Bing Aerial Maps", "http://example.com/", id); 56 56 } 57 57 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/MapQuestOpenAerialTileSource.java
r30223 r30854 9 9 10 10 public MapQuestOpenAerialTileSource() { 11 super("MapQuest Open Aerial", PATTERN );11 super("MapQuest Open Aerial", PATTERN, "mapquest-oa"); 12 12 } 13 13 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/MapQuestOsmTileSource.java
r30223 r30854 9 9 10 10 public MapQuestOsmTileSource() { 11 super("MapQuest-OSM", PATTERN );11 super("MapQuest-OSM", PATTERN, "mapquest-osm"); 12 12 } 13 13 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java
r30628 r30854 22 22 */ 23 23 public Mapnik() { 24 super("Mapnik", PATTERN );24 super("Mapnik", PATTERN, "MAPNIK"); 25 25 } 26 26 … … 57 57 */ 58 58 public CycleMap() { 59 super("Cyclemap", PATTERN );59 super("Cyclemap", PATTERN, "opencylemap"); 60 60 } 61 61 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java
r30628 r30854 46 46 private ScanexLayer Layer = ScanexLayer.IRS; 47 47 48 public ScanexTileSource(String name, String url, int maxZoom) {49 super(name, url, maxZoom);48 public ScanexTileSource(String name, String url, String id, int maxZoom) { 49 super(name, url, id, maxZoom); 50 50 51 51 for (ScanexLayer layer : ScanexLayer.values()) { -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TMSTileSource.java
r30849 r30854 7 7 protected int minZoom = 0; 8 8 9 public TMSTileSource(String name, String url, int maxZoom) {10 super(name, url );9 public TMSTileSource(String name, String url, String id, int maxZoom) { 10 super(name, url, id); 11 11 this.maxZoom = maxZoom; 12 12 } 13 13 14 public TMSTileSource(String name, String url, int minZoom, int maxZoom) {15 super(name, url );14 public TMSTileSource(String name, String url, String id, int minZoom, int maxZoom) { 15 super(name, url, id); 16 16 this.minZoom = minZoom; 17 17 this.maxZoom = maxZoom; -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java
r30426 r30854 27 27 }; 28 28 29 public TemplatedTMSTileSource(String name, String url, int maxZoom) {30 super(name, url, maxZoom);29 public TemplatedTMSTileSource(String name, String url, String id, int maxZoom) { 30 super(name, url, id, maxZoom); 31 31 handleTemplate(); 32 32 } 33 33 34 public TemplatedTMSTileSource(String name, String url, int minZoom, int maxZoom) {35 super(name, url, minZoom, maxZoom);34 public TemplatedTMSTileSource(String name, String url, String id, int minZoom, int maxZoom) { 35 super(name, url, id, minZoom, maxZoom); 36 36 handleTemplate(); 37 37 }
Note:
See TracChangeset
for help on using the changeset viewer.