符号不显示在ArcGIS地图上使用Qt

Symbol does not show up on ArcGIS Map using Qt

本文关键字:Qt 地图 ArcGIS 显示 符号      更新时间:2023-10-16

我与ArcGIS api一起使用Qt,我想使用MessageHelper类显示军事符号。下面是我的代码:

m_map = new EsriRuntimeQt::Map(this);
m_mapGraphicsView = EsriRuntimeQt::MapGraphicsView::create(m_map, this);
setCentralWidget(m_mapGraphicsView);
m_map->setWrapAroundEnabled(false);
QString path = EsriRuntimeQt::ArcGISRuntime::installDirectory();
path.append("/sdk/samples/data");
QDir dataDir(path); // using QDir to convert to correct file separator
QString pathSampleData = dataDir.path() + QDir::separator();
// ArcGIS Online Tiled Basemap Layer
m_tiledServiceLayer = new EsriRuntimeQt::ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer", this);
m_map->addLayer(m_tiledServiceLayer);
// test message processing
m_msgGroupLayer = new EsriRuntimeQt::MessageGroupLayer(EsriRuntimeQt::SymbolDictionaryType::Mil2525C);
m_map->addLayer(m_msgGroupLayer);
// build message 
EsriRuntimeQt::Point pt(0, 0, m_map->spatialReference());
QList<EsriRuntimeQt::Point> controlPoints;
controlPoints.push_back(pt);
EsriRuntimeQt::Message msg = EsriRuntimeQt::MessageHelper::createUpdateMessage(EsriRuntimeQt::SymbolDictionaryType::App6B, "1", "position_report", controlPoints);
// process the message
m_msgGroupLayer->messageProcessor()->processMessage(msg);

我只看到地图,没有看到符号。我使用的是Qt-Creator 5.7和ArcGIS sdk 10.2.6。是我遗漏了什么,还是我的点定义有问题?我希望这个符号在世界地图的中间看到,因为我使用默认的空间参考,但我没有看到任何东西。

层和消息使用2种不同的符号字典类型-层是用Mil2525C创建的,消息是用App6B创建的。