SHOW:
|
|
- or go back to the newest paste.
1 | //x, y and zoom to get the tile, the edge belongs to | |
2 | //hOffset: horizontal offset from the generated maps center to the edge | |
3 | //vOffset: vertical offset from the generated maps center to the edge | |
4 | private double[] getTilesEdge(int x, int y, int zoom, int hOffset, int vOffset) { | |
5 | double[] result = new double[2]; | |
6 | double lngCenter = x/Math.pow(2,zoom)*360.0-180.0; //langitude of the center of the edge tile | |
7 | double latCenter = Math.toDegrees(Math.atan(Math.sinh(Math.PI-2*y/Math.pow(2,zoom)))); //latitude of the center of the edge tile | |
8 | - | int xPos = 128+hOffset; |
8 | + | int xPos = 128+(-1)*hOffset; |
9 | - | int yPos = 128+vOffset; |
9 | + | int yPos = 128+(-1)*vOffset; |
10 | result [0] = //to do: latitude of the edge | |
11 | result [1] = //to do: langitude of the edge | |
12 | return result; | |
13 | } |