It looks like you can't do this directly in the symbology settings.
You'd need the $datastore or $map global to do an Intersect, and they are not available in the Visualization profile.
I'd create a new field and an Attribute Rule:
// field: ShowFeature, numeric
// triggers: insert (not update!)
// This rule checks whether a new feature is at the same location as other
// features in the same feature class. If so, it edits the field ShowFeature
// for those other features to be 0. For the feature itself, that field will
// be set to 1.
// In your map, you can then hide the features where ShowFeature = 0, either
// via a definition query or via the symbology settings. This way, if there
// are multiple feature in the same location, only the most recently added
// feature is shown.
// Get a reference to the feature class the new feature belongs to.
var fs = FeatureSetByName($datastore, "database.owner.class", ["GlobalID"], true)
// Intersect the new feture with the whole feature class.
// Here "features in the same location" means "at that exact point".
// If you want to check for "features at a certain distance around the new
// feature", you should do this instead:
// var inter = Intersects(fs, Buffer($feature, 10, "meters"))
var inter = Intersects(fs, $feature)
// You will find at least 1 intersecting feature (the new feature itself).
// If there is exactly 1 intersecting feature, that means that there are no
// other features in the same location. Just return ShowFeature = 1.
if(Count(inter) == 1) {
return 1
}
// If you get here, there are multiple features in the same location.
// For the older features (the ones that aren't $feature), you want to
// set ShowFeature = 0.
var updates = []
for(var fi in inter) {
// Check if the currently tested feature (fi) ist the newly added one
// ($feature). We do that here by comparing GlobalIDs.
if(fi["GlobalID"] != $feature["GlobalID"]) {
// If fi is not the new feature, we want to hide it
updates[Count(updates)] = {"globalID": fi["GlobalID"], "attributes": {"ShowFeature": 0}}
}
}
// Now we return the result.
// We set $feature.ShowFeature to 1 ("result": 1).
// And we edit all intersecting features in the same feature class
// with the update array we filled above.
return {
"result": 1,
"edit": [{
"className": "owner.class",
"updates": updates
}]
}
Then, you can hide the features where ShowFeature = 0, either with a query or in the symbology.
Have a great day!
Johannes