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

Pierre GIRAUD bluecarto at gmail.com
Fri May 18 02:37:51 EDT 2007


I'm sorry, I think I answered too quickly.
Having a look at your code, and in the OpenLayers one, I found that
the defaultMouseDown method still exists for some controls. In your
current implementation (http://www.free-map.org.uk/freemap/), with
firebug you can test "map.controls[0].defaultMouseDown()" and that
works.
But, you have to notice that not all controls implement the
defaultMouseDown method (for example permalink). Probably in your case
the map first control doesn't.

Can you explain more precisely what behavior you want to handle with this ?

Regards

On 5/18/07, Pierre GIRAUD <bluecarto at gmail.com> wrote:
> 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