mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-25 03:35:18 +01:00
Merge pull request #268 from mikeprimm/hdrender
Fix worldtomap conversion (y coordinate off by 1 tile)
This commit is contained in:
commit
d8052d4196
@ -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));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user