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() {}
相关推荐
_extraordinary_35 分钟前
Java SpringMVC(二) --- 响应,综合性练习
java·开发语言
Larry_Yanan2 小时前
QML学习笔记(三十四)QML的GroupBox、RadioButton
c++·笔记·qt·学习·ui
@。1242 小时前
对于灰度发布(金丝雀发布)的了解
开发语言·前端
hsjkdhs3 小时前
C++之多层继承、多源继承、菱形继承
开发语言·c++·算法
Full Stack Developme3 小时前
Python Redis 教程
开发语言·redis·python
qq_4924484463 小时前
Jmeter设置负载阶梯式压测场景(详解教程)
开发语言·python·jmeter
ID_180079054734 小时前
京东获取整站实时商品详情数据|商品标题|数据分析提取教程
java·开发语言
ajassi20004 小时前
开源 C++ QT QML 开发(十七)进程--LocalSocket
c++·qt·开源
qiuiuiu4135 小时前
正点原子RK3568学习日志-编译第一个驱动程序helloworld
linux·c语言·开发语言·单片机
molong9315 小时前
Kotlin 内联函数、高阶函数、扩展函数
android·开发语言·kotlin