Extent the default context menu of MapView

463
5
10-23-2019 05:20 AM
TomGeo
by
Occasional Contributor III

I would like to build an AddIn that, once installed extents the context menu of MapViews. Meaning whenever the user is creating a MapView and does subsequently a right click on the map then there should be an item in it that does something when clicked on.

Is that possible, and if so do the community samples contain an example for it? I could not find one concerning the MapView/ Map.

Bests Thomas

-------------------------
“GIS is a form of digital mapping technology. Kind of like Google Earth, but better.” ~ Arnold Schwarzenegger
Tags (2)
0 Kudos
5 Replies
NarelleChedzey
Esri Contributor

Thomas, 

take a look at this sample

arcgis-pro-sdk-community-samples/Framework/InsertIntoContextMenu at master · Esri/arcgis-pro-sdk-com... 

The config.daml file illustrates how to update an existing context menu.  Look at the <updateModule> section

You will need to find the correct daml-ID for the menu you are interested in modifying.  

TomGeo
by
Occasional Contributor III

Narelle,

thanks for the link. The particular example I found, and I also went through the DAML Ids, looking for something like mapview or mapviewcomponent but ‘nada’. Hence my question if it is possible and the mapview maybe not accessible. I might also be wrong and the mapview is not the component the context menu belongs to.

-------------------------
“GIS is a form of digital mapping technology. Kind of like Google Earth, but better.” ~ Arnold Schwarzenegger
0 Kudos
JohnJones
Esri Contributor

Try esri_mapping_selection2DContextMenu & esri_mapping_selection3DContextMenu for 2D & 3D map views respectively... see... 

arcgis-pro-sdk/Editing.daml.xml at master · Esri/arcgis-pro-sdk · GitHub 

for example DAML changes (search for this menu)

TomGeo
by
Occasional Contributor III

John,

your references certainly helped. However, this requires that there is an object that is selected. Is there a refId to add to the context menu that you get when using the 'explore tool'?

Edit: I found it! It's the 'esri_mapping_popupToolContextMenu'

-------------------------
“GIS is a form of digital mapping technology. Kind of like Google Earth, but better.” ~ Arnold Schwarzenegger
NarelleChedzey
Esri Contributor

Thomas, 

That particular context menu is defined by esri_mapping_popupToolContextMenu

It can be found in the mapping daml file

arcgis-pro-sdk/ADMapping.daml.xml at master · Esri/arcgis-pro-sdk · GitHub