SHARE
TWEET

Untitled

a guest Jun 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top