0

Will the 2016 solution listed at Increase FeatureLayer click tolerance work in Web App Builder (ArcGIS Online) or perhaps a newer solution exists?

We have valid feedback:

I am having a little trouble finding the right place to click to get the info box to pop up on some projects. Can you add a selection feature to make that easier?

Please see attached syntax error I am seeing when attempting to use the suggested code in AGOL's (within WAB) Configure Popups (does a JS to Arcade converter exist?) and the code copy / paste below.

In 3.x, you can do this by overriding the "_calculateClickTolerance" function of the map's popupManager property. For example:

map.popupManager._calculateClickTolerance = function(graphicsLayers) {
    return 10;};

That is a very simplistic example, but you could implement whatever logic you want inside that function as long as you return an integer (preferably non-negative).

In ArcGIS Desktop

under Selection -> Selection Options -> Selection tolerance

exists and wondering where the similar option is in AGOL (WAB) for configure popups.

I've read through Your Arcade Questions Answered but have not found a solution yet.

1 Answer 1

2
dojo.connect(map,"onClick",function(evt){ 
      var query = new esri.tasks.Query(); 
      query.geometry = pointToExtent(map,evt.mapPoint,10); 


function pointToExtent(map, point, toleranceInPixel) { 
   var pixelWidth = map.extent.getWidth() / map.width; 
   var toleraceInMapCoords = toleranceInPixel * pixelWidth; 
   return new esri.geometry.Extent( point.x - toleraceInMapCoords, 
                point.y - toleraceInMapCoords, 
                point.x + toleraceInMapCoords, 
                point.y + toleraceInMapCoords, 
                map.spatialReference );                            
  }
  • The code is used to build a web application using JSAPI 4.2
  • Instead of passing in the map instance, pass it in the map view
  • The code was originally for the 3.x API
  • Works well with a tolerance of 15
1
  • Thank you Yogi.... I am getting parse errors when attempting to use this code in Pro 2.5 desktop and WAB(AGOL) "Configure Popups" .... is it possible to translate this JS into Arcade language? i.imgur.com/yaepQ4r.png
    – sirgeo
    Oct 29, 2020 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.