[OpenLayers-Users] How to access mouse modifier during "featureselected"

Christopher Schmidt crschmidt at metacarta.com
Wed Feb 10 08:04:49 EST 2010


On Wed, Feb 10, 2010 at 12:10:10PM +0100, Marcel Ruff wrote:
> Ivan Grcic schrieb:
> > Oh yes, as i see feature handler doesnt have same evt attribs as click
> > handler does... so you need to catch click handler of feature handler
> > somehow :|
> >   
> Yes, this is all I get, so no chance to detect which mouse button was 
> pressed:
> 
>   evt.element
>   evt.feature
>   evt.object
>   evt.type="featureselected"
> 
> If I use "click" I need to somehow compute myself which feature was hit ...
> 
> There is no simple solution available?

When you click, the browser doesn't *know* which feature was hit. So
no, there is not.

-- Chris

> Thanks
> Marcel
> > On Mon, Feb 8, 2010 at 7:46 AM, Max Weidemann <max.weidemann at freenet.de> wrote:
> >   
> >> Hello Marcel,
> >>
> >> Try this code too find out if it is a right click.
> >>
> >> if(((evt.which) && (evt.which == 3)) ||
> >>                ((evt.button) && (evt.button == 2))){
> >> //your Code
> >> }
> >>
> >> cheers
> >> Max
> >>     
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list