I wrote some code that creates a map and allows users to click on the map. The click takes the lat,lng (of click) and queries a government's GIS database and returns the parcel number. They can also use the default search widget and search by address, which ultimately does the same thing.
I also added a polygon layer that outlines parcels and another polygon layer that outlines houses.
I am NOT USING AN API KEY. I am NOT using esriConfig.
The code works and seems fairly easy to disseminate. I just add:
Hi @ScottAndersonGQ - as for your question about "Do I need an API key?":
That depends on your account. If you are using an ArcGIS Developer account, then yes, you need an API key. If you are using an ArcGIS Online account, then no, API key is not required.
https://developers.arcgis.com/documentation/mapping-apis-and-services/deployment/accounts/#arcgis-on...
As shown on that page, if you're using an ArcGIS Online account, then "Basemap layers" and "Geocoding (not stored)" does not consume credits.
I also came across the same situation while configuring my application to use a token-based authentication from ArcGIS Enterprise.
If you check this codepen you can see what we mean.
There is no code to input an API key nor a token and yet the map loads without a problem.
All the basemaps from this documentation section works without authentication.
"For use without an API key
Use of these basemaps requires a valid ArcGIS Online organizational subscription or an ArcGIS Enterprise license."
Is it correct to assume these base maps don't need authentication of any kind to be loaded? If so, will it continue to be accessible in the future in the same manner?
If you have an ArcGIS Enterprise license , you can legally use the basemaps listed under "For use without an API key" - and your application does not need to specify an API key.
@LeandroAlmeida - does this help clarify?
Thanks for the reply, Bjorn
I understand API Keys are just for ArcGIS Online and Enterprise should use token or OAuth authentication, but what I don't understand is what tells ArcGIS that I really have a license in the first place if I can go to codepen or any other site and just input a code with no reference to my enterprise account whatsoever?
I'm asking all these questions because if we can just ship out a code without any API/token reference that's the way we will take it since we won't have to deal with another endpoint to handle authentication (we are using client_credentials tokens).
I just want to be certain that this approach will keep working in the future, in order to keep our site running without problems.
Just to give you a context, the website in question is only using the base map, all the other layers are being generated on the client side.
Hi @LeandroAlmeida
Technically there is nothing that tells ArcGIS that you indeed have an Enterprise license. It's a "paper" license. The terms are described in details in the E300 MLA - https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use.
There's no special limits for using this keyless/tokenless approach - assuming you have the license.
We don't currently have any plans to change that as far as I know.
https://developers.arcgis.com/javascript/latest/licensing/
Hi @BjornSvensson , please help me with iOS code to setup map without API key for ArcGIS enterprise account. Please share sample code or links for iOS and Android. thank you in advance.
Hi @NarasimhaNallamsetty , for questions related to iOS/Android, I would recommend asking in their related communities, see https://community.esri.com/t5/arcgis-maps-sdks-for-native-apps/ct-p/arcgis-runtime-sdks
Hi @BjornSvensson, I'm in the same situation as @ScottAndersonGQ and @LeandroAlmeida, however, in the link provided in the image below there is no longer the option you mentioned. I didn't find the basemaps that can be used without using an API Key.
We have the ArcGIS enterprise license, and I would like to know if there is still an option to use basemaps without using the API Key.
@Flayner - the basemap documentation is available at https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap .
In your case, you're looking for option 2, "From a basemap id" - see https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap-id