• cesium切片底图正常出来但控制台一直报错的方法


    1、部署ngnix服务

     2、修改ngnix配置

    在location 下的路径配置如下内容

    add_header Access-Control-Allow-Origin *;

    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';

    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

    if ($request_method = 'OPTIONS') { return 204; }

    if ( !-f $request_filename ){ #关键配置

    rewrite (.*) /404.png;

    }

    404.png为默认返回的图片 (纯透明的),你们转换一下base64

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAAnAAAAJwEqCZFPAAAFF2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4wLWMwMDAgNzkuMjE3YmNhNiwgMjAyMS8wNi8xNC0xODoyODoxMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5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hwYWNrZXQgZW5kPSJyIj8+hdTqOwAAAA1JREFUCB1j+P//PwMACPwC/uYM/6sAAAAASUVORK5CYII=

    4图片放在ngnix跟目录下即可

     

  • 相关阅读:
    多策略黑猩猩优化算法-附代码
    3.5 高速以太网
    PLC面向对象编程系列之如何设计分解状态机(FSM)的状态
    磷脂-聚乙二醇-叠氮,DSPE-PEG-Azide,DSPE-PEG-N3,MW:5000
    蓝桥杯-班级活动
    【微服务】Day11(续 开发新增订单功能、静态资源服务器)
    js中scrollIntoView第一次不生效,第二次生效
    Can‘t load library usrlibjvmjava-17-openjdk-amd64liblibawt_xawt.so
    【壁纸小程序】搭建自己的壁纸小程序-微信抖音双端
    Fabric.js 喷雾笔刷 从入门到放肆
  • 原文地址:https://blog.csdn.net/yk583443123/article/details/128202700