From f7937beffe0f0f12e12f99b5ab16196d347ef57f Mon Sep 17 00:00:00 2001
From: Antonio Ospite <ospite@studenti.unina.it>
Date: Mon, 9 May 2011 12:56:30 +0200
Subject: [PATCH] Issue #1145044: fix setting and displaying Restricted Extent
X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
 ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
 !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE

Fix setting and displaying Restricted Extent automatically from the map
in the Center & Bounds configuration panel:

  - the first chunk fixes setting the input box value when drawing the
    area on the map: CSS selector names are case sensitive when using
    XHTML;

  - the second chunk fixes displaying the bounding box when already set
    in the Restricted Extend input box: use the ID selector syntax.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 .../behaviors/js/openlayers_behavior_boxselect.js  |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/includes/behaviors/js/openlayers_behavior_boxselect.js b/includes/behaviors/js/openlayers_behavior_boxselect.js
index 748f97a..7dad984 100644
--- a/includes/behaviors/js/openlayers_behavior_boxselect.js
+++ b/includes/behaviors/js/openlayers_behavior_boxselect.js
@@ -13,7 +13,7 @@ Drupal.behaviors.openlayers_behavior_boxselect = {
   'attach': function(context, settings) {
     function setRestrictedExtent(box) {
       bounding_box = box.geometry.getBounds().toBBOX();
-      $('#edit-center-restrict-restrictedExtent').val(bounding_box);
+      $('#edit-center-restrict-restrictedextent').val(bounding_box);
       for (i = 0; i < selections_layer.features.length; i++) {
         if (selections_layer.features[i] != box) {
           selections_layer.features[i].destroy();
@@ -36,8 +36,8 @@ Drupal.behaviors.openlayers_behavior_boxselect = {
       control.events.on({'featureAdded': this.setRestrictedExtent});
       data.openlayers.addLayer(selections_layer);
       data.openlayers.addControl(control);
-      if ($('edit-center-restrict-restrictedextent').val()) {
-        bounds = $('edit-center-restrict-restrictedextent').val();
+      if ($('#edit-center-restrict-restrictedextent').val()) {
+        bounds = $('#edit-center-restrict-restrictedextent').val();
         geometry = new OpenLayers.Bounds.fromString(bounds).toGeometry();
         feature = new OpenLayers.Feature.Vector(geometry);
         selections_layer.addFeatures([feature]);
-- 
1.7.5.1

