From c5c699ae6194f6b215ae44a9c22df1e0133c0a72 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 10 Jul 2011 23:12:24 -0500 Subject: [PATCH] Fix worldtomap conversion --- web/js/hdmap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/js/hdmap.js b/web/js/hdmap.js index 9e2cf632..e3b991e8 100644 --- a/web/js/hdmap.js +++ b/web/js/hdmap.js @@ -10,10 +10,10 @@ HDProjection.prototype = { }, fromWorldToLatLng: function(x, y, z) { var wtp = this.worldtomap; - var xx = x*wtp[0] + y*wtp[1] + z*wtp[2]; - var yy = x*wtp[3] + y*wtp[4] + z*wtp[5]; + var xx = wtp[0]*x + wtp[1]*y + wtp[2]*z; + 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)); } };