I have some problems with opening a link in ArcGIS API. I have my popup window where LAT, LONG and LINK are shown.
function addPoint(evt) {
var latitude = evt.mapPoint.getLatitude();
var longitude = evt.mapPoint.getLongitude();
var link = "<a href='http://www.google.com'>Google</a>";
map.infoWindow.setTitle("Coordinates");
map.infoWindow.setContent(
"lat: " + latitude.toFixed(7) + "<br> lon: " + longitude.toFixed(7) + "<br> Room: " + link
);
map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));
}
Here is the image However when I click on the link nothing happens (no redirection or opening in new window). I tried to add window.open() to open the link,
var link = "<a href='http://www.google.com'>Google Office</a>";
on(link, 'click', openLink);
function openLink(){
window.open("http://www.google.com");
}
but then I get the error message
Uncaught Error: Target must be an event emitter