基于nginx部署CTB处理的地形数据

使用CTB处理后的地形数据,在访问上与CesiumLab处理过的有所不同,前者对于一个.terrain图块,在处理时使用了CTBZFileOutputStream(压缩)输出,发布地形数据时需要在服务器参数中做相应的处理。

一、基于nginx部署。

location /myterrain {
        proxy_set_header Host       $http_host;
        autoindex on;
        autoindex_exact_size on;
        autoindex_localtime on;
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        alias E:/models/terrain/myterrain;
        location ~* \.terrain$ {
            add_header Content-Encoding gzip;
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
        }
    }

1、add_header 'Access-Control-Allow-Origin' '*';与add_header 'Access-Control-Allow-Credentials' 'true';项。

上述两项是为了要该虚拟目录响应跨域服务请求。

2、 location ~* \.terrain$项。

上述项中包含的三项, add_header Content-Encoding gzip;项是设置服务端能够发送压缩编码类型。后面两项仍然是响应跨域,看起来重复设置,但缺少了一项,访问地形数据将出现问题。

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值