Good day,
Could someone please advise on how I could add / include my API key to the search widget (below)?
Search widget
Regards,
Louis
Hey @LouisCoetzee, thank for the question. Currently, there are two ways you can use an apiKey with the Search widget.
As of 4.18, you can use a global apiKey with esriConfig, which will work with the Search widget, and any other widget or basemap that requires an apiKey. Example based on your app:
https://codepen.io/noash/pen/yLgmRWK?editors=1000
At 4.19, you can also use a finely-grained apiKey on the LocatorSearchSource property of the Search widget. Example based on your app:
https://codepen.io/noash/pen/bGgXmZq?editors=1000
More information about apiKeys in general can be found here: https://developers.arcgis.com/javascript/latest/release-notes/#api-keys
Hi @Noah-Sager ,
Thank you for your reply and for the examples.
I have implemented the first example with my API key and it is working. - thank you!
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.