<?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: problem with displaying vector and tiles layers in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646964#M584</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I took a look with the Swift SDK and it looks like your server is rejecting requests coming from the Native SDKs because of the &lt;STRONG&gt;User-Agent&lt;/STRONG&gt; header. Not seen that before, but I reproduced this in Postman too.&lt;/P&gt;&lt;P&gt;The Native SDKs add a User-Agent string to all requests. In my Swift SDK test app, the string is this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;User-Agent: ArcGISMaps-Swift/200.7 (iOS 18.5; iPhone17,1,Simulator; devmode) com.esri.tutorial.Display-a-web-map/1.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It'll be something similar for the Kotlin SDK.&lt;/P&gt;&lt;P&gt;To open the layer, the SDKs will make a couple of metadata requests:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;A href="https://geoportal.ancpi.ro/hosted_services/rest/info?f=json" target="_blank"&gt;https://geoportal.ancpi.ro/hosted_services/rest/info?f=json&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer?f=json" target="_blank"&gt;https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer?f=json&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I make Postman GET requests to either of those URLs with no User-Agent header, I get valid JSON responses. But as soon as I add a User-Agent header like the one above, I get an HTML error response and the VectorTileLayer will fail to load with a "forbidden" error.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you check with your server admin and see if there's configuration on the server that could be rejecting these User-Agent Native SDK headers?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For reference, here's some sample output I get from the Swift SDK's &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/consolenetworklogger" target="_self"&gt;ConsoleNetworkLogger&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Request sent: 
	URL: https://geoportal.ancpi.ro/hosted_services/rest/info?f=json
	Method: GET
	Request headers: User-Agent: ArcGISMaps-Swift/200.7 (iOS 18.5; iPhone17,1,Simulator; devmode) com.esri.tutorial.Display-a-web-map/1.0
Request completed: 
	URL: https://geoportal.ancpi.ro/hosted_services/rest/info?f=json
	Method: GET
	Data: &amp;lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&amp;gt;
&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;403 Forbidden&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Forbidden&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;You don't have permission to access /hosted_services/rest/info
on this server.&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;

	Response headers: Connection: Keep-Alive, Content-Length: 227, Content-Type: text/html; charset=iso-8859-1, Date: Fri, 29 Aug 2025 19:10:26 GMT, Keep-Alive: timeout=5, max=100, Server: Apache, X-Content-Type-Options: nosniff&lt;/LI-CODE&gt;&lt;P&gt;To start to figure these things out, you can check the &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps/-loadable/index.html" target="_self"&gt;loadStatus&lt;/A&gt; on the VectorTileLayer or Map.&lt;/P&gt;&lt;P&gt;I then used the ConsoleNetworkLogger to see the requests being made that were getting a loadStatus error, dug into the them a bit, and figured the only difference between a browser and the SDK might be the User-Agent string.&lt;/P&gt;&lt;P&gt;I'm not familiar enough with Kotlin to recommend how to track requests like I can with the Swift ConsoleNetworkLogger, so I'll let someone on the Kotlin team pipe up if they have recommendations.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Aug 2025 19:37:44 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2025-08-29T19:37:44Z</dc:date>
    <item>
      <title>problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646823#M582</link>
      <description>&lt;LI-CODE lang="kotlin"&gt;val webTiledLayer = WebTiledLayer.create(urlTemplate = "https://geoportal.ancpi.ro/maps/rest/services/Ortofoto/Mozaic_vt/MapServer/tile/tile/{level}/{row}/{col}?blankTile=false")

val vectorTileLayer = ArcGISVectorTiledLayer("https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer")

val vectorTileLayerBase = ArcGISVectorTiledLayer("https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer/tile/0/0/0.pbf")

arcGISMap = ArcGISMap(SpatialReference(3844)).apply {
                        operationalLayers.add(webTiledLayer)
                        operationalLayers.add(vectorTileLayerBase)
                    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to display some layers from ANCPI. I've already tried the following three:&lt;/P&gt;&lt;P&gt;Unfortunately, it doesn't work. Is it because of the spatial reference?&lt;/P&gt;&lt;P&gt;What else could I try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 14:25:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646823#M582</guid>
      <dc:creator>woodie</dc:creator>
      <dc:date>2025-08-29T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646825#M583</link>
      <description>&lt;P&gt;here you can see the layers working: &lt;A href="https://geoportal.ancpi.ro/imobile.html" target="_blank"&gt;https://geoportal.ancpi.ro/imobile.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 14:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646825#M583</guid>
      <dc:creator>woodie</dc:creator>
      <dc:date>2025-08-29T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646964#M584</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I took a look with the Swift SDK and it looks like your server is rejecting requests coming from the Native SDKs because of the &lt;STRONG&gt;User-Agent&lt;/STRONG&gt; header. Not seen that before, but I reproduced this in Postman too.&lt;/P&gt;&lt;P&gt;The Native SDKs add a User-Agent string to all requests. In my Swift SDK test app, the string is this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;User-Agent: ArcGISMaps-Swift/200.7 (iOS 18.5; iPhone17,1,Simulator; devmode) com.esri.tutorial.Display-a-web-map/1.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It'll be something similar for the Kotlin SDK.&lt;/P&gt;&lt;P&gt;To open the layer, the SDKs will make a couple of metadata requests:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;A href="https://geoportal.ancpi.ro/hosted_services/rest/info?f=json" target="_blank"&gt;https://geoportal.ancpi.ro/hosted_services/rest/info?f=json&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer?f=json" target="_blank"&gt;https://geoportal.ancpi.ro/hosted_services/rest/services/Hosted/imobile_cladiri/VectorTileServer?f=json&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I make Postman GET requests to either of those URLs with no User-Agent header, I get valid JSON responses. But as soon as I add a User-Agent header like the one above, I get an HTML error response and the VectorTileLayer will fail to load with a "forbidden" error.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you check with your server admin and see if there's configuration on the server that could be rejecting these User-Agent Native SDK headers?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For reference, here's some sample output I get from the Swift SDK's &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/consolenetworklogger" target="_self"&gt;ConsoleNetworkLogger&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Request sent: 
	URL: https://geoportal.ancpi.ro/hosted_services/rest/info?f=json
	Method: GET
	Request headers: User-Agent: ArcGISMaps-Swift/200.7 (iOS 18.5; iPhone17,1,Simulator; devmode) com.esri.tutorial.Display-a-web-map/1.0
Request completed: 
	URL: https://geoportal.ancpi.ro/hosted_services/rest/info?f=json
	Method: GET
	Data: &amp;lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&amp;gt;
&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;403 Forbidden&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Forbidden&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;You don't have permission to access /hosted_services/rest/info
on this server.&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;

	Response headers: Connection: Keep-Alive, Content-Length: 227, Content-Type: text/html; charset=iso-8859-1, Date: Fri, 29 Aug 2025 19:10:26 GMT, Keep-Alive: timeout=5, max=100, Server: Apache, X-Content-Type-Options: nosniff&lt;/LI-CODE&gt;&lt;P&gt;To start to figure these things out, you can check the &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps/-loadable/index.html" target="_self"&gt;loadStatus&lt;/A&gt; on the VectorTileLayer or Map.&lt;/P&gt;&lt;P&gt;I then used the ConsoleNetworkLogger to see the requests being made that were getting a loadStatus error, dug into the them a bit, and figured the only difference between a browser and the SDK might be the User-Agent string.&lt;/P&gt;&lt;P&gt;I'm not familiar enough with Kotlin to recommend how to track requests like I can with the Swift ConsoleNetworkLogger, so I'll let someone on the Kotlin team pipe up if they have recommendations.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 19:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1646964#M584</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2025-08-29T19:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647138#M586</link>
      <description>&lt;P&gt;Hello, thank you very much for your efforts.&lt;BR /&gt;Were you able to override the user agent in the Swift SDK and get it working?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 09:24:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647138#M586</guid>
      <dc:creator>woodie</dc:creator>
      <dc:date>2025-09-01T09:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647190#M587</link>
      <description>&lt;P&gt;The Swift and Kotlin SDKs don't support overriding the user agent being sent as part of a network request made by the SDK. The server would need to be configured to accept that user agent.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 16:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647190#M587</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2025-09-01T16:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647275#M588</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46685"&gt;@GuntherHeppner&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thank you for your feedback. Unfortunately, we have no control over the server.&lt;BR /&gt;The easiest way would be to adjust the user agent in the &lt;SPAN&gt;Okhttp3&amp;nbsp;&lt;/SPAN&gt;client.&lt;BR /&gt;&lt;BR /&gt;This would also fit the wish of &lt;A href="https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-set-a-proxy-on-the-arcgishttpclient/m-p/1610331#M568" target="_blank"&gt;How to set a proxy on the ArcGISHTTPClient - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 07:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647275#M588</guid>
      <dc:creator>woodie</dc:creator>
      <dc:date>2025-09-02T07:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with displaying vector and tiles layers</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647691#M589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/932487"&gt;@woodie&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;I was able to confirm that ANCPI deliberately took this action to prevent desktop GIS applications (both Esri and open source) from accessing the data as some of the data is sold via &lt;A href="https://epay.ancpi.ro/epay/Welcome.action" target="_blank" rel="noopener"&gt;https://epay.ancpi.ro/epay/Welcome.action&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm unable to tell what the rules are, but they at least specifically block any user agent that contains "ArcGIS" (case sensitive). I'm told that QGIS is similarly blocked.&lt;/P&gt;&lt;P&gt;You would need to petition &lt;A href="https://www.ancpi.ro" target="_self"&gt;ANCPI&lt;/A&gt; to make a change to their servers to allow the Native Maps SDKs to access them.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 17:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/problem-with-displaying-vector-and-tiles-layers/m-p/1647691#M589</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2025-09-03T17:44:39Z</dc:date>
    </item>
  </channel>
</rss>

