that&#39;s great. I want that :-). Could you tell me how you managed to &#39;properly<br>recongnize a right-click event in the MouseDefeaults.js file on mousedown&#39;?<br><br>
<div><span class="gmail_quote">On 2/21/07, <b class="gmail_sendername">Graham Davis</b> &lt;<a href="mailto:gdavis@refractions.net">gdavis@refractions.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Well, I seem to have found the answer to my own question, so I thought<br>I&#39;d email it to the list just in case anyone else needs to know how.
<br><br>Basically there is an oncontextmenu event for DOM objects.&nbsp;&nbsp;You can<br>assign this to a function and put any code you like in there, and then<br>return false at the end to ensure the event stops and doesn&#39;t display
<br>the browser&#39;s context menu.&nbsp;&nbsp;So I added this to my map object to disable<br>all browser context menus from appearing on the map like so:<br><br>map.div.oncontextmenu = function noContextMenu(e) {return false;};<br>
<br>Seems to work well in both IE and FF (haven&#39;t test Opera or on a Mac).<br><br>--<br>Graham Davis<br>Refractions Research Inc.<br><a href="mailto:gdavis@refractions.net">gdavis@refractions.net</a><br><br><br><br>Graham Davis wrote:
<br><br>&gt;I&#39;m trying to implement a right-click menu on my map, similar to what<br>&gt;you see here: <a href="http://maps.ask.com/maps">http://maps.ask.com/maps</a>.&nbsp;&nbsp;I&#39;ve been able to properly<br>&gt;recongnize a right-click event in the 
MouseDefeaults.js file on mousedown.<br>&gt;<br>&gt;My problem is that the browser&#39;s own right-click menu also appears, and<br>&gt;I need to disable or stop this.&nbsp;&nbsp;I&#39;ve tried stopping the event from<br>&gt;propagating in the mousedown function after my code (and in the mouseup
<br>&gt;function since that is when the browser menu seems to appear) however<br>&gt;this doesn&#39;t stop the browser menu from appearing.<br>&gt;<br>&gt;Has anyone been able to implement a right-click menu on their map that
<br>&gt;properly disables the browser&#39;s right-click menu?<br>&gt;<br>&gt;Also, this might be of importance, but I&#39;m using the vector branch of<br>&gt;code.&nbsp;&nbsp;I&#39;ve noticed that when not using a vector layer, the right-click
<br>&gt;menu on the map brings up the image menu as you have clicked on an image<br>&gt;in the map.&nbsp;&nbsp;When there is a vector layer overtop, right-clicking brings<br>&gt;up the standard browser menu where you can view source and whatnot, so
<br>&gt;the menus are different.&nbsp;&nbsp;However, I think any fix for this would work<br>&gt;for both (and I have been testing everything I try both with and without<br>&gt;a vector layer). So far nothing works.<br>&gt;<br>&gt;<br>
&gt;<br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Robert Buzink, website ontwerp en ontwikkeling<br>Sint-Pietersaalststraat 123<br>9000 Gent<br>+32 (0)9 33 00 267<br>+32 (0)487 548 414<br><a href="mailto:post@robertbuzink.nl">
post@robertbuzink.nl</a><br><a href="http://robertbuzink.nl/webdesign">robertbuzink.nl/webdesign</a>