Commit scale-based methods back into trunk. Layers or Maps now support setting

a list of scales or resolutions in the options to the constructor, from which
resolutions are calculated. Map now has a 'setScale' function which will allow
you to zoom to as close to a given scale as possible.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1171 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-08-09 19:14:16 +00:00
parent e3df606001
commit 6efaf328e5
5 changed files with 120 additions and 30 deletions

View File

@@ -54,7 +54,15 @@ OpenLayers.Layer.prototype = {
/** @type int */
maxZoomLevel: null,
/** @type float */
minScale: null,
/** @type float */
maxScale: null,
/** @type String */
units: null,
/**
* @constructor
@@ -162,6 +170,20 @@ OpenLayers.Layer.prototype = {
*/
setMap: function(map) {
this.map = map;
var properties = new Array(
'projection', 'minExtent', 'maxExtent',
'minScale', 'maxScale',
'maxResolution', 'minResolution',
'minZoomLevel', 'maxZoomLevel', 'units',
'scales', 'resolutions'
);
for(var i=0; i < properties.length; i++) {
if (this[properties[i]] == null) {
this[properties[i]] = this.map[properties[i]];
}
}
},
/**