added getZoomForResolution() to map & layer. partial fix for #204 -- need to make a getZoomForResolution() for OpenLayers.Layer.FixedZoomLevels
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1382 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -781,12 +781,12 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns A suitable zoom level for the specified bounds.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns A suitable zoom level for the specified bounds.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
zoom = null;
|
||||
if (this.baseLayer != null) {
|
||||
@@ -795,6 +795,21 @@ OpenLayers.Map.prototype = {
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} resolution
|
||||
*
|
||||
* @returns A suitable zoom level for the specified resolution.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForResolution: function(resolution) {
|
||||
zoom = null;
|
||||
if (this.baseLayer != null) {
|
||||
zoom = this.baseLayer.getZoomForResolution(resolution);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Zooming Functions */
|
||||
|
||||
Reference in New Issue
Block a user