Select to view content in your preferred language

Does ArcGIS Arcade have the ability to zoomto an expression result?

1661
1
Jump to solution
06-17-2021 01:05 PM
by Anonymous User
Not applicable

Hello:

I have an arcade expression that intersects and returns all addresses within a parcel if you click on the parcel. Is there a way to make this dynamic so it will zoom to an address when I click on one of the addresses in the popup?

var addresspoints = Intersects(
    $feature,
    FeatureSetByName($map,"Addresses (GIS)", ["FullAddress"])
  );


  var cnt = Count(addresspoints);
  var counter = (cnt-(cnt - 1))
  

var address_info = "";// validate if there are any related records and handle accordingly
if (cnt > 0) {    // there is at least 1 related record, create asset info    
address_info = cnt + " Address(es):";    // loop through related records    
for (var address in addresspoints) {        // create text using name and description (you should modify this to match your needs)        
var address_text = (counter++) + ". " + address.FullAddress;        // add the text for this asset to the asset info        
address_info += TextFormatting.NewLine + address_text;    }} else {    // no related records (or the sql query did not work)    
address_info = "No addresses found for this parcel";}
return address_info;

 

BrandonPrice2_0-1623960291676.png

 

This is the site: https://lacounty.maps.arcgis.com/apps/webappviewer/index.html?id=4cf18bf143c049ef84a173672e089e48 

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

I don't believe this is possible. Arcade has a few different profiles, but they're all pretty limited in scope to either the single feature, the layer, or the other layers in the map. The symbology profile can access the view scale, but that's about it. None of them can set properties in the map.

That said, it may be possible to use Arcade in something like a dashboard to generate a featureset which can be interacted with in the way you're looking for, but a dashboard may not be the solution you're looking for.

- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

I don't believe this is possible. Arcade has a few different profiles, but they're all pretty limited in scope to either the single feature, the layer, or the other layers in the map. The symbology profile can access the view scale, but that's about it. None of them can set properties in the map.

That said, it may be possible to use Arcade in something like a dashboard to generate a featureset which can be interacted with in the way you're looking for, but a dashboard may not be the solution you're looking for.

- Josh Carlson
Kendall County GIS