<?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 JS API: the URLSearchParams interface vs. urlToObject() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-the-urlsearchparams-interface-vs/m-p/355137#M32902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a nice way to get, and set, my x and y coordinates and zoom level from, and to, the query string of my url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the &lt;A class="link-titled" href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams" title="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams"&gt;URLSearchParams&lt;/A&gt; interface I can manipulate the search parameters and with the &lt;A class="link-titled" href="https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState" title="https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState"&gt;History.replaceState()&lt;/A&gt; method I can modify the url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works alright. The search parameters in this link &lt;A class="link-titled" href="https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm?x=345835&amp;amp;y=381863&amp;amp;l=14" title="https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm?x=345835&amp;amp;y=381863&amp;amp;l=14"&gt;ArcGIS JavaScript with UK data - URL Parameters: x, y and zoomlevel&lt;/A&gt; (&lt;STRONG style="font-family: andale mono, monospace; "&gt;?x=345835&amp;amp;y=381863&amp;amp;l=14&lt;/STRONG&gt;) will fly you directly to John Lennon Airport in Liverpool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More info in this blog: &lt;A href="https://community.esri.com/people/EPolle_TensingInternational/blog/2020/07/06/arcgis-javascript-with-uk-data-urlsearchparams"&gt;https://community.esri.com/people/EPolle_TensingInternational/blog/2020/07/06/arcgis-javascript-with-uk-data-urlsearchparams&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now the question:&lt;/P&gt;&lt;P&gt;Is this the correct approach, or should I have used &lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject"&gt;urlUtils.urlToObject()&lt;/A&gt; instead? What would be the pros and cons of either way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your opinion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2020 20:26:39 GMT</pubDate>
    <dc:creator>Egge-Jan_Pollé</dc:creator>
    <dc:date>2020-07-06T20:26:39Z</dc:date>
    <item>
      <title>JS API: the URLSearchParams interface vs. urlToObject()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-the-urlsearchparams-interface-vs/m-p/355137#M32902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a nice way to get, and set, my x and y coordinates and zoom level from, and to, the query string of my url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the &lt;A class="link-titled" href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams" title="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams"&gt;URLSearchParams&lt;/A&gt; interface I can manipulate the search parameters and with the &lt;A class="link-titled" href="https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState" title="https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState"&gt;History.replaceState()&lt;/A&gt; method I can modify the url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works alright. The search parameters in this link &lt;A class="link-titled" href="https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm?x=345835&amp;amp;y=381863&amp;amp;l=14" title="https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm?x=345835&amp;amp;y=381863&amp;amp;l=14"&gt;ArcGIS JavaScript with UK data - URL Parameters: x, y and zoomlevel&lt;/A&gt; (&lt;STRONG style="font-family: andale mono, monospace; "&gt;?x=345835&amp;amp;y=381863&amp;amp;l=14&lt;/STRONG&gt;) will fly you directly to John Lennon Airport in Liverpool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More info in this blog: &lt;A href="https://community.esri.com/people/EPolle_TensingInternational/blog/2020/07/06/arcgis-javascript-with-uk-data-urlsearchparams"&gt;https://community.esri.com/people/EPolle_TensingInternational/blog/2020/07/06/arcgis-javascript-with-uk-data-urlsearchparams&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now the question:&lt;/P&gt;&lt;P&gt;Is this the correct approach, or should I have used &lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject"&gt;urlUtils.urlToObject()&lt;/A&gt; instead? What would be the pros and cons of either way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your opinion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2020 20:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-the-urlsearchparams-interface-vs/m-p/355137#M32902</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2020-07-06T20:26:39Z</dc:date>
    </item>
  </channel>
</rss>

