Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fixes #480
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Dec 12, 2017
1 parent f80c7e3 commit 9637720
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/renderer/components/cesium/CesiumGlobe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,21 @@ export class CesiumGlobe extends ExternalObjectComponent<Viewer, CesiumGlobeStat
// console.log('updateOverlayHtml', prevOverlayHtml, nextOverlayHtml);
if (nextOverlayHtml) {
if (prevOverlayHtml) {
if (!viewer.container.contains(prevOverlayHtml)) {
// TODO (forman): FIXME! Why does this happen?
console.warn("CesiumGlobe: previous HTML element is not a child", prevOverlayHtml)
return;
}
viewer.container.replaceChild(nextOverlayHtml, prevOverlayHtml);
} else {
viewer.container.appendChild(nextOverlayHtml);
}
} else {
if (!viewer.container.contains(prevOverlayHtml)) {
// TODO (forman): FIXME! Why does this happen?
console.warn("CesiumGlobe: previous HTML element is not a child", prevOverlayHtml)
return;
}
viewer.container.removeChild(prevOverlayHtml);
}
}
Expand Down

0 comments on commit 9637720

Please sign in to comment.