HOW TO
In Portal for ArcGIS and ArcGIS Online Map Viewer, when the features' latitude and longitude values are stored in double type fields in a hosted feature layer, hyperlinks to the coordinates on Google Maps can be added to the pop-ups using custom Arcade expressions. This article provides the Arcade expressions to do so.
var lat = Replace(Text($feature.<latitude_fieldname>, "#.#######"), ",", "."); var lon = Replace(Text($feature.<longitude_fieldname>, "#.#######"), ",", "."); var url = "https://www.google.com/maps/search/?api=1&query=" + lat + "," + lon; return url;
var lat = Replace(Text($feature.<latitude_fieldname>, "#.#######"), ",", "."); var lon = Replace(Text($feature.<longitude_fieldname>, "#.#######"), ",", "."); var url = "http://maps.google.com/?cbll=" + lat + "," + lon + "&cbp=12,90,0,0,5&layer=c"; return url;
var lat = Replace(Text($feature.<latitude_fieldname>, "#.#######"), ",", "."); var lon = Replace(Text($feature.<longitude_fieldname>, "#.#######"), ",", "."); var url = "https://www.google.com/maps/@" + text(lat) + "," + text(lon) + ",38m/data=!3m1!1e3"; return url;
In this example, the Google Maps hyperlink based on the coordinates is generated and added to the pop-up.
Article ID: 000030641
Get help from ArcGIS experts
Download the Esri Support App
You can also download the app to access the chatbot anytime! Download it now.