[Commits] r1735 - sandbox/euzuro/imageLayer/lib/OpenLayers/Layer
commits at openlayers.org
commits at openlayers.org
Wed Oct 25 18:08:47 EDT 2006
Author: euzuro
Date: 2006-10-25 18:08:47 -0400 (Wed, 25 Oct 2006)
New Revision: 1735
Modified:
sandbox/euzuro/imageLayer/lib/OpenLayers/Layer/Image.js
Log:
as discussed on irc with tschaub, let's just set the maxResolution by default
Modified: sandbox/euzuro/imageLayer/lib/OpenLayers/Layer/Image.js
===================================================================
--- sandbox/euzuro/imageLayer/lib/OpenLayers/Layer/Image.js 2006-10-25 01:57:34 UTC (rev 1734)
+++ sandbox/euzuro/imageLayer/lib/OpenLayers/Layer/Image.js 2006-10-25 22:08:47 UTC (rev 1735)
@@ -91,35 +91,13 @@
},
/**
- * This is a bad method to have here. It would be nicer to be able
- * to ask Layer directly.
- */
- shouldCalcResolutions: function() {
- var props = new Array(
- 'scales', 'resolutions',
- 'maxScale', 'minScale',
- 'maxResolution', 'minResolution',
- 'minExtent', 'maxExtent',
- 'numZoomLevels', 'maxZoomLevel'
- );
- for(var i=0; i < props.length; i++) {
- var property = props[i];
- if(this.options[property] != null) {
- return false;
- }
- }
- return true;
- },
-
-
- /**
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
// If nothing to do with resolutions has been set, assume a single
// resolution determined by extent/size
- if(this.shouldCalcResolutions()) {
- this.options.resolutions = [this.extent.getWidth() / this.size.w];
+ if( this.options.maxResolution == null ) {
+ this.options.maxResolution = this.extent.getWidth() / this.size.w;
}
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
},
More information about the Commits
mailing list