@maptalks/3dtiles 0.117.1 → 0.118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,80 +1,80 @@
1
- # 3dtiles插件
2
- [![NPM Version](https://img.shields.io/npm/v/@maptalks/3dtiles.svg)](https://github.com/fuzhenn/3dtiles-issues)
3
-
4
- maptalks用于载入3dtiles数据的图层插件
5
-
6
- # 示例代码
7
- ```html
8
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/maptalks@next/dist/maptalks.min.js"></script>
9
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/gl/dist/maptalksgl.js"></script>
10
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/3dtiles@latest/dist/maptalks.3dtiles.js"></script>
11
- <script>
12
- const layer = new maptalks.Geo3DTilesLayer('3dtiles', {
13
- maxCacheSize : 1000, //缓存的最大瓦片数
14
- // loadingLimitOnInteracting : 1, //地图交互过程中瓦片请求最大数量
15
- // loadingLimit : 0, //瓦片请求最大数量
16
- services : [
17
- {
18
- url : 'path/to/tileset.json',
19
- // maximumScreenSpaceError值越小,加载的模型越清晰,但加载的数据量会变大
20
- // 清晰度可以接受的情况下,推荐把这个值设得越大越好,性能会越好
21
- maximumScreenSpaceError : 24.0,
22
- // urlParams : 'v=0.0',
23
- // ajaxOptions : { credentials : 'include' },
24
- // 把模型降低1200米
25
- heightOffset : -1200,
26
- ambientLight : [0.0, 0.0, 0.0],
27
- // maxExtent : maxExtent
28
- // ajaxInMainThread : true, //从主线程发起ajax请求,用于worker发起ajax报跨域错误
29
- },
30
- // 其他的3dtiles数据源
31
- ]
32
- });
33
- layer.addTo(map);
34
- </script>
35
-
36
- ```
37
-
38
- # 配置说明
39
- ## I3S数据gzip解压
40
-
41
- i3s数据默认都进行了gzip压缩(以.gz结尾),需要在http服务中配置url rewrite和gzip解压。
42
-
43
- ### IIS配置
44
- * 下载安装[url rewrite模块](https://www.iis.net/downloads/microsoft/url-rewrite)
45
- * 在文件夹目录下创建web.config,配置gz解压和url write:
46
- ```xml
47
- <?xml version="1.0" encoding="UTF-8"?>
48
- <configuration>
49
- <system.webServer>
50
- <staticContent>
51
- <remove fileExtension=".json.gz" />
52
- <remove fileExtension=".bin.gz" />
53
- <mimeMap fileExtension=".json.gz" mimeType="application/json" />
54
- <mimeMap fileExtension=".bin.gz" mimeType="application/octet-stream" />
55
- </staticContent>
56
- <rewrite>
57
- <outboundRules rewriteBeforeCache="true">
58
- <rule name="Custom gzip file header">
59
- <match serverVariable="RESPONSE_CONTENT_ENCODING" pattern=".*" />
60
- <conditions>
61
- <add input="{REQUEST_URI}" pattern="\.gz$" />
62
- </conditions>
63
- <action type="Rewrite" value="gzip"/>
64
- </rule>
65
- </outboundRules>
66
-
67
- <rules>
68
- <rule name="Rewrite gzip file">
69
- <match url="(.*)"/>
70
- <conditions>
71
- <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" />
72
- <add input="{REQUEST_FILENAME}.gz" matchType="IsFile" />
73
- </conditions>
74
- <action type="Rewrite" url="{R:1}.gz" />
75
- </rule>
76
- </rules>
77
- </rewrite>
78
- </system.webServer>
79
- </configuration>
80
- ```
1
+ # 3dtiles插件
2
+ [![NPM Version](https://img.shields.io/npm/v/@maptalks/3dtiles.svg)](https://github.com/fuzhenn/3dtiles-issues)
3
+
4
+ maptalks用于载入3dtiles数据的图层插件
5
+
6
+ # 示例代码
7
+ ```html
8
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/maptalks@next/dist/maptalks.min.js"></script>
9
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/gl/dist/maptalksgl.js"></script>
10
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@maptalks/3dtiles@latest/dist/maptalks.3dtiles.js"></script>
11
+ <script>
12
+ const layer = new maptalks.Geo3DTilesLayer('3dtiles', {
13
+ maxCacheSize : 1000, //缓存的最大瓦片数
14
+ // loadingLimitOnInteracting : 1, //地图交互过程中瓦片请求最大数量
15
+ // loadingLimit : 0, //瓦片请求最大数量
16
+ services : [
17
+ {
18
+ url : 'path/to/tileset.json',
19
+ // maximumScreenSpaceError值越小,加载的模型越清晰,但加载的数据量会变大
20
+ // 清晰度可以接受的情况下,推荐把这个值设得越大越好,性能会越好
21
+ maximumScreenSpaceError : 24.0,
22
+ // urlParams : 'v=0.0',
23
+ // ajaxOptions : { credentials : 'include' },
24
+ // 把模型降低1200米
25
+ heightOffset : -1200,
26
+ ambientLight : [0.0, 0.0, 0.0],
27
+ // maxExtent : maxExtent
28
+ // ajaxInMainThread : true, //从主线程发起ajax请求,用于worker发起ajax报跨域错误
29
+ },
30
+ // 其他的3dtiles数据源
31
+ ]
32
+ });
33
+ layer.addTo(map);
34
+ </script>
35
+
36
+ ```
37
+
38
+ # 配置说明
39
+ ## I3S数据gzip解压
40
+
41
+ i3s数据默认都进行了gzip压缩(以.gz结尾),需要在http服务中配置url rewrite和gzip解压。
42
+
43
+ ### IIS配置
44
+ * 下载安装[url rewrite模块](https://www.iis.net/downloads/microsoft/url-rewrite)
45
+ * 在文件夹目录下创建web.config,配置gz解压和url write:
46
+ ```xml
47
+ <?xml version="1.0" encoding="UTF-8"?>
48
+ <configuration>
49
+ <system.webServer>
50
+ <staticContent>
51
+ <remove fileExtension=".json.gz" />
52
+ <remove fileExtension=".bin.gz" />
53
+ <mimeMap fileExtension=".json.gz" mimeType="application/json" />
54
+ <mimeMap fileExtension=".bin.gz" mimeType="application/octet-stream" />
55
+ </staticContent>
56
+ <rewrite>
57
+ <outboundRules rewriteBeforeCache="true">
58
+ <rule name="Custom gzip file header">
59
+ <match serverVariable="RESPONSE_CONTENT_ENCODING" pattern=".*" />
60
+ <conditions>
61
+ <add input="{REQUEST_URI}" pattern="\.gz$" />
62
+ </conditions>
63
+ <action type="Rewrite" value="gzip"/>
64
+ </rule>
65
+ </outboundRules>
66
+
67
+ <rules>
68
+ <rule name="Rewrite gzip file">
69
+ <match url="(.*)"/>
70
+ <conditions>
71
+ <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" />
72
+ <add input="{REQUEST_FILENAME}.gz" matchType="IsFile" />
73
+ </conditions>
74
+ <action type="Rewrite" url="{R:1}.gz" />
75
+ </rule>
76
+ </rules>
77
+ </rewrite>
78
+ </system.webServer>
79
+ </configuration>
80
+ ```
@@ -1,6 +1,6 @@
1
1
  /// <reference types="gl-matrix" />
2
2
  /*!
3
- * @maptalks/3dtiles v0.117.1
3
+ * @maptalks/3dtiles v0.118.0
4
4
  * LICENSE : UNLICENSED
5
5
  * (c) 2016-2025 maptalks.org
6
6
  */
@@ -112,6 +112,7 @@ type Geo3DTilesLayerOptions = {
112
112
  'pickingPoint'?: boolean;
113
113
  'geometryEvents'?: boolean;
114
114
  'alwaysShowTopTiles'?: boolean;
115
+ 'heightOffsets'?: number;
115
116
  'antialias'?: boolean;
116
117
  'offset'?: number[] | OffsetFunction;
117
118
  'renderer'?: 'gl';