I have an expression in a web map popup which pulls a features Lat/Long and combines it into a URL:
var g = Geometry($feature);var lon = g.x/111319.49079;var lat = g.y/6378137.0;lat = 90*(4*Atan(Exp(Lat)) - Pi)/Pi;var url = Concatenate("<a href=http://maps.google.com/maps?daddr=",Round(lat, 5),",",Round(lon, 5),">Directions</a>")return url
I then set my popup as follows:
However for some reason my URL get's prefaced with my Org's URL to result in:
http://idmodeling.maps.arcgis.com/home/webmap/%3Ca%20href=http:/maps.google.com/maps?daddr=33.7187,-116.25616%3EDirectio…
Any clues?
Hi Andrew Hargreaves,
That is an interesting use of Arcade!
I tossed your expression in a Web Map Pop-up and saw the same behavior. I think the issue is that the Web Map constructs the link for you, so you just need the URL without the HTML tags. The below expression worked for me and launched Google Maps with the expected location:
var g = Geometry($feature);var lon = g.x/111319.49079;var lat = g.y/6378137.0;lat = 90*(4*Atan(Exp(Lat)) - Pi)/Pi;var url = Concatenate("http://maps.google.com/maps?daddr=",Round(lat, 5),",",Round(lon, 5),"")return url
Hope this helps,
Peter
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.