QT 5.15.2 开发地图ArcGIS 100.15.6(ArcGIS Runtime SDK for Qt)

  • QT 5.15.2
  • ArcGIS下载

Downloads | ArcGIS Runtime API for Qt | Esri Developer

  • ArcGIS安装(略)
  • 参考

Display a map | ArcGIS Maps SDK for Qt | Esri Developer

  • QT新建工程

步骤1

步骤2

步骤3

步骤4(选择Topographic不需要KEY)

步骤5(必须是MSVC2019 64bit!)

步骤6

  • 清理文件

QT新建ArcGIS工程,编译报错:\BookmarkListModel.h:100: error: C2039: "in": 不是 "Esri::ArcGISRuntime" 的成员-CSDN博客

  • 下载测试地图数据

https://download.csdn.net/download/quantum7/90369309

  • 修改代码

打开文件,修改参考如下:

复制代码
// Other headers
#include "ArcGISMapDemo.h"

#include "Map.h"
#include "MapGraphicsView.h"
#include "TileCache.h"
#include "ArcGISTiledLayer.h"

#define TPK_FILE "D:\\SVN-WORK\\SourceCode\\ResearchWork\\ArcGISMapDemo\\map-tpk-for-test\\gis.tpk"

using namespace Esri::ArcGISRuntime;

ArcGISMapDemo::ArcGISMapDemo(QWidget *parent /*=nullptr*/)
    : QMainWindow(parent)
{
    // Create a map using the ArcGISTopographic BasemapStyle
    //m_map = new Map(BasemapStyle::ArcGISTopographic, this);

    TileCache* tileCache = new TileCache(TPK_FILE, this);
    ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(tileCache, this);
    Basemap* basemap = new Basemap(tiledLayer, this);
    m_map = new Map(basemap, this);

    // Create the Widget view
    m_mapView = new MapGraphicsView(this);
    // Set map to map view
    m_mapView->setMap(m_map);

    // set the mapView as the central widget
    setCentralWidget(m_mapView);
}

// destructor
ArcGISMapDemo::~ArcGISMapDemo() {}
相关推荐
阿珊和她的猫14 分钟前
autofit.js: 自动调整HTML元素大小的JavaScript库
开发语言·javascript·html
喜欢吃燃面33 分钟前
C++算法竞赛:位运算
开发语言·c++·学习·算法
草莓熊Lotso37 分钟前
《详解 C++ Date 类的设计与实现:从运算符重载到功能测试》
开发语言·c++·经验分享·笔记·其他
谱写秋天44 分钟前
Qt 5.5 的安装与配置(使用 VSCode编辑)
开发语言·vscode·qt
项目申报小狂人1 小时前
算法应用上新!自适应更新策略差分进化算法求解球形多飞行器路径规划问题,附完整MATLAB代码
开发语言·算法·matlab
阿珊和她的猫5 小时前
v-scale-scree: 根据屏幕尺寸缩放内容
开发语言·前端·javascript
fouryears_234177 小时前
Flutter InheritedWidget 详解:从生命周期到数据流动的完整解析
开发语言·flutter·客户端·dart
我好喜欢你~8 小时前
C#---StopWatch类
开发语言·c#
lifallen9 小时前
Java Stream sort算子实现:SortedOps
java·开发语言