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:
@@ -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]];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user