<?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: Setting additional queryString on Tile Service in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/setting-additional-querystring-on-tile-service/m-p/1131213#M5669</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546512"&gt;@NelsonC&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You can call &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/WmtsLayer.html#getCustomParameters()" target="_self"&gt;&lt;STRONG&gt;getCustomParameters()&lt;/STRONG&gt;&lt;/A&gt; on your WmtsLayer, which gives you a modifiable&amp;nbsp;&lt;STRONG&gt;Map&lt;/STRONG&gt; of &lt;STRONG&gt;Strings&lt;/STRONG&gt; that will allow you to set the "key" custom parameter. In other words, leave the URL without the &lt;EM&gt;?key&lt;/EM&gt; part and add a "key" to the Map.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 15:29:55 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2022-01-06T15:29:55Z</dc:date>
    <item>
      <title>Setting additional queryString on Tile Service</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/setting-additional-querystring-on-tile-service/m-p/1127077#M5666</link>
      <description>&lt;P&gt;My provider implemented additional authentication to Tile Services by adding an additional queryString parameter, such that each web request will need to be made with &lt;FONT face="courier new,courier"&gt;?key=*******&lt;/FONT&gt;&amp;nbsp; (see example &lt;A href="https://api.portal.hkmapservice.gov.hk/apiref" target="_self"&gt;here&lt;/A&gt;). I am currently unable to use this service in the Android SDK, since I do not believe the Classes expose a way to modify the request url directly.&lt;/P&gt;&lt;P&gt;For example, for WmtsLayer I initialize it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val wtmsBaseMap = WmtsLayer(
    "https://api.hkmapservice.gov.hk/ogc/wmts/basemap/WGS84/1.0.0/WMTSCapabilities.xml?key=***********",
    "MapAPI_HKBasemapService",
)

val basemap = Basemap(wtmsBaseMap)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This allows me to obtain the Capabilities configuration, but all the subsequent tile requests fail with 401 as they do not use the queryString &lt;FONT face="courier new,courier"&gt;?key=******&lt;/FONT&gt; .&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;WebTiledLayer&lt;/FONT&gt; is the exception as it seems to work as it directly takes the url input from the constructor. But obviously it suffers from many drawbacks such as lack of caching and configuration options. Ideally I would want other services to work as well.&lt;/P&gt;&lt;P&gt;Is there any way for me to implement this myself, or if not can support for custom queryStrings be added?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 06:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/setting-additional-querystring-on-tile-service/m-p/1127077#M5666</guid>
      <dc:creator>NelsonC</dc:creator>
      <dc:date>2021-12-18T06:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Setting additional queryString on Tile Service</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/setting-additional-querystring-on-tile-service/m-p/1131213#M5669</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546512"&gt;@NelsonC&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You can call &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/WmtsLayer.html#getCustomParameters()" target="_self"&gt;&lt;STRONG&gt;getCustomParameters()&lt;/STRONG&gt;&lt;/A&gt; on your WmtsLayer, which gives you a modifiable&amp;nbsp;&lt;STRONG&gt;Map&lt;/STRONG&gt; of &lt;STRONG&gt;Strings&lt;/STRONG&gt; that will allow you to set the "key" custom parameter. In other words, leave the URL without the &lt;EM&gt;?key&lt;/EM&gt; part and add a "key" to the Map.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 15:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/setting-additional-querystring-on-tile-service/m-p/1131213#M5669</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2022-01-06T15:29:55Z</dc:date>
    </item>
  </channel>
</rss>

