Select to view content in your preferred language

490
2
04-04-2024 11:19 AM
Labels (1)
by
Occasional Contributor III

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
// 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```

Tags (4)
1 Solution

Accepted Solutions
Frequent Contributor

Are you sure you're specifying the arguments the right way? There seems to be an ampersand (@) before the lat/long specification rather than what you have in the url code sample above. I found this discussion and I changed the lat/long to different coordinates and it opened to the new location..

2 Replies
Frequent Contributor

Are you sure you're specifying the arguments the right way? There seems to be an ampersand (@) before the lat/long specification rather than what you have in the url code sample above. I found this discussion and I changed the lat/long to different coordinates and it opened to the new location..

by
Occasional Contributor III

Thanks @SteveCole, I think this did it! I was missing the "@" which was in the way of troubleshooting, and I did not come across that discussion so that helped a lot in setting the other parameters. Thanks again!