0.97.4 • Published 2 months ago

@maptalks/3dtiles v0.97.4

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 months ago

3dtiles插件

NPM Version

maptalks用于载入3dtiles数据的图层插件

示例代码

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/maptalks@next/dist/maptalks.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/gl/dist/maptalksgl.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/3dtiles@latest/dist/maptalks.3dtiles.js"></script>
<script>
const layer = new maptalks.Geo3DTilesLayer('3dtiles', {        
    maxCacheSize : 1000, //缓存的最大瓦片数
    // loadingLimitOnInteracting : 1, //地图交互过程中瓦片请求最大数量
    // loadingLimit : 0, //瓦片请求最大数量
    services : [
        {
            url : 'path/to/tileset.json',
            // maximumScreenSpaceError值越小,加载的模型越清晰,但加载的数据量会变大
            // 清晰度可以接受的情况下,推荐把这个值设得越大越好,性能会越好
            maximumScreenSpaceError : 24.0,
            // urlParams : 'v=0.0',
            // ajaxOptions : { credentials : 'include' },
            // 把模型降低1200米
            heightOffset : -1200,
            ambientLight : [0.0, 0.0, 0.0],
            // maxExtent : maxExtent
            // ajaxInMainThread : true, //从主线程发起ajax请求,用于worker发起ajax报跨域错误
        },
        // 其他的3dtiles数据源
    ]
});
layer.addTo(map);
</script>

配置说明

I3S数据gzip解压

i3s数据默认都进行了gzip压缩(以.gz结尾),需要在http服务中配置url rewrite和gzip解压。

IIS配置

  • 下载安装url rewrite模块
  • 在文件夹目录下创建web.config,配置gz解压和url write:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".json.gz" />
      <remove fileExtension=".bin.gz" />
      <mimeMap fileExtension=".json.gz" mimeType="application/json" />
      <mimeMap fileExtension=".bin.gz" mimeType="application/octet-stream" />
    </staticContent>
    <rewrite>
      <outboundRules rewriteBeforeCache="true">
        <rule name="Custom gzip file header">
          <match serverVariable="RESPONSE_CONTENT_ENCODING" pattern=".*" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="\.gz$" />
          </conditions>
          <action type="Rewrite" value="gzip"/>
        </rule>
      </outboundRules>
      
      <rules>
        <rule name="Rewrite gzip file">
          <match url="(.*)"/>
          <conditions>
            <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" />
            <add input="{REQUEST_FILENAME}.gz" matchType="IsFile" />
          </conditions>
          <action type="Rewrite" url="{R:1}.gz" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
0.97.4

2 months ago

0.97.2

2 months ago

0.97.0

3 months ago

0.97.1

3 months ago

0.96.0

3 months ago

0.95.8

4 months ago

0.95.6

4 months ago

0.95.7

4 months ago

0.95.5

4 months ago

0.95.4

4 months ago

0.95.2

4 months ago

0.95.0

4 months ago

0.87.0

10 months ago

0.91.4

6 months ago

0.91.0

7 months ago

0.93.0

5 months ago

0.91.2

7 months ago

0.88.0

10 months ago

0.88.1

10 months ago

0.88.2

10 months ago

0.90.0

7 months ago

0.92.0

6 months ago

0.94.0

5 months ago

0.89.3

9 months ago

0.87.1

10 months ago

0.89.0

9 months ago

0.89.1

9 months ago

0.89.2

9 months ago

0.86.0

10 months ago

0.83.1

11 months ago

0.85.0

11 months ago

0.83.0

11 months ago

0.84.4

11 months ago

0.84.5

11 months ago

0.84.6

11 months ago

0.84.0

11 months ago

0.84.1

11 months ago

0.84.2

11 months ago

0.84.3

11 months ago

0.23.1

1 year ago

0.23.0

1 year ago

0.82.0

1 year ago

0.22.0

1 year ago

0.21.0

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.19.1

2 years ago

0.21.1

1 year ago

0.18.1

2 years ago

0.18.2

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.15.0

2 years ago

0.14.1

2 years ago

0.15.1

2 years ago

0.15.2

2 years ago

0.15.3

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.12.7

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.11.1

2 years ago

0.13.0

2 years ago

0.12.1

2 years ago

0.11.2

2 years ago

0.12.2

2 years ago

0.11.3

2 years ago

0.12.3

2 years ago

0.11.4

2 years ago

0.12.4

2 years ago

0.11.5

2 years ago

0.12.5

2 years ago

0.12.6

2 years ago

0.10.0

2 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.6

3 years ago

0.6.5

3 years ago

0.6.3

3 years ago

0.6.4

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.2

3 years ago