Changed OpenLayers.Bounds to use left, bottom, right, top INSTEAD OF minlon, minlat, maxlon, maxlat. Removed OpenLayers.Box which was not getting used. JSDOC/coding standard-ified the OpenLayers.Bounds code and wrote thorough testing for it. Should be all good.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-18 12:48:52 +00:00
parent 6ab326f67d
commit eeba5a34c6
7 changed files with 293 additions and 213 deletions

View File

@@ -222,7 +222,7 @@ OpenLayers.Map.prototype = {
*/
getZoomForExtent: function (bounds) {
var size = this.getSize();
var deg_per_pixel = bounds.width / size.w;
var deg_per_pixel = bounds.getWidth() / size.w;
var zoom = Math.log(deg_per_pixel / this.maxResolution) / Math.log(2);
return Math.floor(Math.max(zoom, 0));
},
@@ -318,8 +318,8 @@ OpenLayers.Map.prototype = {
var oldZoom = this.zoom;
this.zoom = this.getZoomForExtent( fullExtent );
this.setCenter(
new OpenLayers.LonLat((fullExtent.minlon+fullExtent.maxlon)/2,
(fullExtent.minlat+fullExtent.maxlat)/2)
new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2,
(fullExtent.bottom+fullExtent.top)/2)
);
},