The Preamble
I want to create a list of google map markers which populate InfoWindows about those specific locations and inside the InfoWindow a link to the Wikipedia article about that location. I am making an Ajax call within this google.maps.event.addListener(place.marker, 'click', function() {}
click function, and this function is within a self.allPlaces().forEach(function(place) {}
function that just iterates through all my locations.
The Problem
The link is populated within the InfoWindows, but it only opens if you right click and open in a new tab, whereas I would like it to just open with a left click.
function ajax() {
return $.ajax({
type: 'GET',
url: wikiURL,
dataType: "jsonp",
prop: 'pageimages'
});
}
ajax().done(function(response) {
clearTimeout(self.apiTimeout);
var articleList = response[1];
console.log(response);
if (articleList.length > 0) {
for (var i = 0; i < articleList.length; i++) {
var url = response[3]; // response[3] gives back the wiki URL
content = '<div class="infoWindow"><strong>' + place.title + '</strong><br>' +
'<p>' + place.formatted_address + '</p>' +
'<p>' + response[2] + '</p>' + // response[2] for more modern response
'<a href="' + url + '" target="_blank">' +
"View full Wikipedia article" + '</a>' +
'</div>';
infoWindow.setContent(content);
}
}