0

Fix bad coords for upper-left and -right north

This commit is contained in:
Ryan Rector
2011-07-10 07:42:50 -06:00
parent 61afc6f921
commit e81db44ea9

View File

@@ -516,11 +516,11 @@ var overviewer = {
// so the Y coordinate is at 0.5, and the X is at 0.5 -
// ((tileSize / 2) / (tileSize * 2^maxZoom))
// or equivalently, 0.5 - (1 / 2^(maxZoom + 1))
lng = 0.5 - (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
lat = 0.5;
if(overviewerConfig.map.north_direction == 'upper-right'){
lng = 0.5 + (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
} else if(overviewerConfig.map.north_direction == 'upper-left'){
if(overviewerConfig.map.north_direction == 'lower-left' ||
overviewerConfig.map.north_direction == 'lower-right'){
lng = 0.5 - (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
} else{
lng = 0.5 + (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
}
@@ -568,12 +568,12 @@ var overviewer = {
// Revert base positioning
// See equivalent code in fromWorldToLatLng()
lng -= 0.5 - (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
lat -= 0.5;
if(overviewerConfig.map.north_direction == 'upper-right'){
lng -= 0.5 + (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
} else if(overviewerConfig.map.north_direction == 'upper-left'){
if(overviewerConfig.map.north_direction == 'lower-left' ||
overviewerConfig.map.north_direction == 'lower-right'){
lng -= 0.5 - (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
} else{
lng -= 0.5 + (1.0 / Math.pow(2, overviewerConfig.map.maxZoom + 1));
}