@Test public void getTileUrlTest() throws MalformedURLException { TileSource tileSource = OpenCycleMap.INSTANCE; URL tileUrl = tileSource.getTileUrl(new Tile(0, 1, (byte) 2)); Assert.assertTrue(tileUrl.toExternalForm().endsWith(".tile.opencyclemap.org:80/cycle/2/0/1.png")); }
@Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append("/cycle/"); stringBuilder.append(tile.zoomLevel); stringBuilder.append('/'); stringBuilder.append(tile.tileX); stringBuilder.append('/'); stringBuilder.append(tile.tileY); stringBuilder.append(".png"); return new URL(PROTOCOL, getHostName(), this.port, stringBuilder.toString()); }
OpenCycleMap extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append("/cycle/"); stringBuilder.append(tile.zoomLevel); stringBuilder.append('/'); stringBuilder.append(tile.tileX); stringBuilder.append('/'); stringBuilder.append(tile.tileY); stringBuilder.append(".png"); return new URL(PROTOCOL, getHostName(), this.port, stringBuilder.toString()); } }
OpenCycleMap extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append("/cycle/"); stringBuilder.append(tile.zoomLevel); stringBuilder.append('/'); stringBuilder.append(tile.tileX); stringBuilder.append('/'); stringBuilder.append(tile.tileY); stringBuilder.append(".png"); return new URL(PROTOCOL, getHostName(), this.port, stringBuilder.toString()); } OpenCycleMap(String[] hostName, int port); }
OpenCycleMap extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append("/cycle/"); stringBuilder.append(tile.zoomLevel); stringBuilder.append('/'); stringBuilder.append(tile.tileX); stringBuilder.append('/'); stringBuilder.append(tile.tileY); stringBuilder.append(".png"); return new URL(PROTOCOL, getHostName(), this.port, stringBuilder.toString()); } OpenCycleMap(String[] hostName, int port); @Override int getParallelRequestsLimit(); @Override URL getTileUrl(Tile tile); @Override byte getZoomLevelMax(); @Override byte getZoomLevelMin(); @Override boolean hasAlpha(); }
OpenCycleMap extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append("/cycle/"); stringBuilder.append(tile.zoomLevel); stringBuilder.append('/'); stringBuilder.append(tile.tileX); stringBuilder.append('/'); stringBuilder.append(tile.tileY); stringBuilder.append(".png"); return new URL(PROTOCOL, getHostName(), this.port, stringBuilder.toString()); } OpenCycleMap(String[] hostName, int port); @Override int getParallelRequestsLimit(); @Override URL getTileUrl(Tile tile); @Override byte getZoomLevelMax(); @Override byte getZoomLevelMin(); @Override boolean hasAlpha(); static final OpenCycleMap INSTANCE; }