Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. overlay = new ol.Overlay({
  2. element: container,
  3. stopEvent: false,
  4. autoPan: true,
  5. autoPanMargin: 20,
  6. autoPanAnimation: {
  7. duration: 50
  8. }
  9. });
  10.  
  11. var mouseOver = false;
  12. function createOverlay(width) {
  13. container = document.getElementById('popup');
  14. container.style.width = width;
  15. container.onmouseover = function() {
  16. mouseOver = true; // when cursor is targeting overlay we enable this boolean
  17. };
  18. container.onmouseout = function() {
  19. mouseOver = false; // and disable when out
  20. };
  21. ...
  22. }
  23.  
  24. map.on("pointerdrag", function(e) {
  25. if (mouseOver) {
  26. e.stopPropagation();
  27. return;
  28. }
  29. });
  30.  
  31. map.on("click", function(e) {
  32. if (mouseOver) {
  33. return;
  34. }
  35. // rest of chart creation logic here
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement