@Test public void getTileUrlTest() throws MalformedURLException { TileSource tileSource = OpenStreetMapMapnik.INSTANCE; URL tileUrl = tileSource.getTileUrl(new Tile(0, 1, (byte) 2)); Assert.assertTrue(tileUrl.toExternalForm().endsWith(".tile.openstreetmap.org:80/2/0/1.png")); }
@Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append('/'); 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()); }
OpenStreetMapMapnik extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append('/'); 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()); } }
OpenStreetMapMapnik extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append('/'); 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()); } OpenStreetMapMapnik(String[] hostName, int port); }
OpenStreetMapMapnik extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append('/'); 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()); } OpenStreetMapMapnik(String[] hostName, int port); @Override int getParallelRequestsLimit(); @Override URL getTileUrl(Tile tile); @Override byte getZoomLevelMax(); @Override byte getZoomLevelMin(); @Override boolean hasAlpha(); }
OpenStreetMapMapnik extends AbstractTileSource { @Override public URL getTileUrl(Tile tile) throws MalformedURLException { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.append('/'); 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()); } OpenStreetMapMapnik(String[] hostName, int port); @Override int getParallelRequestsLimit(); @Override URL getTileUrl(Tile tile); @Override byte getZoomLevelMax(); @Override byte getZoomLevelMin(); @Override boolean hasAlpha(); static final OpenStreetMapMapnik INSTANCE; }