]> git.openstreetmap.org Git - rails.git/commitdiff
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 1b68043c9065703e085671a88ae8eed3f4565755..d4ef1f530ca85b1aa170d6393edbccec7a016fd8 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);