VUE3+Cesium setup: How to remove Cesium’s copyright logo in the lower left corner

Use VUE3+Cesium to quickly build a 3D geographic information platform. If it does not affect project development or research and study, it is recommended to retain the official logo and links. It is somewhat unkind to remove other people’s logos, but Cesium It must be an open source platform after all, and in some usage environments the logo must be removed.
For Cesium old notebooks, you can use the following methods:
1. Find the widgets.css file and modify cesium-widget-credits, as follows:

.cesium-widget-credits{
    
     
 display:none!important; 
visibility:hide!important; 
} 

2. Or set the Logo tag to **"none"** in the JS file, as follows:

viewer._cesiumWidget._creditContainer.style.display = "none";

For newer Cesium versions that are more compatible with VUE, the method in 1 is no longer effective. You need to open the Cesium.js file, modify the code, and change the display from inline to none to remove the Cesium Logo, as follows:

element: {
    
    
    get: function () {
    
    
      if (!defined(this._element)) {
    
    
        const html = DOMPurify.sanitize(this._html);

        const div = document.createElement("div");
        div._creditId = this._id;
        div.style.display = "none"; **//将inline改为none**
        div.innerHTML = html;

        const links = div.querySelectorAll("a");
        for (let i = 0; i < links.length; i++) {
    
    
          links[i].setAttribute("target", "_blank");
        }

        this._element = div;
      }
      return this._element;
    },
  },

Guess you like

Origin blog.csdn.net/qijie987613/article/details/131939505