Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions source/core/mercatorquadtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ MercatorQuadtree.prototype.QuadKeyToWGS84 = function(quadcode, coords)
var maxpixelY=(1.00-mercator[3])*256*Math.pow(2,lod);
var x = (Math.min(Math.max(minpixelX, 0), mapSize - 1) / mapSize) - 0.5;
var y = 0.5 - (Math.min(Math.max(minpixelY, 0), mapSize - 1) / mapSize);
var minx = 90.0 - 360.0 * Math.atan(Math.exp(-y * 2.0 * Math.PI)) / Math.PI;
var miny = 360.0000 * x;
var miny = 90.0 - 360.0 * Math.atan(Math.exp(-y * 2.0 * Math.PI)) / Math.PI;
var minx = 360.0000 * x;

x = (Math.min(Math.max(minpixelX, 0), mapSize - 1) / mapSize) - 0.5;
y = 0.5 - (Math.min(Math.max(minpixelY, 0), mapSize - 1) / mapSize);
var maxx = 90.0 - 360.0 * Math.atan(Math.exp(-y * 2.0 * Math.PI)) / Math.PI;
var maxy = 360.0000 * x;
coords[0]=minx;
coords[1]=miny;
coords[2]=maxx;
coords[3]=maxy;
x = (Math.min(Math.max(maxpixelX, 0), mapSize - 1) / mapSize) - 0.5;
y = 0.5 - (Math.min(Math.max(maxpixelY, 0), mapSize - 1) / mapSize);
var maxy = 90.0 - 360.0 * Math.atan(Math.exp(-y * 2.0 * Math.PI)) / Math.PI;
var maxx = 360.0000 * x;
coords[0]=minx; //swap(y0,y1) coordinates for pixel based coordinates.
coords[1]=maxy;
coords[2]=maxx;
coords[3]=miny;

}
//------------------------------------------------------------------------------
Expand All @@ -203,4 +203,4 @@ goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToMercatorCoord', Mercat
goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToNormalizedCoord', MercatorQuadtree.prototype.QuadKeyToNormalizedCoord);
goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToTileCoord', MercatorQuadtree.prototype.QuadKeyToTileCoord);
goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToMercator', MercatorQuadtree.prototype.QuadKeyToMercator);
goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToWGS84', MercatorQuadtree.prototype.QuadKeyToWGS84);
goog.exportProperty(MercatorQuadtree.prototype, 'QuadKeyToWGS84', MercatorQuadtree.prototype.QuadKeyToWGS84);