Hello everyone, I am currently facing some issues retrieving my Feature Layer from the server directory. I am currently using ArcGIS API for JavaScript 3.41.
I have tried the following code however, there are some issues in retrieving the information I need. For eg. there are a few missing properties such as the id, info template, _fields within the layer itself.
Below are the 2 methods I have tried I am able to retrieve the layers however the properties are still undefined or empty. Am I missing any steps?
const layer = new FeatureLayer({ "sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0" });
How about posting the rest of your code? Maybe set it up in CodePen?
Sorry.. the project is classified, but thanks for the reply..
It looks like you are trying to use 4x syntax in a 3x app. The FeatureLayer API in 3x is slightly different. You can just pass the URL.
https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#featurelayer1
If you have the itemId, you can get the item and get the URL off of that
https://developers.arcgis.com/javascript/3/jsapi/esri.arcgis.utils-amd.html#getitem