AnsweredAssumed Answered

JS API 4.9, default spatial query on click a MapView

Question asked by cle444 on Nov 7, 2018
Latest reply on Nov 8, 2018 by cle444

Setup1: AGOL basemap grey + 1 feature layer

 

When clicking on the mapview, a spatial query is triggered using a bounding box and intersects relationship to lock the potential features.

 

Tested at zoom:13, resolution:9.554628535634155, scale:36111.909643, clicked map point is:
"x":19218001.47419181,"y":-5392917.926576874

 

Then, JS API generated the query bounding box:
"xmin":19217944.146420598,"ymin":-5392975.254348088,"xmax":19218058.801963024,"ymax":-5392860.59880566

 

The API uses above input map point as the center to generate this perfect square bounding box of length = 114.655m.

 

Question:
How is this bounding box worked out by API? Can it be modified?

 

A useful scenario is when trying to identify a point feature on the mobile device, for big fingers it could be tricky. If there is an easy way to make the bounding box larger, it means this click tolerance can be increased.

 

Of course, you can overwrite the default onclick method or increase of the symbol size to solve this, but they are not preferred if there is an easier way.

 

Thanks.

Outcomes