Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. google.maps.event.addListener(infowindow, "closeclick", function() {
  2. // The API function doesn't have the e parameter, I can't access closeclick
  3. });
  4.  
  5. container.addEventListener('click', function(ev) {
  6. if (ev.target.src == 'https://maps.gstatic.com/mapfiles/api-3/images/mapcnt6.png') {
  7. return false;
  8. }
  9. // the code I want to execute only when the click event doesn't come from the InfoWindow
  10. });
  11.  
  12. google.maps.event.addListener(infowindow, "closeclick", function(e) {
  13. e.stopPropagation();
  14. });
  15.  
  16. var aListener = google.maps.event.addListener(map, 'click', function(event) {
  17. // Try to prevent event propagation to the map
  18. event.stop();
  19. event.cancelBubble = true;
  20. if (event.stopPropagation) {
  21. event.stopPropagation();
  22. }
  23. if (event.preventDefault) {
  24. event.preventDefault();
  25. } else {
  26. event.returnValue = false;
  27. }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement