Hi all,
I want to test the functions mentioned above (Nearest Vertex / Nearest Coordinate) however I'm not having much luck with what should be a fairly basic bit of Arcade ...
The aim was to click on a point on the map and it would run the following pop-up expression to test against the first candidate from a nearby polygonal dataset:
var featurePt = $feature
var featurePly = FeatureSetByPortalItem(
Portal('https://www.arcgis.com'),
'...ItemIDHere...', // A valid Item ID would be here...
0,
['*'],
true
);
var nearestPly = First(Intersects(featurePly, Buffer(featurePt, 10, "kilometers")));
var result = NearestVertex(nearestPly,featurePt)
return result
This however returns the following error:
Test execution error: Execution error - Invalid parameter. Verify test data.
When I debug it line-by-line, everything works until the NearestVertex line. From what I can see in the guidance I have all the parameters. Hit the same issue with NearestCoordinate function.
Can anyone advise what I'm doing wrong/what's missing?
Thanks!