ARCGIS PRO SDK 创建右键菜单

ArcGIS Pro SDK中的弹出式右键菜单常见的在地图视图、布局视图、文件目录等地方,随便右键点击某个文件、要素、要素类,一般都会弹出一个右键菜单。

|------------|-------------------------------------------|
| 操作对象 | 右键菜单 refID |
| 要素图层 | esri_mapping_layerContextMenu |
| shp图层 | esri_mapping_unregisteredLayerContextMenu |
| 图层组 | esri_mapping_groupLayerContextMenu |
| 独立表 | esri_mapping_standaloneTableContextMenu |
| 地图内容目录 | esri_mapping_mapContextMenu |
| 地图视图框内选择要素 | esri_mapping_selection2DContextMenu |

Config.daml中添加右键菜单

<controls>

插入一下内容

</controls>

复制代码
 <controls>
        <button id="MenuList_TestButton" caption="右键菜单" className="TestButton3" loadOnClick="true" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue32.png">
          <tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>
        </button>
 </controls>

输入<updateModule>模块,代码如下

在</insertModule>下面

插入一下内容

复制代码
 </insertModule>
    <!--更新系统自带的工具菜单、工具栏等-->
    <updateModule refID="esri_mapping">
      <menus>
        <!--图层的右键菜单-->
        <updateMenu refID="esri_mapping_layerContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
        <!--图层组的右键菜单-->
        <updateMenu refID="esri_mapping_groupLayerContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
        <!--独立表的右键菜单-->
        <updateMenu refID="esri_mapping_standaloneTableContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
        <!--栅格图层的右键菜单-->
        <updateMenu refID="esri_mapping_rasterLayerContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
        <!--地图列表的右键菜单-->
        <updateMenu refID="esri_mapping_mapContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
        <!--地图视图内的右键菜单-->
        <updateMenu refID="esri_mapping_selection2DContextMenu">
          <insertButton refID="MenuList_TestButton" />
        </updateMenu>
      </menus>
    </updateModule>
相关推荐
weixin_贾7 小时前
AI辅助下基于ArcGIS Pro的SWAT模型全流程高效建模实践与深度进阶应用
arcgis·swat模型·面源污染
xa1385086912 小时前
ARCGIS PRO SDK ProWindow自定义窗口DataGrid控件的应用
arcgis
赵钰老师2 天前
【Nature顶刊级科研绘图】DeepSeek、ChatGPT等大语言模型绘图(如何画图、如何标注、如何改图、如何美化、如何组合、如何排序)
人工智能·arcgis·信息可视化·语言模型·r语言
GISBox5 天前
PLY格式文件如何转换成3DTiles格式——使用GISBox软件实现高效转换
arcgis·信息可视化·node.js·gis·webgl·cesium
啊喔啊喔R6 天前
arcgispro加载在线地图
arcgis
树谷-胡老师6 天前
用ArcGIS做一张符合环评要求的植被类型图
arcgis
称昵写填未7 天前
基于ArcGIS和ETOPO-2022 DEM数据分层绘制全球海陆分布
人工智能·经验分享·arcgis·dem
疯狂学习GIS7 天前
用Adobe Illustrator编辑ArcGIS地图的方法
arcgis·gis·学术工作效率
敲敲敲-敲代码9 天前
【ArcGIS】ArcGIS10.8安装过程(失败记录)
arcgis