<?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: API Key not working? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183636#M77710</link>
    <description>&lt;P&gt;Ah, your app is using the "next" release for 4.24, which isn't officially released.&lt;/P&gt;&lt;P&gt;In the sources, change the locator property to url.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's noted in the breaking changes in the changelog for the next release&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/feedback-js-api-next/blob/master/CHANGELOG.md#breaking-changes" target="_blank"&gt;https://github.com/Esri/feedback-js-api-next/blob/master/CHANGELOG.md#breaking-changes&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2022 16:42:54 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2022-06-16T16:42:54Z</dc:date>
    <item>
      <title>API Key not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183287#M77700</link>
      <description>&lt;P&gt;I have two sites with identical codes but on one of them the apikey is not working, and the search widget is failing. I need a fresh pair of eyes. Am I missing anything?&lt;/P&gt;&lt;P&gt;Working site:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/poaYzNG?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/lkoumis1/pen/poaYzNG?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Not working site:&lt;/P&gt;&lt;P&gt;&lt;A href="http://svctenvims.dot.ca.gov/test_search/" target="_blank" rel="noopener"&gt;http://svctenvims.dot.ca.gov/test_search/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The script is at:&lt;/P&gt;&lt;P&gt;&lt;A href="http://svctenvims.dot.ca.gov/test_search/calcite.js" target="_blank"&gt;http://svctenvims.dot.ca.gov/test_search/calcite.js&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 15:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183287#M77700</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-06-16T15:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: API Key not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183617#M77706</link>
      <description>&lt;P&gt;It's not the apiKey. Your map is called webmap, but you still reference it as map.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReneRubalcava_0-1655396182542.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43642iBC18EA601AD18A92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReneRubalcava_0-1655396182542.png" alt="ReneRubalcava_0-1655396182542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webmap = new WebMap({
  portalItem: {
    // autocasts as new PortalItem()
    id: "55ebf90799fa4a3fa57562700a68c405",
  },
});

const view = new MapView({
  map, // should be map: webmap
  container: "viewDiv",
  center: [-119.475, 37.737],
  zoom: 5,
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183617#M77706</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-06-16T16:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: API Key not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183631#M77708</link>
      <description>&lt;P&gt;Sorry, you caught it while I was working on the code and you got that error.&amp;nbsp; The code now shows no errors but still the issue persists.&lt;/P&gt;&lt;P&gt;The issue is not the map. map in the code is just a variable that defines a new webmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, the code that shows no errors and it doesn't work is shown below&amp;nbsp; even though it's identical to the codeview. THe code in codeview uses the variable map as well to define the webmap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const map = new WebMap({
      portalItem: {
        id: "55ebf90799fa4a3fa57562700a68c405"
      }
    });
   

    const view = new MapView({
      map,
      container: "viewDiv",
      center: [-119.475, 37.737],
      zoom: 5
    });
	
	  const search = new Search({
      view: view,
          includeDefaultSources: false,
          sources: [           
            {
              name: "ArcGIS World Geocoding Service",
              placeholder: "example: Nuuk, GRL",
              singleLineFieldName: "SingleLine",
              apiKey: "AAPK7472adbedaa9448a8fb246f57ee83a447vIlk5Z-RKxy_pGyWaNdDuLrhh2nuOJdHJNMJch4AHAzDM96kvMcD8r1uM0UArb2",
              suggestionsEnabled: true,
              minSuggestCharacters: 2,
              locator:
                "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
            }

          ]
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:35:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183631#M77708</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-06-16T16:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: API Key not working?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183636#M77710</link>
      <description>&lt;P&gt;Ah, your app is using the "next" release for 4.24, which isn't officially released.&lt;/P&gt;&lt;P&gt;In the sources, change the locator property to url.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's noted in the breaking changes in the changelog for the next release&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/feedback-js-api-next/blob/master/CHANGELOG.md#breaking-changes" target="_blank"&gt;https://github.com/Esri/feedback-js-api-next/blob/master/CHANGELOG.md#breaking-changes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:42:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/api-key-not-working/m-p/1183636#M77710</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-06-16T16:42:54Z</dc:date>
    </item>
  </channel>
</rss>

