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() {}
相关推荐
y = xⁿ21 分钟前
【Java八股锁机制的认识】synchronized和reentrantlock区分,锁升级机制
java·开发语言·后端
Fruit_Caller21 分钟前
GmSSL 编译与 Qt 项目集成问题排查记录(-lssl-1_1-x64 -lcrypto-1_1-x64)
开发语言·qt
free-elcmacom22 分钟前
C++三种参数传递方式:从交换函数看值、指针与引用的区别
开发语言·c++
bubiyoushang88824 分钟前
基于PSO的列车速度优化MATLAB实现
开发语言·人工智能·matlab
AAIshangyanxiu31 分钟前
基于ArcGIS、InVEST与RUSLE水土流失模拟及分析
arcgis·土壤侵蚀·invest·水土流失·rusle
曹牧34 分钟前
C#:线程中实现延时等待
开发语言·c#
蜜獾云38 分钟前
java 异步编程
java·开发语言
xin^_^40 分钟前
java基础学习
java·开发语言·python
坐吃山猪43 分钟前
Tree-sitter语法树解析
开发语言·python·tree-sitter
清水白石0081 小时前
《解锁 Python 潜能:从内存模型看可变与不可变对象,及其实战最佳实践》
大数据·开发语言·python