I have an onclick function, but it is tied to one layer. How can i make it so that i can use multiple layers?
view.on ("click", function (event)
{
// Handle feature selection here
console.log ("Get Selected Features Data")
$ ('#customWindow').jqxWindow ('close');
$ ('#assignedEmployeesTable').jqxGrid ('clear')
view.hitTest (event).then (function (response)
{
if (response.results.length > 0) {
const features = response.results.filter (function (result)
{
return result.graphic.layer === roomsUseLayer;// Filter for your specific layer
});
// Extract attributes from the selected features
features.forEach (function (feature)
{
attributes = feature.graphic.attributes;
console.log (attributes.SPACEID);
});
getSpaceObjectID ();
}
});
});
Thanks for your help.