Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function showInfoWindow(marker) {
  2.  
  3.  
  4. var infoWindow = new google.maps.InfoWindow({
  5. content: (marker.title
  6. + '<br><img id="thumbnail" src = "img/'
  7. + marker.title.toLowerCase()
  8. + '.jpg"><br>'
  9. + '<ul>'
  10. + '<li id="infoWindowStart">Start from here</li>'
  11. + '<li id="infoWindowEnd">End here</li>'
  12. + '</ul>'
  13. )
  14.  
  15. });
  16.  
  17. infoWindow.open(map, marker);
  18.  
  19. // then try to add a listener to the newly-created "infoWindowStart"
  20. document.getElementById("infoWindowStart").addEventListener("click",function(){
  21. console.log("We're going from here")
  22. });
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement