Org address being included in URL

66
1
09-11-2019 04:11 PM
AndrewHargreaves1
New Contributor III

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,-... 

Any clues?

Tags (2)
0 Kudos
1 Reply
Peter_Klingman
Esri Regular Contributor

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

0 Kudos