[OpenLayers-Users] Problem with calling default mouse down handler (2.4)

Pierre GIRAUD bluecarto at gmail.com
Fri May 18 02:15:42 EDT 2007


If you are currently using the 2.4 version I advice you to have a look
at examples/click.html
That way you'll be able to register a "click" event on the map and do
anything you with a callback.

However, you might prefer to have no default controls activated on the
map (http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#HowdoImakeanOpenLayersmapwithoutanycontrols)
and then create yours by creating a control that inherits from
OpenLayers.Control or extends it (examples/custom-controls.html).

I'm not sure this answers your questions but I hope this helps.

Regards

Pierre

On 5/18/07, Nick Whitelegg <nick at hogweed.org> wrote:
> Hello everyone,
>
> I want to override a mouse down event on a map. Previously (in 2.2) I used
> code such as:
>
>
>         function mouseDownHandler(e)
>         {
>
>             mouseIsDown = true;
>             map.controls[0].defaultMouseDown(e);
>             if(e.preventDefault)
>                 e.preventDefault();
>             return false;
>         }
>
> However, now (2.4, trunk SVN version) I get the error:
>
> Error: map.controls[0].defaultMouseDown is not a function
> Source File: http://www.free-map.org.uk/freemap/javascript/vector/init.js
> Line: 195
>
> What do I need to do now to call the default mouse down action?
>
> Thanks,
> Nick
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list