Remove the concept of min/max zoom level from Map. Replace it with concept of num zoom levels. Bit of rearrangement in the initResolutions() function in HTTPRequest.js. Adapt all of OL to deal with numZoomLevels instead of min/max. Fix PanZoomBar so that it listens for change of baselayer and redraws itself. fix all tests so they pass. Add zoomLevels.html example for playing around with different methods of setting zoomlevels.
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1302 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -51,10 +51,7 @@ OpenLayers.Layer.prototype = {
|
||||
maxResolution: null,
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: null,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: null,
|
||||
numZoomLevels: null,
|
||||
|
||||
/** @type float */
|
||||
minScale: null,
|
||||
@@ -178,12 +175,12 @@ OpenLayers.Layer.prototype = {
|
||||
this.map = map;
|
||||
|
||||
var properties = new Array(
|
||||
'projection', 'minExtent', 'maxExtent',
|
||||
'minScale', 'maxScale',
|
||||
'projection', 'units',
|
||||
'scales', 'resolutions',
|
||||
'maxScale', 'minScale',
|
||||
'maxResolution', 'minResolution',
|
||||
'minZoomLevel', 'maxZoomLevel', 'units',
|
||||
'scales', 'resolutions'
|
||||
|
||||
'minExtent', 'maxExtent',
|
||||
'numZoomLevels'
|
||||
);
|
||||
for(var i=0; i < properties.length; i++) {
|
||||
if (this[properties[i]] == null) {
|
||||
@@ -251,19 +248,11 @@ OpenLayers.Layer.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The minimum zoom level that can be reached in this layer
|
||||
* @returns The total number of zoom levels this layer can reach
|
||||
* @type int
|
||||
*/
|
||||
getMinZoomLevel: function() {
|
||||
return this.minZoomLevel;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The maximum zoom level that can be reached in this layer
|
||||
* @type int
|
||||
*/
|
||||
getMaxZoomLevel: function() {
|
||||
return this.maxZoomLevel;
|
||||
getNumZoomLevels: function() {
|
||||
return this.numZoomLevels;
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
|
||||
Reference in New Issue
Block a user