Merge pull request #268 from mikeprimm/hdrender

Fix worldtomap conversion (y coordinate off by 1 tile)
This commit is contained in:
mikeprimm 2011-07-10 21:14:20 -07:00
commit d8052d4196

View File

@ -10,10 +10,10 @@ HDProjection.prototype = {
}, },
fromWorldToLatLng: function(x, y, z) { fromWorldToLatLng: function(x, y, z) {
var wtp = this.worldtomap; var wtp = this.worldtomap;
var xx = x*wtp[0] + y*wtp[1] + z*wtp[2]; var xx = wtp[0]*x + wtp[1]*y + wtp[2]*z;
var yy = x*wtp[3] + y*wtp[4] + z*wtp[5]; var yy = wtp[3]*x + wtp[4]*y + wtp[5]*z;
return new google.maps.LatLng(-yy / config.tileHeight / (1 << this.extrazoom), xx / config.tileWidth / (1 << this.extrazoom)); return new google.maps.LatLng( (1 - (yy / config.tileHeight)) / (1 << this.extrazoom), xx / config.tileWidth / (1 << this.extrazoom));
} }
}; };