<?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: How to use an ItemResourceCache object with the ArcGISVectorTiledLayer constructor for an offline VTPK in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1503569#M5273</link>
    <description>&lt;P&gt;Hi Lucas,&lt;/P&gt;&lt;P&gt;Thank you for the response.&amp;nbsp; I'm just seeing if I can upload the vtpk file (+50GB!) now.&amp;nbsp; I do have a concern that due to the recent changes to subscriptions, user types, etc. I will not be able to do this sort of operation for long without revising the subscription but I will reach out to my ESRI UK Customer Success Manager about that.&lt;/P&gt;&lt;P&gt;I did find a post on the .NET SDK forum that talked about putting a resources.zip file somewhere and referencing the folder to create the item resource cache and I had managed to hack together such a file and see it having an effect, but your information gives us a way to create styles with the online editor which should be easier than editing a big JSON file in notepad.&lt;/P&gt;&lt;P&gt;Once I've finished giving this a go, if successful I'll accept your information as the solution.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 14:16:26 GMT</pubDate>
    <dc:creator>LeeCarter</dc:creator>
    <dc:date>2024-07-10T14:16:26Z</dc:date>
    <item>
      <title>How to use an ItemResourceCache object with the ArcGISVectorTiledLayer constructor for an offline VTPK</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1500228#M5269</link>
      <description>&lt;P&gt;We have a ArcGIS Maps SDK for Qt (C++ not QML) based application that has an offline vector tile package basemap layer constructed as shown below before then being appended to the basemap layers:&lt;/P&gt;&lt;PRE&gt;ArcGISVectorTiledLayer* basemapLayer_p = new ArcGISVectorTiledLayer(new VectorTileCache(vectorBasemapFilename, this), this);&lt;/PRE&gt;&lt;P&gt;Where&amp;nbsp; "vectorBasemapFilename" is the location/filename on disk of the vtpk file.&lt;/P&gt;&lt;P&gt;This works fine, but we would like to style the map differently in certain situations, for example to be able to support application having light and dark display modes.&lt;/P&gt;&lt;P&gt;I know the vtpk file is just an archive and within it is a file&amp;nbsp;(2MB of JSON format data?) that contains the styling information used by default with the vtpk.&amp;nbsp; Our vtpk file is large (over 50GB) so I don't want to duplicate that in order to have a different styling applied.&lt;/P&gt;&lt;P&gt;I believe that I should be able to create the&amp;nbsp;ArcGISVectorTiledLayer using a different constructor that would allow a different styling to be applied to that layer:&lt;/P&gt;&lt;PRE&gt;ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, Esri::ArcGISRuntime::ItemResourceCache *itemResourceCache, QObject *parent = nullptr)&lt;/PRE&gt;&lt;P&gt;Where the "ItemResourceCache*" argument would be constructed using the path to a disk file, similar how we make the VectorTileCache already:&lt;/P&gt;&lt;PRE&gt;ItemResourceCache::ItemResourceCache(const QString &amp;amp;path, QObject *parent = nullptr)&lt;/PRE&gt;&lt;P&gt;I cannot find any examples of ItemResourceCache being used or details of what the file referenced by the "path" argument to the constructor should contain and how to create the file.&lt;/P&gt;&lt;P&gt;I would be grateful if anyone can direct me to or provide information on what the local file needed to populate an ItemResourceCache object should be/contain and how to make one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is using the online style editor an option and if so how and does that result in a style that will want/try to access the Internet resources when used (which would be unacceptable as our application has no Internet access when in use).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 10:12:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1500228#M5269</guid>
      <dc:creator>LeeCarter</dc:creator>
      <dc:date>2024-07-02T10:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an ItemResourceCache object with the ArcGISVectorTiledLayer constructor for an offline VTPK</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1503195#M5272</link>
      <description>&lt;P class=""&gt;Good question. I had to do a little digging on this one... Currently, the only way to create custom item resource caches is through portal items, so a workflow such as the following should get you on the right track. I tested it and was successful:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Publish your vtpk as a service. I used ArcGIS Online and uploaded as a hosted service, but you could publish to enterprise. Make sure to enable offline export capabilities&lt;/LI&gt;&lt;LI&gt;Use the vector tile style editor to make edits to the style. They've got some good tutorials to showcase how you can edit the style. Save your edits as a new item&lt;/LI&gt;&lt;LI&gt;Using the newly created item, call the ExportVectorTileTask:: exportStyleResourceCache to export the resource cache - &lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-exportvectortilestask.html#exportStyleResourceCache" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-exportvectortilestask.html#exportStyleResourceCache&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Export how every many resource caches you want and place them next to your VTPK. The resource cache will be a folder with a json file and a zip.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-09 at 1.30.31 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/109231i8CEA3783BEC8EEBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-07-09 at 1.30.31 PM.png" alt="Screenshot 2024-07-09 at 1.30.31 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Construct your local vector tile layer using the vector tile cache and the new item resource cache&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;VectorTileCache* vtc = new VectorTileCache("/Users/&amp;lt;username&amp;gt;/Desktop/nz_bndl.vtpk", this);

ItemResourceCache* irc = new ItemResourceCache("/Users/&amp;lt;username&amp;gt;/Desktop/nz_bndl_resourcecache1", this);

ArcGISVectorTiledLayer* lyr = new ArcGISVectorTiledLayer(vtc, irc, this);

Basemap* bmap = new Basemap(lyr, this);
m_map = new Map(bmap, this);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:02:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1503195#M5272</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2024-07-09T19:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an ItemResourceCache object with the ArcGISVectorTiledLayer constructor for an offline VTPK</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1503569#M5273</link>
      <description>&lt;P&gt;Hi Lucas,&lt;/P&gt;&lt;P&gt;Thank you for the response.&amp;nbsp; I'm just seeing if I can upload the vtpk file (+50GB!) now.&amp;nbsp; I do have a concern that due to the recent changes to subscriptions, user types, etc. I will not be able to do this sort of operation for long without revising the subscription but I will reach out to my ESRI UK Customer Success Manager about that.&lt;/P&gt;&lt;P&gt;I did find a post on the .NET SDK forum that talked about putting a resources.zip file somewhere and referencing the folder to create the item resource cache and I had managed to hack together such a file and see it having an effect, but your information gives us a way to create styles with the online editor which should be easier than editing a big JSON file in notepad.&lt;/P&gt;&lt;P&gt;Once I've finished giving this a go, if successful I'll accept your information as the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 14:16:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-use-an-itemresourcecache-object-with-the/m-p/1503569#M5273</guid>
      <dc:creator>LeeCarter</dc:creator>
      <dc:date>2024-07-10T14:16:26Z</dc:date>
    </item>
  </channel>
</rss>

