Click table row and go to feature location

579
5
02-27-2019 03:08 AM
kawishabbas
Occasional Contributor

Hi

I have created an App in which Feature Layer service is showing in table with map. i want to add a function to which user click row of table and  map should go to exact location.

This process is not working on click event.

view.goTo({
target:[res.data.features[0].geometry]

});
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Kawish,

   Have you verified that res.data.features[0].geometry is not null. Also this looks like a single geometry you are trying to go to so there is no need to make the target property an array.

0 Kudos
kawishabbas
Occasional Contributor

Robert yes i have checked res.data.features[0].geometry is not null and it is only for testing if it works i set it in loop. Is target property works with out array?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Yes it work with a single geometry object or an array and several other object types that are covered in the help document.

0 Kudos
kawishabbas
Occasional Contributor

Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

So does it work without the square brackets?

0 Kudos