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() {}
相关推荐
爱上妖精的尾巴31 分钟前
6-4 WPS JS宏 不重复随机取值应用
开发语言·前端·javascript
小鸡吃米…2 小时前
Python 列表
开发语言·python
kaikaile19952 小时前
基于C#实现一维码和二维码打印程序
开发语言·c#
我不是程序猿儿3 小时前
【C#】画图控件的FormsPlot中的Refresh功能调用消耗时间不一致缘由
开发语言·c#
rit84324993 小时前
C# Socket 聊天室(含文件传输)
服务器·开发语言·c#
嘉琪0013 小时前
Vue3+JS 高级前端面试题
开发语言·前端·javascript
xunyan62343 小时前
面向对象(下)-接口的理解
java·开发语言
遥不可及~~斌3 小时前
Java 面试题集 -- 001
java·开发语言
2501_921649493 小时前
如何获取美股实时行情:Python 量化交易指南
开发语言·后端·python·websocket·金融
集智飞行4 小时前
c++函数传参的几种推荐方式
开发语言·c++