Hello Community!
I am new to QT and ArcGIS and I am having a hard time visualizing a WebMap on my main QT application.
I have tried the tutorial (https://developers.arcgis.com/qt/maps-2d/tutorials/display-a-web-map/) and it works, but only for the default webMap of the tutorial, if I change the itemID for my own test web map ID, the widget shows nothing.
Here is the code that I implemented:
//Default itemID ArcGIS WebMap
// const QString item_id("41281c51f9de45edaf1c8ed44bb10e30");
// My public WebMap
const QString item_id("26c05778806b435283c9787079b96b51");
const QUrl portal_url(QString("https://arcgis.com/sharing/rest/content/items/" + item_id));
m_map = new Map(portal_url, this);
I thought that the problem was related to the portal, so I tried this:
Credential* ucPortal = new Credential("MyUsername","MyPassword", parent);
Portal* myPortal = new Portal(QUrl("https://timerdeveloper.maps.arcgis.com"), ucPortal, parent);
connect(myPortal, &Portal::doneLoading, this, [](Esri::ArcGISRuntime::Error loadError)
{
if (!loadError.isEmpty())
qDebug() << loadError.message();
});
myPortal->load();
PortalItem* portalItem = new PortalItem(myPortal, item_id, parent);
connect(portalItem, &PortalItem::doneLoading, this, [portalItem](){
qDebug() << "Item title:" << portalItem->title();
});
portalItem->load();
m_map = new Map(portalItem, this);
And again it works, but only for the default itemID of the tutorial, not for my own itemID.
I have been stuck on this for over a week so any help is welcome c:
I am using QT 5.12.10 with MSVC2015 and ArcGIS Runtime 100.8
I wasn't able to set my API Key because of the old runtime versión that I am using.
I am currently trying to set an OAuth 2.0 Autentication but it has been dificult.
The WebMap that I am trying to display is set to public so the autentication shouldn't be a problem (right?)
I uploaded the files if you want to check them.