Changeset 34765 in osm for applications/viewer/jmapviewer/src
- Timestamp:
- 2018-12-04T08:23:41+01:00 (6 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java
r34669 r34765 92 92 * @param la2 latitude of second point 93 93 * @param lo2 longitude of second point 94 * @return the distance betwe n first and second point, in m.94 * @return the distance between first and second point, in m. 95 95 */ 96 96 double getDistance(double la1, double lo1, double la2, double lo2); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java
r33973 r34765 26 26 */ 27 27 public Mapnik() { 28 super(" Mapnik", PATTERN, "MAPNIK");28 super("OpenStreetMap Carto", PATTERN, "standard"); 29 29 modTileFeatures = true; 30 30 } … … 41 41 * The "Cycle Map" OSM tile source. 42 42 */ 43 public static class CycleMap extends AbstractOsmTileSource {43 public abstract static class CycleMap extends AbstractOsmTileSource { 44 44 45 private static final String PATTERN = "http ://%s.tile.opencyclemap.org/cycle";45 private static final String PATTERN = "https://%s.tile.thunderforest.com/cycle"; 46 46 47 47 private static final String[] SERVER = {"a", "b", "c"}; … … 53 53 */ 54 54 public CycleMap() { 55 super(" Cyclemap", PATTERN, "opencyclemap");55 super("OpenCycleMap", PATTERN, "opencyclemap"); 56 56 } 57 57 … … 63 63 } 64 64 65 @Override66 public int getMaxZoom() {67 return 18;68 }69 }70 71 /**72 * The "Transport Map" OSM tile source.73 *74 * Template for thunderforest.com.75 */76 public abstract static class TransportMap extends AbstractOsmTileSource {77 78 private static final String PATTERN = "https://%s.tile.thunderforest.com/transport";79 80 private static final String[] SERVER = {"a", "b", "c"};81 82 private int serverNum;83 84 /**85 * Constructs a new {@code TransportMap} tile source.86 */87 public TransportMap() {88 super("OSM Transport Map", PATTERN, "osmtransportmap");89 }90 91 65 /** 92 66 * Get the thunderforest API key. … … 96 70 */ 97 71 protected abstract String getApiKey(); 98 99 @Override100 public String getBaseUrl() {101 String url = String.format(this.baseUrl, new Object[] {SERVER[serverNum]});102 serverNum = (serverNum + 1) % SERVER.length;103 return url;104 }105 72 106 73 @Override … … 115 82 116 83 @Override 84 public String getTermsOfUseText() { 85 return "Maps © Thunderforest"; 86 } 87 88 @Override 89 public String getTermsOfUseURL() { 90 return "https://thunderforest.com/terms/"; 91 } 92 } 93 94 /** 95 * The "Transport Map" OSM tile source. 96 * 97 * Template for thunderforest.com. 98 */ 99 public static class TransportMap extends AbstractOsmTileSource { 100 101 /** 102 * Constructs a new {@code TransportMap} tile source. 103 */ 104 public TransportMap() { 105 super("Public Transport", "https://tile.memomaps.de/tilegen", "public_transport_oepnv"); 106 } 107 108 @Override 109 public int getMaxZoom() { 110 return 18; 111 } 112 113 @Override 117 114 public String getAttributionText(int zoom, ICoordinate topLeft, ICoordinate botRight) { 118 return " Maps © Thunderforest, Data © OpenStreetMap contributors";115 return "© OpenStreetMap contributors, CC-BY-SA"; 119 116 } 120 117 121 118 @Override 122 119 public String getAttributionLinkURL() { 123 return "http ://www.thunderforest.com/";120 return "https://öpnvkarte.de/<"; 124 121 } 125 122 } 126 127 123 }
Note:
See TracChangeset
for help on using the changeset viewer.