[OpenLayers-Users] Can not register dblclick in a point handler

Eric Lemoine eric.c2c at gmail.com
Sun Apr 20 14:48:35 EDT 2008


On Fri, Apr 18, 2008 at 8:47 PM, Yingqi <anakintang at gmail.com> wrote:
>
>  All,
>
>  Using OL 2.5, I would like to write a Control inherit from
>  OpenLayers.Control and register the dblclick but I can not get it work. When
>  I double-click the map the callback method for dblclick never get called. So
>  just wonder if I did anything wrong. Here is initialize code of the control
>
>  initialize: function(layer, options) {
>         OpenLayers.Control.prototype.initialize.apply(this, [options]);
>         this.handler = new OpenLayers.Handler.Point(
>                 this,
>             {dblclick: this.reverseGeocode}
>         );
>        this.handler.activate();
>  }

You should use the click handler as opposed to the point handler. See
<http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Handler/Click-js.html>

Cheers,

--
Eric



More information about the Users mailing list