? wms_numZoomLevels.patch
Index: includes/layer_types/wms.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/layer_types/Attic/wms.inc,v
retrieving revision 1.1.2.20
diff -u -p -r1.1.2.20 wms.inc
--- includes/layer_types/wms.inc	17 Sep 2010 13:02:28 -0000	1.1.2.20
+++ includes/layer_types/wms.inc	22 Sep 2010 10:53:15 -0000
@@ -16,7 +16,11 @@ class openlayers_layer_type_wms extends 
       if (isset($this->data['options']['srs'])) {
         $pts = explode(':', $this->data['options']['srs']);
         $this->data['projection'] = array($pts[1]);
-        $this->data['params']['resolutions'] = openlayers_get_resolutions($pts[1]);
+	// Only init resolutions if no numZoomLevels specified
+	if (empty($this->data['params']['numZoomLevels']))
+	{
+        	$this->data['params']['resolutions'] = openlayers_get_resolutions($pts[1]);
+	}
         $this->data['params']['projection'] = $this->data['options']['srs']; 
         $this->data['params']['maxextent'] =  openlayers_get_extent($pts[1]);
       }
@@ -84,8 +88,15 @@ class openlayers_layer_type_wms extends 
             $this->data['params']['singleTile'] : FALSE,
           '#title' => t('Single tile'),
           '#description' => t('Check to make this layer untiled')
-        )
-      ),
+        ),
+        'numZoomLevels' => array(
+          '#type' => 'textfield',
+          '#default_value' => isset($this->data['params']['numZoomLevels']) ? 
+            $this->data['params']['numZoomLevels'] : 16,
+          '#title' => t('numZoomLevels'),
+          '#description' => t('Number of zoom levels supported by the layer (leave empty for default resolutions)')
+	)
+      ),	
       'options' => array(
         'srs' => array(
           '#type' => 'select',
Index: includes/layer_types/js/wms.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/layer_types/js/Attic/wms.js,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 wms.js
--- includes/layer_types/js/wms.js	15 Sep 2010 21:28:21 -0000	1.1.2.3
+++ includes/layer_types/js/wms.js	22 Sep 2010 10:53:15 -0000
@@ -18,7 +18,9 @@ Drupal.openlayers.layer.wms = function(t
   if (options.params.ratio) {
     options.params.ratio = parseFloat(options.params.ratio);
   }
-
+  if (options.params.numZoomLevels)    {
+       options.params.numZoomLevels = parseInt(options.params.numZoomLevels);
+ }
   options.params.drupalID = options.drupalID;
   var layer = new OpenLayers.Layer.WMS(title,
     options.base_url, options.options, options.params);
