From afdf036e938e3e9437684681cc850f2e5f4e7324 Mon Sep 17 00:00:00 2001 From: antoniocarlon Date: Mon, 14 Sep 2020 14:56:22 +0200 Subject: [PATCH] Fix empty popups --- cartoframes/assets/src/bundle.js | 2 +- cartoframes/assets/src/map/popups.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cartoframes/assets/src/bundle.js b/cartoframes/assets/src/bundle.js index 9c4cf6dcb..c81dc6a83 100644 --- a/cartoframes/assets/src/bundle.js +++ b/cartoframes/assets/src/bundle.js @@ -585,7 +585,7 @@ var init = (function () { .setLngLat([event.coordinates.lng, event.coordinates.lat]) .setHTML(``); - if (!popup.isOpen()) { + if (popupHTML.length > 0 && !popup.isOpen()) { popup.addTo(map); } } else { diff --git a/cartoframes/assets/src/map/popups.js b/cartoframes/assets/src/map/popups.js index ee7528954..df3ff6e7f 100644 --- a/cartoframes/assets/src/map/popups.js +++ b/cartoframes/assets/src/map/popups.js @@ -51,7 +51,7 @@ export function updatePopup(map, popup, event, attrs) { .setLngLat([event.coordinates.lng, event.coordinates.lat]) .setHTML(``); - if (!popup.isOpen()) { + if (popupHTML.length > 0 && !popup.isOpen()) { popup.addTo(map); } } else {