[SalesForce] Google Map – infowindow hyperlink

I've set up an embedded google map in my VF page that displays all records within x km. I've added info windows to each of these, with the aim that the user can click on the link in the infowindow and it'll redirect them to that records detail page. I'm using:

var infoWindow = new google.maps.InfoWindow({
            content: '<div style="font-size: 8pt;">' + '<b>' + siteName + '</b>' + '</br>' + status + '</br><a href="' + siteLink + '">Load Site</a>'
        });

where siteLink is the id of the clicked marker. However, this redirects me to:

https://c.cs7.visual.force.com/apex/a0HM0000005AQFLMA4

rather than:

https://c.cs7.visual.force.com/a0HM0000005AQFLMA4

and so gives me an error. Any ideas how to get round this?

Best Answer

Did you try "/siteName" (a leading slash)? That would usually get a link to the root URL, ignoring the /apex path.

Related Topic