Feature Set Success

Feature Set Success - For some reason I have had a great deal of difficulty in pulling data from two layers for one pop-up. This was one and only time I got it to work.

/* This is my test to pull features from two different layers - this is the

first time it has worked! */

// Define the FeatureSet for each layer

var layer1 = FeatureSetByName($map, "Wildfires 10,000 acres plus", ["CalculatedAcres"]);

var layer2 = FeatureSetByName($map, "Current Wildfire Incidents 10k+", ["Injuries"]);

// Filter to match the current feature

var wildfire = First(Filter(layer1, "OBJECTID = " + $feature.OBJECTID));

var incident = First(Filter(layer2, "OBJECTID = " + $feature.OBJECTID));

// Extract values from both layers

var acres = wildfire.CalculatedAcres;

var injuries = incident.Injuries;

// Construct the final sentence

return "This wildfire covers " + Text(acres, "#,###") + " acres and has caused " + Text(injuries) +

" injuries.";

Previous
Previous

Search and Near Me Combo