How to display a webmap in Arcgis SDK for Qt

  arcgis, arcgis-runtime, c++

I’m using the ArcGis SDK in Qt Creator (C++). I’m attempting to launch a map, but I’m having trouble. The map I want to display comes from: https://hub.arcgis.com/datasets/mnrf::ontario-trail-network-otn-trail-segment. I read through the documentation for displaying a webmap, but I keep getting a blank map. I believe this is the webmap for the above link: https://hub.arcgis.com/maps/2532c1a6ac8540d6a44939478727a8e6.

void TrailsMapTest::setMapView(MapQuickView* mapView)
{
      std::string mapUrlString ="https://hub.arcgis.com/maps/2532c1a6ac8540d6a44939478727a8e6";
      const QString mapURL = QString::fromStdString(mapUrlString);
      const QUrl QMapURL(mapURL);
      Map* trailsMap = new Map(QMapURL);
      m_mapView = mapView;
      m_mapView->setMap(trailsMap);
      emit mapViewChanged();
}

This is the code I’m using. I modified the setMapView function that comes with the default ArcGis project. Whenever I try to run the project I just get a blank map and I can’t figure out why.

Source: Windows Questions C++

LEAVE A COMMENT