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>
相关推荐
智航GIS8 小时前
ArcGIS大师之路500技---078补零
arcgis
DXM05211 天前
第8期| 传统机器学习遥感解译:SVM & 随机森林分类全流程实操
人工智能·python·随机森林·机器学习·支持向量机·arcgis·自然语言处理
非科班Java出身GISer2 天前
ArcGIS JS 基础教程(9):天空盒与大气效果
arcgis·arcgis js 天空盒·arcgis js 大气效果·arcgis js 大气层·arcgis 场景背景
智航GIS2 天前
ArcGIS大师之路500技---078文件数据库的加密与解密
数据库·arcgis
步十人3 天前
【Vue3】前置知识简单概述(包括ES6核心语法,模块化ESM以及npm基础)
arcgis·npm·vue·es6
Lucky_云佳3 天前
ArcMap-去除底图水印
经验分享·arcgis·arcmap·google earth
雪的季节4 天前
ARGIS制图效果展示
arcgis
谷谷地图下载器7 天前
全球、台湾省的无水印·街景数据(离线数据),专为可视化项目定制,支持国产化
javascript·c++·3d·arcgis·sqlite
树谷-胡老师8 天前
2019-2025年-全球0.1°-月度-近实时人为CO₂排放-数据
arcgis
非科班Java出身GISer8 天前
ArcGIS JS 基础教程(8):环境光照与阴影
arcgis·arcgis js 环境光照·arcgis js阴影·arcgis js 环境·arcgis js 光照