/** * Create a clone from this object. * * @return cloned tile code */ @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "needed for GWT") public TileCode clone() { // NOSONAR super.clone() not supported by GWT return new TileCode(tileLevel, x, y); }
/** * @param relativeUrl just the part with level/x/y.extension * @return */ public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; } }
codes.add(new TileCode(currentTileLevel, x, y));
@Override public TileCode getTileCodeForLocation(ViewPort viewPort, WmsTileConfiguration tileConfig, Coordinate location, double scale) { double actualScale = viewPort.getZoomStrategy().checkScale(scale, ZoomOption.LEVEL_CLOSEST); int tileLevel = viewPort.getZoomStrategy().getZoomStepIndex(actualScale); double resolution = 1 / actualScale; double worldTileWidth = tileConfig.getTileWidth() * resolution; double worldTileHeight = tileConfig.getTileHeight() * resolution; Coordinate tileOrigin = tileConfig.getTileOrigin(); int x = (int) Math.floor((location.getX() - tileOrigin.getX()) / worldTileWidth); int y = (int) Math.floor((location.getY() - tileOrigin.getY()) / worldTileHeight); return new TileCode(tileLevel, x, y); } }
codes.add(new TileCode(tileLevel, x, y));
image.setCode(new TileCode(tileLevel, i, j)); image.setUrl("http://tile.openstreetmap.org/" + tileLevel + "/" + i + "/" + j + ".png"); log.debug("adding OSM image {}", image);
image.setCode(new TileCode(zoomLevel, i, j)); image.setUrl(url); log.debug("adding image {}", image);
image.setCode(new TileCode(zoomLevel, i, j)); image.setUrl(url); log.debug("adding image {}", image);
TileCode tileCode = new TileCode(tileLevel, i, j); image.setCode(tileCode); image.setUrl(formatUrl(urlBuilder.buildUrl(tileCode, getTmsTargetUrl())));
private RasterTile toRasterTile(Tile tile) { RasterTile rTile = new RasterTile(tile.getBounds(), tile.getCode().toString()); rTile.setCode(new TileCode(tile.getCode().getTileLevel(), tile.getCode().getX(), tile.getCode().getY())); rTile.setUrl(tile.getUrl()); return rTile; }