I do these attribute rules for a federated service

**Coordinates**

//Latitude

var y = Centroid($feature).y

var originShift = 2.0 * PI * 6378137.0 / 2.0;

var lat = (y / originShift) * 180.0;

lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);

return lat

//Longitude

var x = Centroid($feature).x

var originShift = 2.0 * PI * 6378137.0 / 2.0;

var lon = (x / originShift) * 180.0;

return lon