Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //x, y and zoom to get the tile, the edge belongs to
- //hOffset: horizontal offset from the generated maps center to the edge
- //vOffset: vertical offset from the generated maps center to the edge
- private double[] getTilesEdge(int x, int y, int zoom, int hOffset, int vOffset) {
- double[] result = new double[2];
- double lngCenter = x/Math.pow(2,zoom)*360.0-180.0; //langitude of the center of the edge tile
- double latCenter = Math.toDegrees(Math.atan(Math.sinh(Math.PI-2*y/Math.pow(2,zoom)))); //latitude of the center of the edge tile
- int xPos = 128+(-1)*hOffset;
- int yPos = 128+(-1)*vOffset;
- result [0] = //to do: latitude of the edge
- result [1] = //to do: langitude of the edge
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement