- Timestamp:
- 2015-07-26T18:19:24+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r8618 r8619 15 15 import java.util.regex.Pattern; 16 16 17 import org.openstreetmap.gui.jmapviewer.Coordinate;18 17 import org.openstreetmap.gui.jmapviewer.OsmMercator; 19 18 import org.openstreetmap.gui.jmapviewer.Tile; … … 169 168 170 169 @Override 171 public double getDistance(double lat1, double lon1, double lat2, double lon2) { 172 throw new UnsupportedOperationException("Not implemented"); 173 } 174 175 @Override 176 public int lonToX(double lon, int zoom) { 177 throw new UnsupportedOperationException("Not implemented"); 178 } 179 180 @Override 181 public int latToY(double lat, int zoom) { 182 throw new UnsupportedOperationException("Not implemented"); 183 } 184 185 @Override 186 public double XToLon(int x, int zoom) { 187 throw new UnsupportedOperationException("Not implemented"); 188 } 189 190 @Override 191 public double YToLat(int y, int zoom) { 192 throw new UnsupportedOperationException("Not implemented"); 193 } 194 195 @Override 196 public double latToTileY(double lat, int zoom) { 197 throw new UnsupportedOperationException("Not implemented"); 198 } 199 200 @Override 201 public Coordinate tileXYToLatLon(Tile tile) { 170 public String getTileId(int zoom, int tilex, int tiley) { 171 return getTileUrl(zoom, tilex, tiley); 172 } 173 174 @Override 175 public ICoordinate tileXYToLatLon(Tile tile) { 202 176 return tileXYToLatLon(tile.getXtile(), tile.getYtile(), tile.getZoom()); 203 177 } 204 178 205 179 @Override 206 public Coordinate tileXYToLatLon(TileXY xy, int zoom) {180 public ICoordinate tileXYToLatLon(TileXY xy, int zoom) { 207 181 return tileXYToLatLon(xy.getXIndex(), xy.getYIndex(), zoom); 208 182 } 209 183 210 184 @Override 211 public Coordinate tileXYToLatLon(int x, int y, int zoom) { 212 LatLon ret = Main.getProjection().eastNorth2latlon(getTileEastNorth(x, y, zoom)); 213 return new Coordinate(ret.lat(), ret.lon()); 185 public ICoordinate tileXYToLatLon(int x, int y, int zoom) { 186 return Main.getProjection().eastNorth2latlon(getTileEastNorth(x, y, zoom)).toCoordinate(); 214 187 } 215 188 … … 268 241 269 242 @Override 270 public Coordinate XYToLatLon(Point point, int zoom) {243 public ICoordinate XYToLatLon(Point point, int zoom) { 271 244 return XYToLatLon(point.x, point.y, zoom); 272 245 } 273 246 274 247 @Override 275 public Coordinate XYToLatLon(int x, int y, int zoom) {248 public ICoordinate XYToLatLon(int x, int y, int zoom) { 276 249 double scale = getDegreesPerTile(zoom) / getTileSize(); 277 250 Projection proj = Main.getProjection(); … … 280 253 topLeftCorner.north() - y * scale 281 254 ); 282 LatLon ll = proj.eastNorth2latlon(ret); 283 return new Coordinate(ll.lat(), ll.lon()); 284 } 285 286 @Override 287 public double lonToTileX(double lon, int zoom) { 288 throw new UnsupportedOperationException("Not implemented"); 289 } 290 291 @Override 292 public double tileXToLon(int x, int zoom) { 293 throw new UnsupportedOperationException("Not implemented"); 294 } 295 296 @Override 297 public double tileYToLat(int y, int zoom) { 298 throw new UnsupportedOperationException("Not implemented"); 255 return proj.eastNorth2latlon(ret).toCoordinate(); 299 256 } 300 257 … … 302 259 public Map<String, String> getHeaders() { 303 260 return headers; 261 } 262 263 @Override 264 public double lonToTileX(double lon, int zoom) { 265 throw new UnsupportedOperationException("Not implemented"); 266 } 267 268 @Override 269 public double tileXToLon(int x, int zoom) { 270 throw new UnsupportedOperationException("Not implemented"); 271 } 272 273 @Override 274 public double tileYToLat(int y, int zoom) { 275 throw new UnsupportedOperationException("Not implemented"); 276 } 277 278 @Override 279 public double getDistance(double lat1, double lon1, double lat2, double lon2) { 280 throw new UnsupportedOperationException("Not implemented"); 281 } 282 283 @Override 284 public int lonToX(double lon, int zoom) { 285 throw new UnsupportedOperationException("Not implemented"); 286 } 287 288 @Override 289 public int latToY(double lat, int zoom) { 290 throw new UnsupportedOperationException("Not implemented"); 291 } 292 293 @Override 294 public double XToLon(int x, int zoom) { 295 throw new UnsupportedOperationException("Not implemented"); 296 } 297 298 @Override 299 public double YToLat(int y, int zoom) { 300 throw new UnsupportedOperationException("Not implemented"); 301 } 302 303 @Override 304 public double latToTileY(double lat, int zoom) { 305 throw new UnsupportedOperationException("Not implemented"); 304 306 } 305 307 … … 378 380 return bounds; 379 381 } 380 381 @Override382 public String getTileId(int zoom, int tilex, int tiley) {383 return getTileUrl(zoom, tilex, tiley);384 }385 382 }
Note:
See TracChangeset
for help on using the changeset viewer.