I am working with arcGIS JavaScript API 4.11. I am trying to see if a point which I provided a longitude and latitude is in a image layer or not. Any suggestions? The code below is what I am trying to use.
//xCord and yCord are the long and lat
let pt = esri.geometry.geographicToWebMercator(new esri.geometry.Point(xCord, yCord));
let result = map.layers.getItemAt(0).geometry.contains(pt);
console.log("Result is: " + result);
Thanks in advance!