[OpenLayers-Users] Right Click support?

Kenny France kenny at xarex.com
Fri Oct 9 06:52:48 EDT 2009


Hi Guys

 

I know this topic has been discussed may a time but here we try again.....

 

The following code works in FF but not in IE

 

     //Right click support

          map.div.oncontextmenu = function noContextMenu(e) {

             if (OpenLayers.Event.isRightClick(e)){

                    alert("Right button click"); // Add the right click menu
here

              }

              return false; //cancel the right click of brower

          };

     //End right click

 

I get the following error:

Webpage error details

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
Trident/4.0;  Embedded Web Browser from: http://bsalsa.com/; SLCC2; .NET CLR
2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0;
InfoPath.2)

Timestamp: Fri, 9 Oct 2009 10:50:34 UTC

 

 

Message: 'which' is null or not an object

Line: 505

Char: 1108

Code: 0

URI: http://www.url.com/lib/SingleFileOpenLayers.js

 

Has anyone successfully got a right click to work in both ie & FF ??

All I need to do is alert the lat/lng on a right click

 

Thanks

 

Kenny

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091009/9e097009/attachment.html


More information about the Users mailing list