Work around change in handler behaviour in OpenLayers 2.10
authorTom Hughes <tom@compton.nu>
Wed, 15 Sep 2010 09:52:04 +0000 (10:52 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 15 Sep 2010 09:52:04 +0000 (10:52 +0100)
We need to install the endDrag routine as the "done" handler after
creating the control otherwise the control will overwrite our handler
with one of it's own.

app/views/browse/start.rjs

index 1b68043..d4ef1f5 100644 (file)
@@ -25,10 +25,10 @@ page << <<EOJ
         sides: 4,
         snapAngle: 90,
         irregular: true,
-        persist: true,
-        callbacks: { done: endDrag }
+        persist: true
       }
     });
+    browseBoxControl.handler.callbacks.done = endDrag;
     map.addControl(browseBoxControl);
 
     map.events.register("moveend", map, showData);