From 2a496c840cd2b05782dae53ec1277b6690f74fad Mon Sep 17 00:00:00 2001 From: euzuro Date: Sat, 12 Aug 2006 16:23:01 +0000 Subject: [PATCH] rename setScale() to zoomToScale() and move it down a few lines in the code git-svn-id: http://svn.openlayers.org/trunk/openlayers@1200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 44e7016a6f..6d8ee717d5 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -835,25 +835,6 @@ OpenLayers.Map.prototype = { /* */ /********************************************************/ - /** zoom to a specified scale - * - * @param {float} scale - */ - setScale: function(scale) { - var res = OpenLayers.Util.getResolutionFromScale(scale, this.baseLayer.units); - var size = this.getSize(); - var w_deg = size.w * res; - var h_deg = size.h * res; - var center = this.getCenter(); - - var extent = new OpenLayers.Bounds(center.lon - w_deg / 2, - center.lat - h_deg / 2, - center.lon + w_deg / 2, - center.lat + h_deg / 2); - this.zoomToExtent(extent); - - }, - /** Zoom to a specific zoom level * * @param {int} zoom @@ -900,6 +881,25 @@ OpenLayers.Map.prototype = { this.zoomToExtent(this.getMaxExtent()); }, + /** zoom to a specified scale + * + * @param {float} scale + */ + zoomToScale: function(scale) { + var res = OpenLayers.Util.getResolutionFromScale(scale, + this.baseLayer.units); + var size = this.getSize(); + var w_deg = size.w * res; + var h_deg = size.h * res; + var center = this.getCenter(); + + var extent = new OpenLayers.Bounds(center.lon - w_deg / 2, + center.lat - h_deg / 2, + center.lon + w_deg / 2, + center.lat + h_deg / 2); + this.zoomToExtent(extent); + }, + /********************************************************/ /* */ /* Translation Functions */