Select to view content in your preferred language

Change default right-click context menu on <esri:Map/>

2604
2
04-28-2010 09:44 AM
ErikEndrulat
Regular Contributor
I'm developing an Adobe Air map application. Due to security requirements, it's crucial that the application does not provide the ability to open a browser window via any menus, etc.

I just noticed that when you right-click on the map object, the context menu includes 'About ArcGIS for Flex', which opens up another window that has a link to the ESRI API site.

Is there any way to over ride this behavior?

Thanks
Tags (2)
0 Kudos
2 Replies
ErikEndrulat
Regular Contributor
I think I just resolved my own question, perhaps not the most elegant solution, but it works:
to the <esri:Map> </> code block, I added:
[INDENT]rightMouseDown="{Alert.show('right click disabled')}"[/INDENT]



I'm developing an Adobe Air map application. Due to security requirements, it's crucial that the application does not provide the ability to open a browser window via any menus, etc.

I just noticed that when you right-click on the map object, the context menu includes 'About ArcGIS for Flex', which opens up another window that has a link to the ESRI API site.

Is there any way to over ride this behavior?

Thanks
0 Kudos
PrashanthSukumaran
Emerging Contributor
You can also do this. Just in case you want to add custom menu items to the map. disabling right click will not work.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application
  creationComplete="onCreationComplete()" 
  xmlns:mx=http://www.adobe.com/2006/mxml
  xmlns:esri=http://www.esri.com/2008/ags>
   <mx:Script>


   <![CDATA[

[INDENT]
[LEFT]   privatefunction onCreationComplete() : void

   {
     var contextMenu:ContextMenu = new ContextMenu();
     contextMenu.hideBuiltInItems();
     myMap.contextMenu = contextMenu;
     contextMenu.customItems.push(new ContextMenuItem("Custom Menu Item",true));
   }


[/LEFT]
[/INDENT]   ]]>

   </mx:Script>
 <esri:Map id="myMap" width="100%">
     <esri:ArcGISTiledMapServiceLayer

 
url="

http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer" />

 

 </esri:Map>

 

</mx:Application>

 
 
 
0 Kudos