Hi all,
I'm trying to do a simple query on a feature layer from our Portal in my web application. I'm adding the data as a feature layer to do the query and I'm getting an error saying that the item does not exist or is inaccessible. The data are public so I shouldn't have to deal with OAuth or the user logging in. I tried using the portal id route:
const layer = new FeatureLayer({
portalItem: {
id: "*****************************"
},
outFields: ["*"]
});
and the url route:
var layer = new FeatureLayer("https://**********************************************/MapServer/0");
but neither seem to work. Any help would be appreciated...
If you can share a simplified reproducible test-app on some place like Codepen, that would make it a lot easier to diagnose. Also, the guide page in the query and filter tutorial should offer some good background information:
https://developers.arcgis.com/javascript/latest/query-filter/
Not really simplified much, but here is a link to a CodePen. You have to click on Search->Water Right By File and click on the search button.