hello esri community.
I have a small problem can you help me?
js code
items = document.querySelectorAll(".item");
// console.log(items)
items.forEach(item => {
item.addEventListener("click", () => {
item.classList.toggle("checked");
// if(item.className == "item checked"){
//alert("ekle")
let valitem;
valitem = item.children[2].innerHTML;
console.log(" ada parsel " , valitem);
let query = layer.createQuery();
query.where = `adaparsel = '${valitem}'`;
query.outFields = ["*"];
query.returnGeometry = true
layer.queryFeatures(query).then((result) => {
console.log(result);
//let features = result.features;
result.features.map((feature) => {
let staneName= feature.attributes["adaparsel"];
document.getElementById("grafiksonuclar").innerHTML= staneName + "Parsel No"
resultgraphics = new Graphic({
geometry: feature.geometry,
})
view.graphics.add(resultgraphics);
view.goTo(resultgraphics);
if(item.classList == "item"){
document.getElementById("grafiksonuclar").innerHTML= ""
view.graphics.remove(resultgraphics);
}
});
});