Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- overlay = new ol.Overlay({
- element: container,
- stopEvent: false,
- autoPan: true,
- autoPanMargin: 20,
- autoPanAnimation: {
- duration: 50
- }
- });
- var mouseOver = false;
- function createOverlay(width) {
- container = document.getElementById('popup');
- container.style.width = width;
- container.onmouseover = function() {
- mouseOver = true; // when cursor is targeting overlay we enable this boolean
- };
- container.onmouseout = function() {
- mouseOver = false; // and disable when out
- };
- ...
- }
- map.on("pointerdrag", function(e) {
- if (mouseOver) {
- e.stopPropagation();
- return;
- }
- });
- map.on("click", function(e) {
- if (mouseOver) {
- return;
- }
- // rest of chart creation logic here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement