Index: includes/openlayers.render.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/openlayers.render.inc,v
retrieving revision 1.3.2.16
diff -u -p -r1.3.2.16 openlayers.render.inc
--- includes/openlayers.render.inc	27 Apr 2010 15:50:15 -0000	1.3.2.16
+++ includes/openlayers.render.inc	6 Sep 2010 12:40:25 -0000
@@ -20,10 +20,12 @@
 function _openlayers_layers_process($layers = array(), &$map = array()) {
   $layer_data = array();
 
+  $weight = 0;
   foreach ($layers as $layer) {
     if ($layer_object = openlayers_layer_load($layer)) {
       $layer_object->render($map);
       $layer_object->data['title'] = $layer_object->title;
+      $layer_object->data['weight'] = ++$weight;
       $layer_data[$layer_object->name] = $layer_object->data;
     }
   }
Index: js/openlayers.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/js/openlayers.js,v
retrieving revision 1.47.2.36
diff -u -p -r1.47.2.36 openlayers.js
--- js/openlayers.js	6 Aug 2010 20:35:15 -0000	1.47.2.36
+++ js/openlayers.js	6 Sep 2010 12:40:25 -0000
@@ -151,8 +151,18 @@ Drupal.openlayers = {
    * @param openlayers OpenLayers Map Object
    */
   'addLayers': function(map, openlayers) {
+
+    var sorted = [];
     for (var name in map.layers) {
+      sorted.push({'name': name, 'weight': map.layers[name].weight });
+    };
+    sorted.sort(function(a, b) {
+      return a.weight > b.weight;
+    });
+
+    for (var i=0; i<sorted.length; ++i) {
       var layer;      
+      var name = sorted[i].name;
       var options = map.layers[name];
       
       // Add reference to our layer ID
