Select to view content in your preferred language

view.hitTest returning 0 results

5704
23
01-25-2017 10:30 AM
JasonRainwater
Deactivated User

Hi, I am adding am empty feature layer on the fly in the browser.  After the fact I will add graphics to the source collection of the feature layer and my graphics all render correctly.

I setup the mapView.on("click") and I properly get the event with the click data.  I do the hit test then look at the results.

I am physically clicking directly on the rendered graphic but no matter what the hittest shows 0 results.

I have no idea where to start looking to see what I am doing wrong.  Any ideas?

0 Kudos
23 Replies
VincentJones
Emerging Contributor

Have you tried with version 4.12? This works for me. I want to use version 4.15 though so I am still looking for a solution...

GeoMarvelDeveloper
New Contributor

I haven't tried 4.12. I eventually abandoned the FeatureLayer client-side rendering and moved on to doing the same with a GeoJSON layer, which worked perfectly for me.

0 Kudos
VincentJones
Emerging Contributor

I finally tracked down what the issue was here. In my case I was reading the objectId from a data attribute and although a numeric value, it's type must have been considered string by the API; parsing as integer fixed the issue.

Hope this helps someone.

KevinCheriyan
Frequent Contributor

Awesome. I can't test it right now. But this is good to know for my next time working with this!


--------------------------------------------------
Application Developer, GeoMarvel
0 Kudos