I have a polygon feature layer where pop-ups are configured already to link to directions to Google Maps and Waze through a resource I found online. I would like a similar pop-up link for Google Earth to see the location in 3D. However, it looks like it's not as easy as just a URL change, if the prefix is changed from https://www.google.com/maps/place/ to https://earth.google.com/web/. It also looks like Google Earth "remembers" where you last opened a link regardless of clicking a brand new link. Any assistance appreciated!
// converts point from the Spherical Mercator EPSG:900913 to the WGS84 Datum
// i.e. converts from the projected cooridinate system to the needed geographic coordinate system
var PointGeometry = Centroid(Geometry($feature))
// "6378137" is the length of the semi-minor axis of the Spherical Mercator's ellipsoid
// the semi-minor axis of an ellipsiod is the geometric mean of the ellipsioid's max & min radii
// dividing by the length of the semi-minor axis standardizes the X, Y point to radians
var latRadians = (PointGeometry.y / 6378137)
// the geodetic latitude in radians
var latGeoRadians = (2 * Atan(Exp(latRadians)) - PI / 2)
// converts radians to degrees by multiplying by "180 / PI"
var lat = Text(180 / PI * latGeoRadians)
// dividing by the length of the semi-minor axis standardizes the X, Y point to radians
var longRadians = PointGeometry.x / 6378137
// converts radians to degrees by multiplying by "180 / PI"
var long = Text(180 / PI * longRadians)
// gives the g-maps url to the calculated lat & long
var url = 'https://www.google.com/maps/place/' + lat + '+' + long
return url