<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Visualizing WebMaps in QT aplication in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1070804#M4270</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/100101"&gt;@Tanner_Yould&lt;/a&gt;&amp;nbsp;, thank you so much for your help.&lt;/P&gt;&lt;P&gt;In both codes samples&amp;nbsp; that I posted&amp;nbsp; did call&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;m_mapView-&amp;gt;setMap(m_map)&amp;nbsp;&lt;/EM&gt; after the&amp;nbsp; &lt;EM&gt;m_map = new Map(portalItem,this);&lt;/EM&gt; line. I just didn't include it in the code sample (&lt;/SPAN&gt;&lt;SPAN&gt;sorry my bad&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried your code block but I keep having the same issue. The example WebMap of the tutorial works great, but if change the itemID for my MapaTestTimer id, it shows nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 01:12:05 GMT</pubDate>
    <dc:creator>TimerDeveloper</dc:creator>
    <dc:date>2021-06-22T01:12:05Z</dc:date>
    <item>
      <title>Visualizing WebMaps in QT aplication</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1069066#M4263</link>
      <description>&lt;P&gt;Hello Community!&lt;/P&gt;&lt;P&gt;I am new to QT and ArcGIS and I am having a hard time visualizing a WebMap on my main QT application.&lt;/P&gt;&lt;P&gt;I have tried the tutorial (&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/qt/maps-2d/tutorials/display-a-web-map/" target="_blank"&gt;https://developers.arcgis.com/qt/maps-2d/tutorials/display-a-web-map/&lt;/A&gt;&lt;/SPAN&gt;) 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.&lt;/P&gt;&lt;P&gt;Here is the code that I implemented:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;//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);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that the problem was related to the portal, so I tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Credential* ucPortal = new Credential("MyUsername","MyPassword", parent);
Portal* myPortal = new Portal(QUrl("https://timerdeveloper.maps.arcgis.com"), ucPortal, parent);
connect(myPortal, &amp;amp;Portal::doneLoading, this, [](Esri::ArcGISRuntime::Error loadError)
{
if (!loadError.isEmpty())
qDebug() &amp;lt;&amp;lt; loadError.message();
});
myPortal-&amp;gt;load();

PortalItem* portalItem = new PortalItem(myPortal, item_id, parent);
connect(portalItem, &amp;amp;PortalItem::doneLoading, this, [portalItem](){
qDebug() &amp;lt;&amp;lt; "Item title:" &amp;lt;&amp;lt; portalItem-&amp;gt;title();
});
portalItem-&amp;gt;load();


m_map = new Map(portalItem, this);&lt;/LI-CODE&gt;&lt;P&gt;And again it works, but only for the default itemID of the tutorial, not for my own itemID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been stuck on this for over a week so any help is welcome c:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using QT 5.12.10 with MSVC2015 and ArcGIS Runtime 100.8&lt;/P&gt;&lt;P&gt;I wasn't able to set my API Key because of the old runtime versión that I am using.&lt;/P&gt;&lt;P&gt;I am currently trying to set an OAuth 2.0 Autentication but it has been dificult.&lt;/P&gt;&lt;P&gt;The WebMap that I am trying to display is set to public so the autentication shouldn't be a problem (right?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I uploaded the files if you want to check them.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 19:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1069066#M4263</guid>
      <dc:creator>TimerDeveloper</dc:creator>
      <dc:date>2021-06-16T19:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Visualizing WebMaps in QT aplication</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1069177#M4264</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/438139"&gt;@TimerDeveloper&lt;/a&gt;, thanks for asking and I hope I can help! There are a couple of things going on here:&lt;BR /&gt;&lt;BR /&gt;I believe your web map item is actually hosted on your own portal &lt;A href="https://timerdeveloper.maps.arcgis.com/home/item.html?id=26c05778806b435283c9787079b96b51" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;(timerdeveloper.maps.arcgis.com), so your application is unable to find the web map at &lt;EM&gt;arcgis.com/sharing/rest/content/items&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;The web map you're connecting to is public, but the &lt;A href="http://arcgis.com/home/item.html?id=513cf2cfca4641daac73466f67c9a7dc" target="_self"&gt;basemap&lt;/A&gt; it uses requires an ArcGIS Developer account. You're providing credentials, so this isn't an issue, but it's worth noting.&lt;/P&gt;&lt;P&gt;However, the main issue here is that you're not calling m_mapView-&amp;gt;setMap(m_map)&amp;nbsp;&lt;EM&gt;after&lt;/EM&gt; the portal has loaded and your new map has been instantiated.&lt;BR /&gt;&lt;BR /&gt;Here's a simplified code block to demonstrate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Item id of MapaTestTIMER
QString itemId = "26c05778806b435283c9787079b96b51";

// Portal defaults to "arcgis.com" when no url is provided, and because "MapaTestTIMER" is hosted there, we do not need to provide a url.
Portal* portal = new Portal(new Credential("username", "password", this), this);

// This is the "MapaTestTIMER" web map
PortalItem* portalItem = new PortalItem(portal, itemId, this);

// We create a Map from the portal item
// Portal and PortalItem will automatically be loaded
m_map = new Map(portalItem, this);

// We set the MapView to use our new map
m_mapView-&amp;gt;setMap(m_map);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this works for you please let me know if I can do anything else to help!&lt;/P&gt;&lt;P&gt;Tanner Yould&lt;BR /&gt;ArcGIS Runtime API for Qt, Samples Engineer&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 00:24:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1069177#M4264</guid>
      <dc:creator>Tanner_Yould</dc:creator>
      <dc:date>2021-06-17T00:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Visualizing WebMaps in QT aplication</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1070804#M4270</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/100101"&gt;@Tanner_Yould&lt;/a&gt;&amp;nbsp;, thank you so much for your help.&lt;/P&gt;&lt;P&gt;In both codes samples&amp;nbsp; that I posted&amp;nbsp; did call&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;m_mapView-&amp;gt;setMap(m_map)&amp;nbsp;&lt;/EM&gt; after the&amp;nbsp; &lt;EM&gt;m_map = new Map(portalItem,this);&lt;/EM&gt; line. I just didn't include it in the code sample (&lt;/SPAN&gt;&lt;SPAN&gt;sorry my bad&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried your code block but I keep having the same issue. The example WebMap of the tutorial works great, but if change the itemID for my MapaTestTimer id, it shows nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 01:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1070804#M4270</guid>
      <dc:creator>TimerDeveloper</dc:creator>
      <dc:date>2021-06-22T01:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Visualizing WebMaps in QT aplication</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1181130#M4593</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/438139"&gt;@TimerDeveloper&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Did you ever figure this out? I am having the same problem.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 15:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/visualizing-webmaps-in-qt-aplication/m-p/1181130#M4593</guid>
      <dc:creator>PJ9987</dc:creator>
      <dc:date>2022-06-08T15:55:24Z</dc:date>
    </item>
  </channel>
</rss>

