[OpenLayers-Users] right-click support ?

"R. Müller" r.mueller at unicomp-berlin.de
Wed Mar 19 12:35:48 EDT 2008


Christopher Schmidt schrieb:
> 
> Every other map that I'm aware of messes with the user's settings by
> making it such that right click does nothing. With that in mind, if an
> application wants to do something with the right click button, that's
> their business.
> 
> Regards,

imho this not a question of what other map-application do, but a
question of general look&feel of a (web-)application. have a look at
google-maps or google-docs, they make extensive use of right-click
context menus.

i'm not calling for detailed features for right-click events, but for
principal support. at the moment, you can register event-listeners for
mouse clicks e.g. this way :

map.events.register('click', map, function (e) { ... })

but this only listens to left-clicks :-(. there is no way for asking the
event, whether it is left or right-click. the right click doesn't
trigger this listener !

in many 'modern' browser it would be simple to do it.

preventing firefox from showing default context-menu as follows :

document.body.oncontextmenu=function()  { return false; }

after that, every mouse listener also receives the right-clicks.

(and yes, you're right, no right button - no right clicks [for the
mac-users])

of course you can write your own code or use other libraries. but
openlayers offers much basic functionality for such purposes, so why not
making it complete !?

and no, its not a request for the "all-in-one device suitable for every
purpose" (in germany we call it "eierlegende Wollmichsau"). i think its
an quite often requested use-case.


regards

ronald

-- 
*****************************************************************
*M-UniComp Verkehrssysteme GmbH
*
*Dipl.-Ing. Ronald Müller
*Softwareentwicklung
*
*Plauener Straße 163-165, Haus 11
*13053 Berlin
*
*fon   : +49 ( 0 ) 30  / 98 31 700 70
*fax   : +49 ( 0 ) 30  / 98 31 700 77
*mobil : +49 ( 0 ) 172 / 93 95 004
*email : r.mueller at unicomp-berlin.de
*web   : www.unicomp-berlin.de
*
*Geschaeftsfuehrer: Andreas Dreher
*Sitz der Gesellschaft: Berlin
*Registergericht: Berlin Amtsgericht Charlottenburg, HRB 35329
*****************************************************************



More information about the Users mailing list