0
I’m using the Google API to insert a map into my site, where the user types in their zip code, street, etc, and the API shows the nearest accredited stores to that user, but I wanted to reference a store link when it’s shown on the map, currently the code that shows the stores is this:
outputDiv.innerHTML += "<div class='espaco' style='margin-left:40px; margin-top:10px'> <a href='javascript:google.maps.event.trigger(closest[" + results[i].idx_closestMark + "],\"click\");'>" + results[i].title + '</a><br>' + results[i].address + "<br>" + results[i].distance.text + ' aproximadamente ' + results[i].duration.text + '<br><hr></div>';
Solved:
+ " <a href = 'goo.gl/maps/sQ5zPMJEERaggz3g8' target= '_blank'>"+results[i].title+"</a></span>"+ "<br>"+
I was able to solve it: + " <a href = 'https://goo.gl/maps/sQ5zPMJEERaggz3g8' target= '_Blank'>"+Results[i]. title+"</a></span>"+ "<br>"+
– Eduardo Kusdra Filho