AnsweredAssumed Answered

"Token" property does not work for FeatureLayer

Question asked by deleted-user-OOe4JK-9Abnm on May 30, 2018
Latest reply on Jun 12, 2018 by deleted-user-OOe4JK-9Abnm


I need to add feature layer to a map.


My code:
new FeatureLayer({
url: Config.layerUrl,
token: this.props.token


Problem 1: TypeScript returns the following error: "'token' does not exist in type 'FeatureLayerProperties'." I checked the type definition @types/arcgis-js-api@4.7.0, it is not defined, but 'token' exists in the documentation: FeatureLayer | API Reference | ArcGIS API for JavaScript 4.7 

Ok, I added type for 'token' on my own, but then we have problem 2...


Problem 2: The 'token' will not be sendt to the server. So I get a login dialog to be authenticated.


My question is how to add a featureLayer to the map by using token?