Fix zoom-out coordinate consistency on HDMaps

This commit is contained in:
Mike Primm 2011-07-04 10:18:05 -05:00
parent e2244ddda5
commit 961eb17536
6 changed files with 38 additions and 9 deletions

View file

@ -2,10 +2,10 @@ function HDProjection() {}
HDProjection.prototype = {
extrazoom: 0,
fromLatLngToPoint: function(latLng) {
return new google.maps.Point(latLng.lng()*config.tileWidth,latLng.lat()*config.tileHeight);
return new google.maps.Point(latLng.lng()*config.tileWidth, latLng.lat()*config.tileHeight);
},
fromPointToLatLng: function(point) {
return new google.maps.LatLng(point.y/config.tileHeight, point.x/config.tileWidth);
return new google.maps.LatLng( point.y/config.tileHeight, point.x/config.tileWidth);
},
fromWorldToLatLng: function(x, y, z) {
return new google.maps.LatLng(-z / config.tileWidth / (1 << this.extrazoom), x / config.tileHeight / (1 << this.extrazoom));