Select to view content in your preferred language

arcgis/core API key

329
2
09-05-2023 02:33 PM
TYoung
by
New Contributor

Hello first post here.

I'm working on an Angular application that will display a topographic basemap with some feature layers.  This is similar to the "Getting started" example on the Arcgis Javascript page.

I'm using the 'arcgis/core' library to do the rendering; when I run the application a login popup is displayed. 

How do I use my API key in the 'arcgis/core' library to prevent the popup?  There are a lot of examples of using the API key with the regular JS libraries but not with 'arcgis/core'.

Any help or document pointers would be appreciated.

 

0 Kudos
2 Replies
AndyGup
Esri Regular Contributor

@TYoung  have you tried getting the API key to work in a vanilla JavaScript app yet? For example, you can also use the ESM CDN for testing purposes: https://github.com/Esri/jsapi-resources/tree/main/esm-samples/jsapi-esm-cdn.

0 Kudos
TYoung
by
New Contributor

Hey @AndyGup,

Yes, that was the first thing I did.  It works without any issues.

I recreated the starter example using the 'arcgis/core' library but took out the FeatureLayers and I am no longer prompted to login.

It looks like the login/API key are only required when accessing the pre-defined FeatureLayers?

0 Kudos