Popup: Browse Features in Custom FeatureSet

467
0
11-16-2020 07:53 PM
Status: Open
jcarlson
MVP Esteemed Contributor

Using Clustering with a points layer is great, and one of my favorite things about it is the "Browse Features" capability. What I would like is to have some ability to create a customized version of this feature, but to refer to my own defined FeatureSet.

Suppose, for example, I have a points layer of structures in my county, and a separate layer of property sales. In my popup, I can currently configure an expression to return a single attribute of a single sale, and simply have to repeat this expression for additional attributes.

var sales = FeatureSetByName($map,"Parcel_Sales")
var pin = $feature.pin

var latestSale = First(OrderBy(Filter(sales, "property_key = @pin"), "sale_date DESC"))

return latestSale.sale_amount

That's all well and good, but suppose instead I just wanted all the sales from the past 10 years for the clicked-on property, and I wanted to see all the attributes of each sale. Or maybe I want some spatial elements in the returned features, too. Suppose I wanted other property sales within a certain percent range of the latest sale and that fell within a mile of this property?

I know, I know. That's what some of the widgets in WAB and EB are for. But sometimes all I really want is to click on a feature and to browse through a set of other related features. I also know that related layers can offer this sort of capability as well, but because of how and when these layers (and others) are updated, they have to be managed separately. This is only one example, but I can think of a dozen other ways I would use this, from interactively browsing parcel genealogy to showing the homes / properties in a selected environmental zone.

With some additional tweaking, I can get Arcade to spit out an ugly string from an array, or even populate an HTML table. But that's still not quite what I want.

What kills me is that using Arcade, there's currently no problem in getting exactly the sort of result I'm looking for in the expression builder. But try to bring that FeatureSet, or even a single Feature, into your popup:

jCarlson_0-1605584158513.png

Sad day.

Tags (2)