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