[OpenLayers-Users] Right-click menu

Graham Davis gdavis at refractions.net
Wed Feb 21 14:57:41 EST 2007


I'm trying to implement a right-click menu on my map, similar to what 
you see here: http://maps.ask.com/maps.  I've been able to properly 
recongnize a right-click event in the MouseDefeaults.js file on mousedown.

My problem is that the browser's own right-click menu also appears, and 
I need to disable or stop this.  I've tried stopping the event from 
propagating in the mousedown function after my code (and in the mouseup 
function since that is when the browser menu seems to appear) however 
this doesn't stop the browser menu from appearing.

Has anyone been able to implement a right-click menu on their map that 
properly disables the browser's right-click menu?

Also, this might be of importance, but I'm using the vector branch of 
code.  I've noticed that when not using a vector layer, the right-click 
menu on the map brings up the image menu as you have clicked on an image 
in the map.  When there is a vector layer overtop, right-clicking brings 
up the standard browser menu where you can view source and whatnot, so 
the menus are different.  However, I think any fix for this would work 
for both (and I have been testing everything I try both with and without 
a vector layer). So far nothing works.

-- 
Graham Davis
Refractions Research Inc.
gdavis at refractions.net




More information about the Users mailing list