@antv/l7-scene 2.5.37-mini2 → 2.5.39
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/CHANGELOG.md +275 -0
- package/LICENSE.md +21 -0
- package/es/ILayerManager.d.ts +7 -0
- package/es/ILayerManager.js +2 -0
- package/es/ILayerManager.js.map +1 -0
- package/es/IMapController.d.ts +62 -0
- package/es/IMapController.js +2 -0
- package/es/IMapController.js.map +1 -0
- package/es/IPostProcessingPassPluggable.d.ts +9 -0
- package/es/IPostProcessingPassPluggable.js +2 -0
- package/es/IPostProcessingPassPluggable.js.map +1 -0
- package/es/index.d.ts +105 -0
- package/es/index.js +423 -0
- package/es/index.js.map +1 -0
- package/lib/index.js +6 -17
- package/lib/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [2.1.12](https://github.com/antvis/L7/compare/v2.1.11...v2.1.12) (2020-04-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* 绘制组件高德地图mousedown事件不能监听的问题 ([1eb3313](https://github.com/antvis/L7/commit/1eb3313919b2c7c9162bee70a249846b897ef4b4))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.1.11](https://github.com/antvis/L7/compare/v2.1.10...v2.1.11) (2020-04-07)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [2.1.8](https://github.com/antvis/L7/compare/v2.1.7...v2.1.8) (2020-03-26)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.1.7](https://github.com/antvis/L7/compare/v2.1.6...v2.1.7) (2020-03-26)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [2.1.5](https://github.com/antvis/L7/compare/v2.1.4...v2.1.5) (2020-03-20)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [2.1.3](https://github.com/antvis/L7/compare/v2.0.36...v2.1.3) (2020-03-17)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* mapbox 光照问题 ([20d2a6d](https://github.com/antvis/L7/commit/20d2a6d8b803ca3ad87cc1ef69a59d1e3d348cef))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## [2.1.2](https://github.com/antvis/L7/compare/v2.0.36...v2.1.2) (2020-03-15)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Bug Fixes
|
|
64
|
+
|
|
65
|
+
* mapbox 光照问题 ([20d2a6d](https://github.com/antvis/L7/commit/20d2a6d8b803ca3ad87cc1ef69a59d1e3d348cef))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [2.1.1](https://github.com/antvis/L7/compare/v2.0.36...v2.1.1) (2020-03-15)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Bug Fixes
|
|
75
|
+
|
|
76
|
+
* mapbox 光照问题 ([20d2a6d](https://github.com/antvis/L7/commit/20d2a6d8b803ca3ad87cc1ef69a59d1e3d348cef))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## [2.0.34](https://github.com/antvis/L7/compare/v2.0.32...v2.0.34) (2020-03-02)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [2.0.0-beta.28](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.28) (2020-01-02)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# [2.0.0-beta.27](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.27) (2020-01-01)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Features
|
|
105
|
+
|
|
106
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# [2.0.0-alpha.28](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-alpha.28) (2020-01-01)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Features
|
|
116
|
+
|
|
117
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# [2.0.0-alpha.27](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-alpha.27) (2019-12-31)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Features
|
|
127
|
+
|
|
128
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# [2.0.0-beta.26](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.26) (2019-12-30)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### Features
|
|
138
|
+
|
|
139
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# [2.0.0-beta.25](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.25) (2019-12-27)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Features
|
|
149
|
+
|
|
150
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# [2.0.0-beta.24](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.24) (2019-12-23)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Features
|
|
160
|
+
|
|
161
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
# [2.0.0-beta.23](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.23) (2019-12-23)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Features
|
|
171
|
+
|
|
172
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# [2.0.0-beta.21](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.21) (2019-12-18)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
### Features
|
|
182
|
+
|
|
183
|
+
* scene 实例化支持传入地图实例 & 更新文档 ([cb1d4b6](https://github.com/antvis/L7/commit/cb1d4b6c7d0e65a5e15138ae01adb56cd1b6ee43))
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
# [2.0.0-beta.20](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.20) (2019-12-12)
|
|
190
|
+
|
|
191
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# [2.0.0-beta.19](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.19) (2019-12-08)
|
|
198
|
+
|
|
199
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# [2.0.0-beta.18](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.18) (2019-12-08)
|
|
206
|
+
|
|
207
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
# [2.0.0-beta.17](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2019-12-08)
|
|
214
|
+
|
|
215
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# [2.0.0-beta.16](https://github.com/antvis/L7/compare/v2.0.0-beta.15...v2.0.0-beta.16) (2019-11-29)
|
|
222
|
+
|
|
223
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
# [2.0.0-beta.15](https://github.com/antvis/L7/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2019-11-29)
|
|
230
|
+
|
|
231
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
# [2.0.0-beta.13](https://github.com/antvis/L7/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2019-11-28)
|
|
238
|
+
|
|
239
|
+
**Note:** Version bump only for package @antv/l7-scene
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
# [2.0.0-beta.12](https://github.com/antvis/L7/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2019-11-28)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
### Bug Fixes
|
|
249
|
+
|
|
250
|
+
* **component:** fix marker ([14d4818](https://github.com/antvis/L7/commit/14d48184a1579241b077110ed51a8358de25e010))
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# 2.0.0-beta.11 (2019-11-28)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
### Bug Fixes
|
|
260
|
+
|
|
261
|
+
* **merge branch:** fix confilt ([e7a46a6](https://github.com/antvis/L7/commit/e7a46a691d9e67a03d733fd565c6b152ee8715b6))
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
### Features
|
|
265
|
+
|
|
266
|
+
* **add l7 site:** add websites ([0463ff8](https://github.com/antvis/L7/commit/0463ff874eab1c484b593e8c02f73c85a02c000c))
|
|
267
|
+
* **component:** add layer control ([7f4646e](https://github.com/antvis/L7/commit/7f4646efd3b0004fde4e9f6860e618c7668af1a7))
|
|
268
|
+
* **component:** add scale ,zoom, popup, marker map method ([a6baef4](https://github.com/antvis/L7/commit/a6baef4954c11d9c6582c27de2ba667f18538460))
|
|
269
|
+
* **core:** add map method ([853c190](https://github.com/antvis/L7/commit/853c1901fbb8559a9d3bdb3631ec13a7dcaf0ea7))
|
|
270
|
+
* **map:** adjust Scene API, use @antv/l7-maps instead ([77b8f21](https://github.com/antvis/L7/commit/77b8f21b0bcf8b06e88d8e0bef213935bf32b957)), closes [#86](https://github.com/antvis/L7/issues/86)
|
|
271
|
+
* **multi-pass:** support TAA(Temporal Anti-Aliasing) ([2cf0824](https://github.com/antvis/L7/commit/2cf082439ad04eb84b96b2922e45082476452aec))
|
|
272
|
+
* **picking:** support PixelPickingPass and highlight the picked feature ([ff0ffa0](https://github.com/antvis/L7/commit/ff0ffa057e2f533dc6ac92f40d3892f9dd57fafb))
|
|
273
|
+
* **point image:** add point image ([89b2513](https://github.com/antvis/L7/commit/89b25133a17f308c3e884c49baebcd3cc7a9470a))
|
|
274
|
+
* **post-processing:** add some post processing effects ([1d8e15c](https://github.com/antvis/L7/commit/1d8e15cec11abc62785bc68c8281550732550839))
|
|
275
|
+
* **scene:** scene service inTransientScope ([ccf1ff4](https://github.com/antvis/L7/commit/ccf1ff464e1b220650e61c0999846725b075ef3a))
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Alipay.inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"ILayerManager.js"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Bounds, ICameraOptions, ILngLat, IPoint, IStatusOptions, Point } from '@antv/l7-core';
|
|
2
|
+
export default interface IMapController {
|
|
3
|
+
/**
|
|
4
|
+
* 当前缩放等级
|
|
5
|
+
*/
|
|
6
|
+
getZoom(): number;
|
|
7
|
+
/**
|
|
8
|
+
* 中心点经纬度
|
|
9
|
+
*/
|
|
10
|
+
getCenter(options?: ICameraOptions): ILngLat;
|
|
11
|
+
/**
|
|
12
|
+
* 仰角
|
|
13
|
+
*/
|
|
14
|
+
getPitch(): number;
|
|
15
|
+
/**
|
|
16
|
+
* 逆时针旋转角度
|
|
17
|
+
*/
|
|
18
|
+
getRotation(): number;
|
|
19
|
+
/**
|
|
20
|
+
* 获取当前地图可视区域 `[西南角、东北角]`
|
|
21
|
+
*/
|
|
22
|
+
getBounds(): Bounds;
|
|
23
|
+
/**
|
|
24
|
+
* 放大地图
|
|
25
|
+
*/
|
|
26
|
+
zoomIn(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 缩小地图
|
|
29
|
+
*/
|
|
30
|
+
zoomOut(): void;
|
|
31
|
+
/**
|
|
32
|
+
* 地图平移到指定点 `[x, y]`
|
|
33
|
+
*/
|
|
34
|
+
panTo(p: Point): void;
|
|
35
|
+
/**
|
|
36
|
+
* 地图平移到指定点 `[x, y]`
|
|
37
|
+
*/
|
|
38
|
+
panBy(x: number, y: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* 调整地图适合指定区域
|
|
41
|
+
*/
|
|
42
|
+
fitBounds(bound: Bounds, fitBoundsOptions?: unknown): void;
|
|
43
|
+
getContainer(): HTMLElement | null;
|
|
44
|
+
getSize(): [number, number];
|
|
45
|
+
getMinZoom(): number;
|
|
46
|
+
getMaxZoom(): number;
|
|
47
|
+
getType(): string;
|
|
48
|
+
getMapContainer(): HTMLElement | null;
|
|
49
|
+
getMapCanvasContainer(): HTMLElement;
|
|
50
|
+
setRotation(rotation: number): void;
|
|
51
|
+
setZoomAndCenter(zoom: number, center: Point): void;
|
|
52
|
+
setCenter(center: [number, number], options?: ICameraOptions): void;
|
|
53
|
+
setPitch(pitch: number): void;
|
|
54
|
+
setZoom(zoom: number): void;
|
|
55
|
+
setMapStyle(style: any): void;
|
|
56
|
+
setMapStatus(option: Partial<IStatusOptions>): void;
|
|
57
|
+
pixelToLngLat(pixel: Point): ILngLat;
|
|
58
|
+
lngLatToPixel(lnglat: Point): IPoint;
|
|
59
|
+
containerToLngLat(pixel: Point): ILngLat;
|
|
60
|
+
lngLatToContainer(lnglat: Point): IPoint;
|
|
61
|
+
exportMap(type: 'jpg' | 'png'): string;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IMapController.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPostProcessingPass } from '@antv/l7-core';
|
|
2
|
+
export default interface IPostProcessingPassPluggable {
|
|
3
|
+
/**
|
|
4
|
+
* 注册自定义后处理效果
|
|
5
|
+
* @param constructor 效果构造函数
|
|
6
|
+
* @param name 效果名,便于在 Layer 中引用
|
|
7
|
+
*/
|
|
8
|
+
registerPostProcessingPass(constructor: new (...args: any[]) => IPostProcessingPass<unknown>, name: string): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IPostProcessingPassPluggable.js"}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Bounds, ICameraOptions, IControl, IIconFontGlyph, IImage, ILayer, ILngLat, IMapService, IMarker, IMarkerLayer, IPoint, IPopup, IPostProcessingPass, ISceneConfig, IStatusOptions, Point } from '@antv/l7-core';
|
|
2
|
+
import { Container } from 'inversify';
|
|
3
|
+
import ILayerManager from './ILayerManager';
|
|
4
|
+
import IMapController from './IMapController';
|
|
5
|
+
import IPostProcessingPassPluggable from './IPostProcessingPassPluggable';
|
|
6
|
+
/**
|
|
7
|
+
* 暴露 Scene API
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { Scene } from 'l7/scene';
|
|
11
|
+
* import { PointLayer } from 'l7/layers';
|
|
12
|
+
*
|
|
13
|
+
* const scene = new Scene();
|
|
14
|
+
* const pointLayer = new PointLayer();
|
|
15
|
+
* scene.addLayer(pointLayer);
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
declare class Scene implements IPostProcessingPassPluggable, IMapController, ILayerManager {
|
|
19
|
+
private sceneService;
|
|
20
|
+
private mapService;
|
|
21
|
+
private controlService;
|
|
22
|
+
private layerService;
|
|
23
|
+
private iconService;
|
|
24
|
+
private markerService;
|
|
25
|
+
private popupService;
|
|
26
|
+
private fontService;
|
|
27
|
+
private interactionService;
|
|
28
|
+
private container;
|
|
29
|
+
constructor(config: ISceneConfig);
|
|
30
|
+
getServiceContainer(): Container;
|
|
31
|
+
getSize(): [number, number];
|
|
32
|
+
getMinZoom(): number;
|
|
33
|
+
getMaxZoom(): number;
|
|
34
|
+
getType(): string;
|
|
35
|
+
getMapContainer(): HTMLElement | null;
|
|
36
|
+
getMapCanvasContainer(): HTMLElement;
|
|
37
|
+
getMapService(): IMapService<unknown>;
|
|
38
|
+
exportPng(type?: 'png' | 'jpg'): string;
|
|
39
|
+
exportMap(type?: 'png' | 'jpg'): string;
|
|
40
|
+
registerRenderService(render: any): void;
|
|
41
|
+
get map(): unknown;
|
|
42
|
+
setBgColor(color: string): void;
|
|
43
|
+
addLayer(layer: ILayer): void;
|
|
44
|
+
getLayers(): ILayer[];
|
|
45
|
+
getLayer(id: string): ILayer | undefined;
|
|
46
|
+
getLayerByName(name: string): ILayer | undefined;
|
|
47
|
+
removeLayer(layer: ILayer, parentLayer?: ILayer): void;
|
|
48
|
+
removeAllLayer(): void;
|
|
49
|
+
render(): void;
|
|
50
|
+
/**
|
|
51
|
+
* 为 layer/point/text 支持 iconfont 模式支持
|
|
52
|
+
* @param fontUnicode
|
|
53
|
+
* @param name
|
|
54
|
+
*/
|
|
55
|
+
addIconFont(name: string, fontUnicode: string): void;
|
|
56
|
+
addIconFonts(options: string[][]): void;
|
|
57
|
+
/**
|
|
58
|
+
* 用户自定义添加第三方字体
|
|
59
|
+
* @param fontFamily
|
|
60
|
+
* @param fontPath
|
|
61
|
+
*/
|
|
62
|
+
addFontFace(fontFamily: string, fontPath: string): void;
|
|
63
|
+
addImage(id: string, img: IImage): void;
|
|
64
|
+
hasImage(id: string): boolean;
|
|
65
|
+
removeImage(id: string): void;
|
|
66
|
+
addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]): void;
|
|
67
|
+
addControl(ctr: IControl): void;
|
|
68
|
+
removeControl(ctr: IControl): void;
|
|
69
|
+
getControlByName(name: string): IControl | undefined;
|
|
70
|
+
addMarker(marker: IMarker): void;
|
|
71
|
+
addMarkerLayer(layer: IMarkerLayer): void;
|
|
72
|
+
removeMarkerLayer(layer: IMarkerLayer): void;
|
|
73
|
+
removeAllMakers(): void;
|
|
74
|
+
addPopup(popup: IPopup): void;
|
|
75
|
+
on(type: string, handle: (...args: any[]) => void): void;
|
|
76
|
+
once(type: string, handle: (...args: any[]) => void): void;
|
|
77
|
+
off(type: string, handle: (...args: any[]) => void): void;
|
|
78
|
+
getZoom(): number;
|
|
79
|
+
getCenter(options?: ICameraOptions): ILngLat;
|
|
80
|
+
setCenter(center: [number, number], options?: ICameraOptions): void;
|
|
81
|
+
getPitch(): number;
|
|
82
|
+
setPitch(pitch: number): void;
|
|
83
|
+
getRotation(): number;
|
|
84
|
+
getBounds(): Bounds;
|
|
85
|
+
setRotation(rotation: number): void;
|
|
86
|
+
zoomIn(): void;
|
|
87
|
+
zoomOut(): void;
|
|
88
|
+
panTo(p: Point): void;
|
|
89
|
+
panBy(x: number, y: number): void;
|
|
90
|
+
getContainer(): HTMLElement | null;
|
|
91
|
+
setZoom(zoom: number): void;
|
|
92
|
+
fitBounds(bound: Bounds, options?: unknown): void;
|
|
93
|
+
setZoomAndCenter(zoom: number, center: Point): void;
|
|
94
|
+
setMapStyle(style: any): void;
|
|
95
|
+
setMapStatus(options: Partial<IStatusOptions>): void;
|
|
96
|
+
pixelToLngLat(pixel: Point): ILngLat;
|
|
97
|
+
lngLatToPixel(lnglat: Point): IPoint;
|
|
98
|
+
containerToLngLat(pixel: Point): ILngLat;
|
|
99
|
+
lngLatToContainer(lnglat: Point): IPoint;
|
|
100
|
+
destroy(): void;
|
|
101
|
+
registerPostProcessingPass(constructor: new (...args: any[]) => IPostProcessingPass<unknown>, name: string): void;
|
|
102
|
+
private initComponent;
|
|
103
|
+
private initControl;
|
|
104
|
+
}
|
|
105
|
+
export { Scene };
|
package/es/index.js
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
|
|
6
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
+
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9
|
+
|
|
10
|
+
import { Logo } from '@antv/l7-component';
|
|
11
|
+
import { createLayerContainer, createSceneContainer, SceneEventList, TYPES } from '@antv/l7-core';
|
|
12
|
+
import { ReglRendererService } from '@antv/l7-renderer';
|
|
13
|
+
import { DOM } from '@antv/l7-utils';
|
|
14
|
+
|
|
15
|
+
var Scene = function () {
|
|
16
|
+
function Scene(config) {
|
|
17
|
+
_classCallCheck(this, Scene);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "sceneService", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "mapService", void 0);
|
|
22
|
+
|
|
23
|
+
_defineProperty(this, "controlService", void 0);
|
|
24
|
+
|
|
25
|
+
_defineProperty(this, "layerService", void 0);
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "iconService", void 0);
|
|
28
|
+
|
|
29
|
+
_defineProperty(this, "markerService", void 0);
|
|
30
|
+
|
|
31
|
+
_defineProperty(this, "popupService", void 0);
|
|
32
|
+
|
|
33
|
+
_defineProperty(this, "fontService", void 0);
|
|
34
|
+
|
|
35
|
+
_defineProperty(this, "interactionService", void 0);
|
|
36
|
+
|
|
37
|
+
_defineProperty(this, "container", void 0);
|
|
38
|
+
|
|
39
|
+
var id = config.id,
|
|
40
|
+
map = config.map;
|
|
41
|
+
var sceneContainer = createSceneContainer();
|
|
42
|
+
this.container = sceneContainer;
|
|
43
|
+
map.setContainer(sceneContainer, id);
|
|
44
|
+
sceneContainer.bind(TYPES.IRendererService).to(ReglRendererService).inSingletonScope();
|
|
45
|
+
this.sceneService = sceneContainer.get(TYPES.ISceneService);
|
|
46
|
+
this.mapService = sceneContainer.get(TYPES.IMapService);
|
|
47
|
+
this.iconService = sceneContainer.get(TYPES.IIconService);
|
|
48
|
+
this.fontService = sceneContainer.get(TYPES.IFontService);
|
|
49
|
+
this.controlService = sceneContainer.get(TYPES.IControlService);
|
|
50
|
+
this.layerService = sceneContainer.get(TYPES.ILayerService);
|
|
51
|
+
this.markerService = sceneContainer.get(TYPES.IMarkerService);
|
|
52
|
+
this.interactionService = sceneContainer.get(TYPES.IInteractionService);
|
|
53
|
+
this.popupService = sceneContainer.get(TYPES.IPopupService);
|
|
54
|
+
this.initComponent(id);
|
|
55
|
+
this.sceneService.init(config);
|
|
56
|
+
this.initControl();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_createClass(Scene, [{
|
|
60
|
+
key: "getServiceContainer",
|
|
61
|
+
value: function getServiceContainer() {
|
|
62
|
+
return this.container;
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "getSize",
|
|
66
|
+
value: function getSize() {
|
|
67
|
+
return this.mapService.getSize();
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "getMinZoom",
|
|
71
|
+
value: function getMinZoom() {
|
|
72
|
+
return this.mapService.getMinZoom();
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "getMaxZoom",
|
|
76
|
+
value: function getMaxZoom() {
|
|
77
|
+
return this.mapService.getMaxZoom();
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "getType",
|
|
81
|
+
value: function getType() {
|
|
82
|
+
return this.mapService.getType();
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "getMapContainer",
|
|
86
|
+
value: function getMapContainer() {
|
|
87
|
+
return this.mapService.getMapContainer();
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "getMapCanvasContainer",
|
|
91
|
+
value: function getMapCanvasContainer() {
|
|
92
|
+
return this.mapService.getMapCanvasContainer();
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "getMapService",
|
|
96
|
+
value: function getMapService() {
|
|
97
|
+
return this.mapService;
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "exportPng",
|
|
101
|
+
value: function exportPng(type) {
|
|
102
|
+
return this.sceneService.exportPng(type);
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "exportMap",
|
|
106
|
+
value: function exportMap(type) {
|
|
107
|
+
return this.sceneService.exportPng(type);
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "registerRenderService",
|
|
111
|
+
value: function registerRenderService(render) {
|
|
112
|
+
var _this = this;
|
|
113
|
+
|
|
114
|
+
if (this.sceneService.loaded) {
|
|
115
|
+
var renderSerivce = new render(this);
|
|
116
|
+
renderSerivce.init();
|
|
117
|
+
} else {
|
|
118
|
+
this.on('loaded', function () {
|
|
119
|
+
var renderSerivce = new render(_this);
|
|
120
|
+
renderSerivce.init();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "map",
|
|
126
|
+
get: function get() {
|
|
127
|
+
return this.mapService.map;
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "setBgColor",
|
|
131
|
+
value: function setBgColor(color) {
|
|
132
|
+
this.mapService.setBgColor(color);
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "addLayer",
|
|
136
|
+
value: function addLayer(layer) {
|
|
137
|
+
var layerContainer = createLayerContainer(this.container);
|
|
138
|
+
layer.setContainer(layerContainer, this.container);
|
|
139
|
+
this.sceneService.addLayer(layer);
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "getLayers",
|
|
143
|
+
value: function getLayers() {
|
|
144
|
+
return this.layerService.getLayers();
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "getLayer",
|
|
148
|
+
value: function getLayer(id) {
|
|
149
|
+
return this.layerService.getLayer(id);
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "getLayerByName",
|
|
153
|
+
value: function getLayerByName(name) {
|
|
154
|
+
return this.layerService.getLayerByName(name);
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "removeLayer",
|
|
158
|
+
value: function removeLayer(layer, parentLayer) {
|
|
159
|
+
this.layerService.remove(layer, parentLayer);
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "removeAllLayer",
|
|
163
|
+
value: function removeAllLayer() {
|
|
164
|
+
this.layerService.removeAllLayers();
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "render",
|
|
168
|
+
value: function render() {
|
|
169
|
+
this.sceneService.render();
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
key: "addIconFont",
|
|
173
|
+
value: function addIconFont(name, fontUnicode) {
|
|
174
|
+
this.fontService.addIconFont(name, fontUnicode);
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
key: "addIconFonts",
|
|
178
|
+
value: function addIconFonts(options) {
|
|
179
|
+
var _this2 = this;
|
|
180
|
+
|
|
181
|
+
options.forEach(function (_ref) {
|
|
182
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
183
|
+
name = _ref2[0],
|
|
184
|
+
fontUnicode = _ref2[1];
|
|
185
|
+
|
|
186
|
+
_this2.fontService.addIconFont(name, fontUnicode);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
key: "addFontFace",
|
|
191
|
+
value: function addFontFace(fontFamily, fontPath) {
|
|
192
|
+
this.sceneService.addFontFace(fontFamily, fontPath);
|
|
193
|
+
}
|
|
194
|
+
}, {
|
|
195
|
+
key: "addImage",
|
|
196
|
+
value: function addImage(id, img) {
|
|
197
|
+
this.iconService.addImage(id, img);
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
key: "hasImage",
|
|
201
|
+
value: function hasImage(id) {
|
|
202
|
+
return this.iconService.hasImage(id);
|
|
203
|
+
}
|
|
204
|
+
}, {
|
|
205
|
+
key: "removeImage",
|
|
206
|
+
value: function removeImage(id) {
|
|
207
|
+
this.iconService.removeImage(id);
|
|
208
|
+
}
|
|
209
|
+
}, {
|
|
210
|
+
key: "addIconFontGlyphs",
|
|
211
|
+
value: function addIconFontGlyphs(fontFamily, glyphs) {
|
|
212
|
+
this.fontService.addIconGlyphs(glyphs);
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
key: "addControl",
|
|
216
|
+
value: function addControl(ctr) {
|
|
217
|
+
this.controlService.addControl(ctr, this.container);
|
|
218
|
+
}
|
|
219
|
+
}, {
|
|
220
|
+
key: "removeControl",
|
|
221
|
+
value: function removeControl(ctr) {
|
|
222
|
+
this.controlService.removeControl(ctr);
|
|
223
|
+
}
|
|
224
|
+
}, {
|
|
225
|
+
key: "getControlByName",
|
|
226
|
+
value: function getControlByName(name) {
|
|
227
|
+
return this.controlService.getControlByName(name);
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
key: "addMarker",
|
|
231
|
+
value: function addMarker(marker) {
|
|
232
|
+
this.markerService.addMarker(marker);
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "addMarkerLayer",
|
|
236
|
+
value: function addMarkerLayer(layer) {
|
|
237
|
+
this.markerService.addMarkerLayer(layer);
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "removeMarkerLayer",
|
|
241
|
+
value: function removeMarkerLayer(layer) {
|
|
242
|
+
this.markerService.removeMarkerLayer(layer);
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
key: "removeAllMakers",
|
|
246
|
+
value: function removeAllMakers() {
|
|
247
|
+
this.markerService.removeAllMarkers();
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "addPopup",
|
|
251
|
+
value: function addPopup(popup) {
|
|
252
|
+
this.popupService.addPopup(popup);
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "on",
|
|
256
|
+
value: function on(type, handle) {
|
|
257
|
+
SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.on(type, handle);
|
|
258
|
+
}
|
|
259
|
+
}, {
|
|
260
|
+
key: "once",
|
|
261
|
+
value: function once(type, handle) {
|
|
262
|
+
SceneEventList.indexOf(type) === -1 ? this.mapService.once(type, handle) : this.sceneService.once(type, handle);
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
key: "off",
|
|
266
|
+
value: function off(type, handle) {
|
|
267
|
+
SceneEventList.indexOf(type) === -1 ? this.mapService.off(type, handle) : this.sceneService.off(type, handle);
|
|
268
|
+
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "getZoom",
|
|
271
|
+
value: function getZoom() {
|
|
272
|
+
return this.mapService.getZoom();
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
key: "getCenter",
|
|
276
|
+
value: function getCenter(options) {
|
|
277
|
+
return this.mapService.getCenter(options);
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "setCenter",
|
|
281
|
+
value: function setCenter(center, options) {
|
|
282
|
+
return this.mapService.setCenter(center, options);
|
|
283
|
+
}
|
|
284
|
+
}, {
|
|
285
|
+
key: "getPitch",
|
|
286
|
+
value: function getPitch() {
|
|
287
|
+
return this.mapService.getPitch();
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
key: "setPitch",
|
|
291
|
+
value: function setPitch(pitch) {
|
|
292
|
+
return this.mapService.setPitch(pitch);
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "getRotation",
|
|
296
|
+
value: function getRotation() {
|
|
297
|
+
return this.mapService.getRotation();
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
key: "getBounds",
|
|
301
|
+
value: function getBounds() {
|
|
302
|
+
return this.mapService.getBounds();
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
key: "setRotation",
|
|
306
|
+
value: function setRotation(rotation) {
|
|
307
|
+
this.mapService.setRotation(rotation);
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "zoomIn",
|
|
311
|
+
value: function zoomIn() {
|
|
312
|
+
this.mapService.zoomIn();
|
|
313
|
+
}
|
|
314
|
+
}, {
|
|
315
|
+
key: "zoomOut",
|
|
316
|
+
value: function zoomOut() {
|
|
317
|
+
this.mapService.zoomOut();
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "panTo",
|
|
321
|
+
value: function panTo(p) {
|
|
322
|
+
this.mapService.panTo(p);
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
325
|
+
key: "panBy",
|
|
326
|
+
value: function panBy(x, y) {
|
|
327
|
+
this.mapService.panBy(x, y);
|
|
328
|
+
}
|
|
329
|
+
}, {
|
|
330
|
+
key: "getContainer",
|
|
331
|
+
value: function getContainer() {
|
|
332
|
+
return this.mapService.getContainer();
|
|
333
|
+
}
|
|
334
|
+
}, {
|
|
335
|
+
key: "setZoom",
|
|
336
|
+
value: function setZoom(zoom) {
|
|
337
|
+
this.mapService.setZoom(zoom);
|
|
338
|
+
}
|
|
339
|
+
}, {
|
|
340
|
+
key: "fitBounds",
|
|
341
|
+
value: function fitBounds(bound, options) {
|
|
342
|
+
var _this$sceneService$ge = this.sceneService.getSceneConfig(),
|
|
343
|
+
fitBoundsOptions = _this$sceneService$ge.fitBoundsOptions,
|
|
344
|
+
animate = _this$sceneService$ge.animate;
|
|
345
|
+
|
|
346
|
+
this.mapService.fitBounds(bound, options || _objectSpread(_objectSpread({}, fitBoundsOptions), {}, {
|
|
347
|
+
animate: animate
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
}, {
|
|
351
|
+
key: "setZoomAndCenter",
|
|
352
|
+
value: function setZoomAndCenter(zoom, center) {
|
|
353
|
+
this.mapService.setZoomAndCenter(zoom, center);
|
|
354
|
+
}
|
|
355
|
+
}, {
|
|
356
|
+
key: "setMapStyle",
|
|
357
|
+
value: function setMapStyle(style) {
|
|
358
|
+
this.mapService.setMapStyle(style);
|
|
359
|
+
}
|
|
360
|
+
}, {
|
|
361
|
+
key: "setMapStatus",
|
|
362
|
+
value: function setMapStatus(options) {
|
|
363
|
+
this.mapService.setMapStatus(options);
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "pixelToLngLat",
|
|
367
|
+
value: function pixelToLngLat(pixel) {
|
|
368
|
+
return this.mapService.pixelToLngLat(pixel);
|
|
369
|
+
}
|
|
370
|
+
}, {
|
|
371
|
+
key: "lngLatToPixel",
|
|
372
|
+
value: function lngLatToPixel(lnglat) {
|
|
373
|
+
return this.mapService.lngLatToPixel(lnglat);
|
|
374
|
+
}
|
|
375
|
+
}, {
|
|
376
|
+
key: "containerToLngLat",
|
|
377
|
+
value: function containerToLngLat(pixel) {
|
|
378
|
+
return this.mapService.containerToLngLat(pixel);
|
|
379
|
+
}
|
|
380
|
+
}, {
|
|
381
|
+
key: "lngLatToContainer",
|
|
382
|
+
value: function lngLatToContainer(lnglat) {
|
|
383
|
+
return this.mapService.lngLatToContainer(lnglat);
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
key: "destroy",
|
|
387
|
+
value: function destroy() {
|
|
388
|
+
this.sceneService.destroy();
|
|
389
|
+
}
|
|
390
|
+
}, {
|
|
391
|
+
key: "registerPostProcessingPass",
|
|
392
|
+
value: function registerPostProcessingPass(constructor, name) {
|
|
393
|
+
this.container.bind(TYPES.IPostProcessingPass).to(constructor).whenTargetNamed(name);
|
|
394
|
+
}
|
|
395
|
+
}, {
|
|
396
|
+
key: "initComponent",
|
|
397
|
+
value: function initComponent(id) {
|
|
398
|
+
this.controlService.init({
|
|
399
|
+
container: DOM.getContainer(id)
|
|
400
|
+
}, this.container);
|
|
401
|
+
this.markerService.init(this.container);
|
|
402
|
+
this.popupService.init(this.container);
|
|
403
|
+
}
|
|
404
|
+
}, {
|
|
405
|
+
key: "initControl",
|
|
406
|
+
value: function initControl() {
|
|
407
|
+
var _this$sceneService$ge2 = this.sceneService.getSceneConfig(),
|
|
408
|
+
logoVisible = _this$sceneService$ge2.logoVisible,
|
|
409
|
+
logoPosition = _this$sceneService$ge2.logoPosition;
|
|
410
|
+
|
|
411
|
+
if (logoVisible) {
|
|
412
|
+
this.addControl(new Logo({
|
|
413
|
+
position: logoPosition
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}]);
|
|
418
|
+
|
|
419
|
+
return Scene;
|
|
420
|
+
}();
|
|
421
|
+
|
|
422
|
+
export { Scene };
|
|
423
|
+
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["Logo","createLayerContainer","createSceneContainer","SceneEventList","TYPES","ReglRendererService","DOM","Scene","config","id","map","sceneContainer","container","setContainer","bind","IRendererService","to","inSingletonScope","sceneService","get","ISceneService","mapService","IMapService","iconService","IIconService","fontService","IFontService","controlService","IControlService","layerService","ILayerService","markerService","IMarkerService","interactionService","IInteractionService","popupService","IPopupService","initComponent","init","initControl","getSize","getMinZoom","getMaxZoom","getType","getMapContainer","getMapCanvasContainer","type","exportPng","render","loaded","renderSerivce","on","color","setBgColor","layer","layerContainer","addLayer","getLayers","getLayer","name","getLayerByName","parentLayer","remove","removeAllLayers","fontUnicode","addIconFont","options","forEach","fontFamily","fontPath","addFontFace","img","addImage","hasImage","removeImage","glyphs","addIconGlyphs","ctr","addControl","removeControl","getControlByName","marker","addMarker","addMarkerLayer","removeMarkerLayer","removeAllMarkers","popup","addPopup","handle","indexOf","once","off","getZoom","getCenter","center","setCenter","getPitch","pitch","setPitch","getRotation","getBounds","rotation","setRotation","zoomIn","zoomOut","p","panTo","x","y","panBy","getContainer","zoom","setZoom","bound","getSceneConfig","fitBoundsOptions","animate","fitBounds","setZoomAndCenter","style","setMapStyle","setMapStatus","pixel","pixelToLngLat","lnglat","lngLatToPixel","containerToLngLat","lngLatToContainer","destroy","constructor","IPostProcessingPass","whenTargetNamed","logoVisible","logoPosition","position"],"mappings":";;;;;;;;;AAAA,SAASA,IAAT,QAAqB,oBAArB;AACA,SAEEC,oBAFF,EAGEC,oBAHF,EA4BEC,cA5BF,EA6BEC,KA7BF,QA8BO,eA9BP;AA+BA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,GAAT,QAAoB,gBAApB;;IAkBMC,K;AAaJ,iBAAmBC,MAAnB,EAAyC;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACvC,QAAQC,EAAR,GAAoBD,MAApB,CAAQC,EAAR;AAAA,QAAYC,GAAZ,GAAoBF,MAApB,CAAYE,GAAZ;AAEA,QAAMC,cAAc,GAAGT,oBAAoB,EAA3C;AACA,SAAKU,SAAL,GAAiBD,cAAjB;AAEAD,IAAAA,GAAG,CAACG,YAAJ,CAAiBF,cAAjB,EAAiCF,EAAjC;AAGAE,IAAAA,cAAc,CACXG,IADH,CAC0BV,KAAK,CAACW,gBADhC,E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B,CAAkCJ,KAAlC,CAAP;AACD;;;WAED,2BAAyBE,MAAzB,EAAgD;AAC9C,aAAO,KAAKvG,UAAL,CAAgB0G,iBAAhB,CAAkCH,MAAlC,CAAP;AACD;;;WAED,mBAAiB;AACf,WAAK1G,YAAL,CAAkB8G,OAAlB;AAED;;;WAED,oCACEC,WADF,EAEEtE,IAFF,EAGE;AACA,WAAK/C,SAAL,CACGE,IADH,CACsCV,KAAK,CAAC8H,mBAD5C,EAEGlH,EAFH,CAEMiH,WAFN,EAGGE,eAHH,CAGmBxE,IAHnB;AAID;;;WAED,uBAAsBlD,EAAtB,EAAmD;AACjD,WAAKkB,cAAL,CAAoBW,IAApB,CACE;AACE1B,QAAAA,SAAS,EAAEN,GAAG,CAACwG,YAAJ,CAAiBrG,EAAjB;AADb,OADF,EAIE,KAAKG,SAJP;AAMA,WAAKmB,aAAL,CAAmBO,IAAnB,CAAwB,KAAK1B,SAA7B;AACA,WAAKuB,YAAL,CAAkBG,IAAlB,CAAuB,KAAK1B,SAA5B;AACD;;;WAED,uBAAsB;AACpB,mCAAsC,KAAKM,YAAL,CAAkBgG,cAAlB,EAAtC;AAAA,UAAQkB,WAAR,0BAAQA,WAAR;AAAA,UAAqBC,YAArB,0BAAqBA,YAArB;;AACA,UAAID,WAAJ,EAAiB;AACf,aAAKtD,UAAL,CAAgB,IAAI9E,IAAJ,CAAS;AAAEsI,UAAAA,QAAQ,EAAED;AAAZ,SAAT,CAAhB;AACD;AACF;;;;;;AAIH,SAAS9H,KAAT","sourcesContent":["import { Logo } from '@antv/l7-component';\nimport {\n Bounds,\n createLayerContainer,\n createSceneContainer,\n ICameraOptions,\n IControl,\n IControlService,\n IFontService,\n IIconFontGlyph,\n IIconService,\n IImage,\n IInteractionService,\n ILayer,\n ILayerService,\n ILngLat,\n IMapService,\n IMarker,\n IMarkerLayer,\n IMarkerService,\n IPoint,\n IPopup,\n IPopupService,\n IPostProcessingPass,\n IRendererService,\n ISceneConfig,\n ISceneService,\n IStatusOptions,\n Point,\n SceneEventList,\n TYPES,\n} from '@antv/l7-core';\nimport { ReglRendererService } from '@antv/l7-renderer';\nimport { DOM } from '@antv/l7-utils';\nimport { Container } from 'inversify';\nimport ILayerManager from './ILayerManager';\nimport IMapController from './IMapController';\nimport IPostProcessingPassPluggable from './IPostProcessingPassPluggable';\n\n/**\n * 暴露 Scene API\n *\n * @example\n * import { Scene } from 'l7/scene';\n * import { PointLayer } from 'l7/layers';\n *\n * const scene = new Scene();\n * const pointLayer = new PointLayer();\n * scene.addLayer(pointLayer);\n *\n */\nclass Scene\n implements IPostProcessingPassPluggable, IMapController, ILayerManager {\n private sceneService: ISceneService;\n private mapService: IMapService<unknown>;\n private controlService: IControlService;\n private layerService: ILayerService;\n private iconService: IIconService;\n private markerService: IMarkerService;\n private popupService: IPopupService;\n private fontService: IFontService;\n private interactionService: IInteractionService;\n private container: Container;\n\n public constructor(config: ISceneConfig) {\n const { id, map } = config;\n // 创建场景容器\n const sceneContainer = createSceneContainer();\n this.container = sceneContainer;\n // 绑定地图服务\n map.setContainer(sceneContainer, id);\n\n // 绑定渲染引擎服务\n sceneContainer\n .bind<IRendererService>(TYPES.IRendererService)\n .to(ReglRendererService)\n .inSingletonScope();\n\n // 依赖注入\n this.sceneService = sceneContainer.get<ISceneService>(TYPES.ISceneService);\n this.mapService = sceneContainer.get<IMapService<unknown>>(\n TYPES.IMapService,\n );\n this.iconService = sceneContainer.get<IIconService>(TYPES.IIconService);\n this.fontService = sceneContainer.get<IFontService>(TYPES.IFontService);\n this.controlService = sceneContainer.get<IControlService>(\n TYPES.IControlService,\n );\n this.layerService = sceneContainer.get<ILayerService>(TYPES.ILayerService);\n\n this.markerService = sceneContainer.get<IMarkerService>(\n TYPES.IMarkerService,\n );\n this.interactionService = sceneContainer.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n this.popupService = sceneContainer.get<IPopupService>(TYPES.IPopupService);\n\n this.initComponent(id);\n\n // 初始化 scene\n this.sceneService.init(config);\n // TODO: 初始化组件\n\n this.initControl();\n }\n public getServiceContainer(): Container {\n return this.container;\n }\n public getSize(): [number, number] {\n return this.mapService.getSize();\n }\n public getMinZoom(): number {\n return this.mapService.getMinZoom();\n }\n public getMaxZoom(): number {\n return this.mapService.getMaxZoom();\n }\n public getType(): string {\n return this.mapService.getType();\n }\n public getMapContainer(): HTMLElement | null {\n return this.mapService.getMapContainer();\n }\n public getMapCanvasContainer(): HTMLElement {\n return this.mapService.getMapCanvasContainer() as HTMLElement;\n }\n\n public getMapService(): IMapService<unknown> {\n return this.mapService;\n }\n public exportPng(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public exportMap(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public registerRenderService(render: any) {\n if (this.sceneService.loaded) {\n const renderSerivce = new render(this);\n renderSerivce.init();\n } else {\n this.on('loaded', () => {\n const renderSerivce = new render(this);\n renderSerivce.init();\n });\n }\n }\n\n public get map() {\n return this.mapService.map;\n }\n\n public setBgColor(color: string) {\n this.mapService.setBgColor(color);\n }\n\n // layer 管理\n public addLayer(layer: ILayer): void {\n // 为当前图层创建一个容器\n // TODO: 初始化的时候设置 容器\n const layerContainer = createLayerContainer(this.container);\n layer.setContainer(layerContainer, this.container);\n this.sceneService.addLayer(layer);\n }\n\n public getLayers(): ILayer[] {\n return this.layerService.getLayers();\n }\n\n public getLayer(id: string): ILayer | undefined {\n return this.layerService.getLayer(id);\n }\n\n public getLayerByName(name: string): ILayer | undefined {\n return this.layerService.getLayerByName(name);\n }\n\n public removeLayer(layer: ILayer, parentLayer?: ILayer): void {\n this.layerService.remove(layer, parentLayer);\n }\n\n public removeAllLayer(): void {\n this.layerService.removeAllLayers();\n }\n\n public render(): void {\n this.sceneService.render();\n }\n\n // asset method\n /**\n * 为 layer/point/text 支持 iconfont 模式支持\n * @param fontUnicode\n * @param name\n */\n public addIconFont(name: string, fontUnicode: string): void {\n this.fontService.addIconFont(name, fontUnicode);\n }\n\n public addIconFonts(options: string[][]): void {\n options.forEach(([name, fontUnicode]) => {\n this.fontService.addIconFont(name, fontUnicode);\n });\n }\n /**\n * 用户自定义添加第三方字体\n * @param fontFamily\n * @param fontPath\n */\n public addFontFace(fontFamily: string, fontPath: string): void {\n this.sceneService.addFontFace(fontFamily, fontPath);\n }\n\n public addImage(id: string, img: IImage) {\n this.iconService.addImage(id, img);\n }\n\n public hasImage(id: string) {\n return this.iconService.hasImage(id);\n }\n\n public removeImage(id: string) {\n this.iconService.removeImage(id);\n }\n\n public addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]) {\n this.fontService.addIconGlyphs(glyphs);\n }\n\n // map control method\n public addControl(ctr: IControl) {\n this.controlService.addControl(ctr, this.container);\n }\n\n public removeControl(ctr: IControl) {\n this.controlService.removeControl(ctr);\n }\n\n public getControlByName(name: string) {\n return this.controlService.getControlByName(name);\n }\n\n // marker\n public addMarker(marker: IMarker) {\n this.markerService.addMarker(marker);\n }\n\n public addMarkerLayer(layer: IMarkerLayer) {\n this.markerService.addMarkerLayer(layer);\n }\n\n public removeMarkerLayer(layer: IMarkerLayer) {\n this.markerService.removeMarkerLayer(layer);\n }\n\n public removeAllMakers() {\n this.markerService.removeAllMarkers();\n }\n\n public addPopup(popup: IPopup) {\n this.popupService.addPopup(popup);\n }\n\n public on(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.on(type, handle)\n : this.sceneService.on(type, handle);\n }\n\n public once(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.once(type, handle)\n : this.sceneService.once(type, handle);\n }\n\n public off(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.off(type, handle)\n : this.sceneService.off(type, handle);\n }\n\n // implements IMapController\n\n public getZoom(): number {\n return this.mapService.getZoom();\n }\n\n public getCenter(options?: ICameraOptions): ILngLat {\n return this.mapService.getCenter(options);\n }\n\n public setCenter(center: [number, number], options?: ICameraOptions) {\n return this.mapService.setCenter(center, options);\n }\n\n public getPitch(): number {\n return this.mapService.getPitch();\n }\n\n public setPitch(pitch: number) {\n return this.mapService.setPitch(pitch);\n }\n\n public getRotation(): number {\n return this.mapService.getRotation();\n }\n\n public getBounds(): Bounds {\n return this.mapService.getBounds();\n }\n\n public setRotation(rotation: number): void {\n this.mapService.setRotation(rotation);\n }\n public zoomIn(): void {\n this.mapService.zoomIn();\n }\n\n public zoomOut(): void {\n this.mapService.zoomOut();\n }\n\n public panTo(p: Point): void {\n this.mapService.panTo(p);\n }\n\n public panBy(x: number, y: number): void {\n this.mapService.panBy(x, y);\n }\n\n public getContainer() {\n return this.mapService.getContainer();\n }\n public setZoom(zoom: number): void {\n this.mapService.setZoom(zoom);\n }\n public fitBounds(bound: Bounds, options?: unknown): void {\n const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();\n this.mapService.fitBounds(\n bound,\n // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入\n options || {\n ...(fitBoundsOptions as object),\n animate,\n },\n );\n }\n\n public setZoomAndCenter(zoom: number, center: Point): void {\n this.mapService.setZoomAndCenter(zoom, center);\n }\n\n public setMapStyle(style: any): void {\n this.mapService.setMapStyle(style);\n }\n\n public setMapStatus(options: Partial<IStatusOptions>) {\n this.mapService.setMapStatus(options);\n }\n\n // conversion Method\n public pixelToLngLat(pixel: Point): ILngLat {\n return this.mapService.pixelToLngLat(pixel);\n }\n\n public lngLatToPixel(lnglat: Point): IPoint {\n return this.mapService.lngLatToPixel(lnglat);\n }\n\n public containerToLngLat(pixel: Point): ILngLat {\n return this.mapService.containerToLngLat(pixel);\n }\n\n public lngLatToContainer(lnglat: Point): IPoint {\n return this.mapService.lngLatToContainer(lnglat);\n }\n\n public destroy() {\n this.sceneService.destroy();\n // TODO: 清理其他 Service 例如 IconService\n }\n\n public registerPostProcessingPass(\n constructor: new (...args: any[]) => IPostProcessingPass<unknown>,\n name: string,\n ) {\n this.container\n .bind<IPostProcessingPass<unknown>>(TYPES.IPostProcessingPass)\n .to(constructor)\n .whenTargetNamed(name);\n }\n\n private initComponent(id: string | HTMLDivElement) {\n this.controlService.init(\n {\n container: DOM.getContainer(id),\n },\n this.container,\n );\n this.markerService.init(this.container);\n this.popupService.init(this.container);\n }\n\n private initControl() {\n const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();\n if (logoVisible) {\n this.addControl(new Logo({ position: logoPosition }));\n }\n }\n // 资源管理\n}\n\nexport { Scene };\n"],"file":"index.js"}
|
package/lib/index.js
CHANGED
|
@@ -41,12 +41,10 @@ var Scene = function () {
|
|
|
41
41
|
(0, _defineProperty2.default)(this, "interactionService", void 0);
|
|
42
42
|
(0, _defineProperty2.default)(this, "container", void 0);
|
|
43
43
|
var id = config.id,
|
|
44
|
-
map = config.map
|
|
45
|
-
canvas = config.canvas,
|
|
46
|
-
hasBaseMap = config.hasBaseMap;
|
|
44
|
+
map = config.map;
|
|
47
45
|
var sceneContainer = (0, _l7Core.createSceneContainer)();
|
|
48
46
|
this.container = sceneContainer;
|
|
49
|
-
map.setContainer(sceneContainer, id
|
|
47
|
+
map.setContainer(sceneContainer, id);
|
|
50
48
|
sceneContainer.bind(_l7Core.TYPES.IRendererService).to(_l7Renderer.ReglRendererService).inSingletonScope();
|
|
51
49
|
this.sceneService = sceneContainer.get(_l7Core.TYPES.ISceneService);
|
|
52
50
|
this.mapService = sceneContainer.get(_l7Core.TYPES.IMapService);
|
|
@@ -57,14 +55,9 @@ var Scene = function () {
|
|
|
57
55
|
this.markerService = sceneContainer.get(_l7Core.TYPES.IMarkerService);
|
|
58
56
|
this.interactionService = sceneContainer.get(_l7Core.TYPES.IInteractionService);
|
|
59
57
|
this.popupService = sceneContainer.get(_l7Core.TYPES.IPopupService);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} else {
|
|
64
|
-
this.initComponent(id);
|
|
65
|
-
this.sceneService.init(config);
|
|
66
|
-
this.initControl();
|
|
67
|
-
}
|
|
58
|
+
this.initComponent(id);
|
|
59
|
+
this.sceneService.init(config);
|
|
60
|
+
this.initControl();
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
(0, _createClass2.default)(Scene, [{
|
|
@@ -205,11 +198,7 @@ var Scene = function () {
|
|
|
205
198
|
}, {
|
|
206
199
|
key: "addImage",
|
|
207
200
|
value: function addImage(id, img) {
|
|
208
|
-
|
|
209
|
-
this.iconService.addImage(id, img);
|
|
210
|
-
} else {
|
|
211
|
-
this.iconService.addImageMini(id, img, this.sceneService);
|
|
212
|
-
}
|
|
201
|
+
this.iconService.addImage(id, img);
|
|
213
202
|
}
|
|
214
203
|
}, {
|
|
215
204
|
key: "hasImage",
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["Scene","config","id","map","canvas","hasBaseMap","sceneContainer","container","setContainer","bind","TYPES","IRendererService","to","ReglRendererService","inSingletonScope","sceneService","get","ISceneService","mapService","IMapService","iconService","IIconService","fontService","IFontService","controlService","IControlService","layerService","ILayerService","markerService","IMarkerService","interactionService","IInteractionService","popupService","IPopupService","isMini","initMiniScene","initComponent","init","initControl","getSize","getMinZoom","getMaxZoom","getType","getMapContainer","getMapCanvasContainer","type","exportPng","render","loaded","renderSerivce","on","color","setBgColor","layer","layerContainer","addLayer","getLayers","getLayer","name","getLayerByName","parentLayer","remove","removeAllLayers","fontUnicode","addIconFont","options","forEach","fontFamily","fontPath","addFontFace","img","addImage","addImageMini","hasImage","removeImage","glyphs","addIconGlyphs","ctr","addControl","removeControl","getControlByName","marker","addMarker","addMarkerLayer","removeMarkerLayer","removeAllMarkers","popup","addPopup","handle","SceneEventList","indexOf","once","off","getZoom","getCenter","center","setCenter","getPitch","pitch","setPitch","getRotation","getBounds","rotation","setRotation","zoomIn","zoomOut","p","panTo","x","y","panBy","getContainer","zoom","setZoom","bound","getSceneConfig","fitBoundsOptions","animate","fitBounds","setZoomAndCenter","style","setMapStyle","setMapStatus","pixel","pixelToLngLat","lnglat","lngLatToPixel","containerToLngLat","lngLatToContainer","destroy","constructor","IPostProcessingPass","whenTargetNamed","DOM","logoVisible","logoPosition","Logo","position"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AA+BA;;AACA;;;;;;IAkBMA,K;AAaJ,iBAAmBC,MAAnB,EAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACvC,QAAQC,EAAR,GAAwCD,MAAxC,CAAQC,EAAR;AAAA,QAAYC,GAAZ,GAAwCF,MAAxC,CAAYE,GAAZ;AAAA,QAAiBC,MAAjB,GAAwCH,MAAxC,CAAiBG,MAAjB;AAAA,QAAyBC,UAAzB,GAAwCJ,MAAxC,CAAyBI,UAAzB;AAEA,QAAMC,cAAc,GAAG,mCAAvB;AACA,SAAKC,SAAL,GAAiBD,cAAjB;AAEAH,IAAAA,GAAG,CAACK,YAAJ,CAAiBF,cAAjB,EAAiCJ,EAAjC,EAAqCE,MAArC,EAA6CC,UAA7C;AAGAC,IAAAA,cAAc,CACXG,IADH,CAC0BC,cAAMC,gBADhC,EAEGC,EAFH,CAEMC,+BAFN,EAGGC,gBAHH;AAMA,SAAKC,YAAL,GAAoBT,cAAc,CAACU,GAAf,CAAkCN,cAAMO,aAAxC,CAApB;AACA,SAAKC,UAAL,GAAkBZ,cAAc,CAACU,GAAf,CAChBN,cAAMS,WADU,CAAlB;AAGA,SAAKC,WAAL,GAAmBd,cAAc,CAACU,GAAf,CAAiCN,cAAMW,YAAvC,CAAnB;AACA,SAAKC,WAAL,GAAmBhB,cAAc,CAACU,GAAf,CAAiCN,cAAMa,YAAvC,CAAnB;AACA,SAAKC,cAAL,GAAsBlB,cAAc,CAACU,GAAf,CACpBN,cAAMe,eADc,CAAtB;AAGA,SAAKC,YAAL,GAAoBpB,cAAc,CAACU,GAAf,CAAkCN,cAAMiB,aAAxC,CAApB;AAEA,SAAKC,aAAL,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EAAtB,EAAmD;AACjD,WAAKsB,cAAL,CAAoBa,IAApB,CACE;AACE9B,QAAAA,SAAS,EAAE8H,aAAItB,YAAJ,CAAiB7G,EAAjB;AADb,OADF,EAIE,KAAKK,SAJP;AAMA,WAAKqB,aAAL,CAAmBS,IAAnB,CAAwB,KAAK9B,SAA7B;AACA,WAAKyB,YAAL,CAAkBK,IAAlB,CAAuB,KAAK9B,SAA5B;AACD;;;WAED,uBAAsB;AACpB,mCAAsC,KAAKQ,YAAL,CAAkBoG,cAAlB,EAAtC;AAAA,UAAQmB,WAAR,0BAAQA,WAAR;AAAA,UAAqBC,YAArB,0BAAqBA,YAArB;;AACA,UAAID,WAAJ,EAAiB;AACf,aAAKxD,UAAL,CAAgB,IAAI0D,iBAAJ,CAAS;AAAEC,UAAAA,QAAQ,EAAEF;AAAZ,SAAT,CAAhB;AACD;AACF","sourcesContent":["import { Logo } from '@antv/l7-component';\nimport {\n Bounds,\n createLayerContainer,\n createSceneContainer,\n ICameraOptions,\n IControl,\n IControlService,\n IFontService,\n IIconFontGlyph,\n IIconService,\n IImage,\n IInteractionService,\n ILayer,\n ILayerService,\n ILngLat,\n IMapService,\n IMarker,\n IMarkerLayer,\n IMarkerService,\n IPoint,\n IPopup,\n IPopupService,\n IPostProcessingPass,\n IRendererService,\n ISceneConfig,\n ISceneService,\n IStatusOptions,\n Point,\n SceneEventList,\n TYPES,\n} from '@antv/l7-core';\nimport { ReglRendererService } from '@antv/l7-renderer';\nimport { DOM, isMini } from '@antv/l7-utils';\nimport { Container } from 'inversify';\nimport ILayerManager from './ILayerManager';\nimport IMapController from './IMapController';\nimport IPostProcessingPassPluggable from './IPostProcessingPassPluggable';\n\n/**\n * 暴露 Scene API\n *\n * @example\n * import { Scene } from 'l7/scene';\n * import { PointLayer } from 'l7/layers';\n *\n * const scene = new Scene();\n * const pointLayer = new PointLayer();\n * scene.addLayer(pointLayer);\n *\n */\nclass Scene\n implements IPostProcessingPassPluggable, IMapController, ILayerManager {\n private sceneService: ISceneService;\n private mapService: IMapService<unknown>;\n private controlService: IControlService;\n private layerService: ILayerService;\n private iconService: IIconService;\n private markerService: IMarkerService;\n private popupService: IPopupService;\n private fontService: IFontService;\n private interactionService: IInteractionService;\n private container: Container;\n\n public constructor(config: ISceneConfig) {\n const { id, map, canvas, hasBaseMap } = config;\n // 创建场景容器\n const sceneContainer = createSceneContainer();\n this.container = sceneContainer;\n // 绑定地图服务\n map.setContainer(sceneContainer, id, canvas, hasBaseMap);\n\n // 绑定渲染引擎服务\n sceneContainer\n .bind<IRendererService>(TYPES.IRendererService)\n .to(ReglRendererService)\n .inSingletonScope();\n\n // 依赖注入\n this.sceneService = sceneContainer.get<ISceneService>(TYPES.ISceneService);\n this.mapService = sceneContainer.get<IMapService<unknown>>(\n TYPES.IMapService,\n );\n this.iconService = sceneContainer.get<IIconService>(TYPES.IIconService);\n this.fontService = sceneContainer.get<IFontService>(TYPES.IFontService);\n this.controlService = sceneContainer.get<IControlService>(\n TYPES.IControlService,\n );\n this.layerService = sceneContainer.get<ILayerService>(TYPES.ILayerService);\n\n this.markerService = sceneContainer.get<IMarkerService>(\n TYPES.IMarkerService,\n );\n this.interactionService = sceneContainer.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n this.popupService = sceneContainer.get<IPopupService>(TYPES.IPopupService);\n\n if (isMini) {\n this.sceneService.initMiniScene(config);\n } else {\n this.initComponent(id);\n\n // 初始化 scene\n this.sceneService.init(config);\n // TODO: 初始化组件\n\n this.initControl();\n }\n }\n public getServiceContainer(): Container {\n return this.container;\n }\n public getSize(): [number, number] {\n return this.mapService.getSize();\n }\n public getMinZoom(): number {\n return this.mapService.getMinZoom();\n }\n public getMaxZoom(): number {\n return this.mapService.getMaxZoom();\n }\n public getType(): string {\n return this.mapService.getType();\n }\n public getMapContainer(): HTMLElement | null {\n return this.mapService.getMapContainer();\n }\n public getMapCanvasContainer(): HTMLElement {\n return this.mapService.getMapCanvasContainer() as HTMLElement;\n }\n\n public getMapService(): IMapService<unknown> {\n return this.mapService;\n }\n public exportPng(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public exportMap(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public registerRenderService(render: any) {\n if (this.sceneService.loaded) {\n const renderSerivce = new render(this);\n renderSerivce.init();\n } else {\n this.on('loaded', () => {\n const renderSerivce = new render(this);\n renderSerivce.init();\n });\n }\n }\n\n public get map() {\n return this.mapService.map;\n }\n\n public setBgColor(color: string) {\n this.mapService.setBgColor(color);\n }\n\n // layer 管理\n public addLayer(layer: ILayer): void {\n // 为当前图层创建一个容器\n // TODO: 初始化的时候设置 容器\n const layerContainer = createLayerContainer(this.container);\n layer.setContainer(layerContainer, this.container);\n this.sceneService.addLayer(layer);\n }\n\n public getLayers(): ILayer[] {\n return this.layerService.getLayers();\n }\n\n public getLayer(id: string): ILayer | undefined {\n return this.layerService.getLayer(id);\n }\n\n public getLayerByName(name: string): ILayer | undefined {\n return this.layerService.getLayerByName(name);\n }\n\n public removeLayer(layer: ILayer, parentLayer?: ILayer): void {\n this.layerService.remove(layer, parentLayer);\n }\n\n public removeAllLayer(): void {\n this.layerService.removeAllLayers();\n }\n\n public render(): void {\n this.sceneService.render();\n }\n\n // asset method\n /**\n * 为 layer/point/text 支持 iconfont 模式支持\n * @param fontUnicode\n * @param name\n */\n public addIconFont(name: string, fontUnicode: string): void {\n this.fontService.addIconFont(name, fontUnicode);\n }\n\n public addIconFonts(options: string[][]): void {\n options.forEach(([name, fontUnicode]) => {\n this.fontService.addIconFont(name, fontUnicode);\n });\n }\n /**\n * 用户自定义添加第三方字体\n * @param fontFamily\n * @param fontPath\n */\n public addFontFace(fontFamily: string, fontPath: string): void {\n this.sceneService.addFontFace(fontFamily, fontPath);\n }\n\n public addImage(id: string, img: IImage) {\n if (!isMini) {\n this.iconService.addImage(id, img);\n } else {\n this.iconService.addImageMini(id, img, this.sceneService);\n }\n // this.iconService.addImage(id, img);\n }\n\n public hasImage(id: string) {\n return this.iconService.hasImage(id);\n }\n\n public removeImage(id: string) {\n this.iconService.removeImage(id);\n }\n\n public addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]) {\n this.fontService.addIconGlyphs(glyphs);\n }\n\n // map control method\n public addControl(ctr: IControl) {\n this.controlService.addControl(ctr, this.container);\n }\n\n public removeControl(ctr: IControl) {\n this.controlService.removeControl(ctr);\n }\n\n public getControlByName(name: string) {\n return this.controlService.getControlByName(name);\n }\n\n // marker\n public addMarker(marker: IMarker) {\n this.markerService.addMarker(marker);\n }\n\n public addMarkerLayer(layer: IMarkerLayer) {\n this.markerService.addMarkerLayer(layer);\n }\n\n public removeMarkerLayer(layer: IMarkerLayer) {\n this.markerService.removeMarkerLayer(layer);\n }\n\n public removeAllMakers() {\n this.markerService.removeAllMarkers();\n }\n\n public addPopup(popup: IPopup) {\n this.popupService.addPopup(popup);\n }\n\n public on(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.on(type, handle)\n : this.sceneService.on(type, handle);\n }\n\n public once(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.once(type, handle)\n : this.sceneService.once(type, handle);\n }\n\n public off(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.off(type, handle)\n : this.sceneService.off(type, handle);\n }\n\n // implements IMapController\n\n public getZoom(): number {\n return this.mapService.getZoom();\n }\n\n public getCenter(options?: ICameraOptions): ILngLat {\n return this.mapService.getCenter(options);\n }\n\n public setCenter(center: [number, number], options?: ICameraOptions) {\n return this.mapService.setCenter(center, options);\n }\n\n public getPitch(): number {\n return this.mapService.getPitch();\n }\n\n public setPitch(pitch: number) {\n return this.mapService.setPitch(pitch);\n }\n\n public getRotation(): number {\n return this.mapService.getRotation();\n }\n\n public getBounds(): Bounds {\n return this.mapService.getBounds();\n }\n\n public setRotation(rotation: number): void {\n this.mapService.setRotation(rotation);\n }\n public zoomIn(): void {\n this.mapService.zoomIn();\n }\n\n public zoomOut(): void {\n this.mapService.zoomOut();\n }\n\n public panTo(p: Point): void {\n this.mapService.panTo(p);\n }\n\n public panBy(x: number, y: number): void {\n this.mapService.panBy(x, y);\n }\n\n public getContainer() {\n return this.mapService.getContainer();\n }\n public setZoom(zoom: number): void {\n this.mapService.setZoom(zoom);\n }\n public fitBounds(bound: Bounds, options?: unknown): void {\n const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();\n this.mapService.fitBounds(\n bound,\n // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入\n options || {\n ...(fitBoundsOptions as object),\n animate,\n },\n );\n }\n\n public setZoomAndCenter(zoom: number, center: Point): void {\n this.mapService.setZoomAndCenter(zoom, center);\n }\n\n public setMapStyle(style: any): void {\n this.mapService.setMapStyle(style);\n }\n\n public setMapStatus(options: Partial<IStatusOptions>) {\n this.mapService.setMapStatus(options);\n }\n\n // conversion Method\n public pixelToLngLat(pixel: Point): ILngLat {\n return this.mapService.pixelToLngLat(pixel);\n }\n\n public lngLatToPixel(lnglat: Point): IPoint {\n return this.mapService.lngLatToPixel(lnglat);\n }\n\n public containerToLngLat(pixel: Point): ILngLat {\n return this.mapService.containerToLngLat(pixel);\n }\n\n public lngLatToContainer(lnglat: Point): IPoint {\n return this.mapService.lngLatToContainer(lnglat);\n }\n\n public destroy() {\n this.sceneService.destroy();\n // TODO: 清理其他 Service 例如 IconService\n }\n\n public registerPostProcessingPass(\n constructor: new (...args: any[]) => IPostProcessingPass<unknown>,\n name: string,\n ) {\n this.container\n .bind<IPostProcessingPass<unknown>>(TYPES.IPostProcessingPass)\n .to(constructor)\n .whenTargetNamed(name);\n }\n\n private initComponent(id: string | HTMLDivElement) {\n this.controlService.init(\n {\n container: DOM.getContainer(id),\n },\n this.container,\n );\n this.markerService.init(this.container);\n this.popupService.init(this.container);\n }\n\n private initControl() {\n const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();\n if (logoVisible) {\n this.addControl(new Logo({ position: logoPosition }));\n }\n }\n // 资源管理\n}\n\nexport { Scene };\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["Scene","config","id","map","sceneContainer","container","setContainer","bind","TYPES","IRendererService","to","ReglRendererService","inSingletonScope","sceneService","get","ISceneService","mapService","IMapService","iconService","IIconService","fontService","IFontService","controlService","IControlService","layerService","ILayerService","markerService","IMarkerService","interactionService","IInteractionService","popupService","IPopupService","initComponent","init","initControl","getSize","getMinZoom","getMaxZoom","getType","getMapContainer","getMapCanvasContainer","type","exportPng","render","loaded","renderSerivce","on","color","setBgColor","layer","layerContainer","addLayer","getLayers","getLayer","name","getLayerByName","parentLayer","remove","removeAllLayers","fontUnicode","addIconFont","options","forEach","fontFamily","fontPath","addFontFace","img","addImage","hasImage","removeImage","glyphs","addIconGlyphs","ctr","addControl","removeControl","getControlByName","marker","addMarker","addMarkerLayer","removeMarkerLayer","removeAllMarkers","popup","addPopup","handle","SceneEventList","indexOf","once","off","getZoom","getCenter","center","setCenter","getPitch","pitch","setPitch","getRotation","getBounds","rotation","setRotation","zoomIn","zoomOut","p","panTo","x","y","panBy","getContainer","zoom","setZoom","bound","getSceneConfig","fitBoundsOptions","animate","fitBounds","setZoomAndCenter","style","setMapStyle","setMapStatus","pixel","pixelToLngLat","lnglat","lngLatToPixel","containerToLngLat","lngLatToContainer","destroy","constructor","IPostProcessingPass","whenTargetNamed","DOM","logoVisible","logoPosition","Logo","position"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AA+BA;;AACA;;;;;;IAkBMA,K;AAaJ,iBAAmBC,MAAnB,EAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACvC,QAAQC,EAAR,GAAoBD,MAApB,CAAQC,EAAR;AAAA,QAAYC,GAAZ,GAAoBF,MAApB,CAAYE,GAAZ;AAEA,QAAMC,cAAc,GAAG,mCAAvB;AACA,SAAKC,SA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AO,KAAKtG,UAAL,CAAgB0G,iBAAhB,CAAkCJ,KAAlC,CAAP;AACD;;;WAED,2BAAyBE,MAAzB,EAAgD;AAC9C,aAAO,KAAKxG,UAAL,CAAgB2G,iBAAhB,CAAkCH,MAAlC,CAAP;AACD;;;WAED,mBAAiB;AACf,WAAK3G,YAAL,CAAkB+G,OAAlB;AAED;;;WAED,oCACEC,WADF,EAEEvE,IAFF,EAGE;AACA,WAAKjD,SAAL,CACGE,IADH,CACsCC,cAAMsH,mBAD5C,EAEGpH,EAFH,CAEMmH,WAFN,EAGGE,eAHH,CAGmBzE,IAHnB;AAID;;;WAED,uBAAsBpD,EAAtB,EAAmD;AACjD,WAAKoB,cAAL,CAAoBW,IAApB,CACE;AACE5B,QAAAA,SAAS,EAAE2H,aAAItB,YAAJ,CAAiBxG,EAAjB;AADb,OADF,EAIE,KAAKG,SAJP;AAMA,WAAKqB,aAAL,CAAmBO,IAAnB,CAAwB,KAAK5B,SAA7B;AACA,WAAKyB,YAAL,CAAkBG,IAAlB,CAAuB,KAAK5B,SAA5B;AACD;;;WAED,uBAAsB;AACpB,mCAAsC,KAAKQ,YAAL,CAAkBiG,cAAlB,EAAtC;AAAA,UAAQmB,WAAR,0BAAQA,WAAR;AAAA,UAAqBC,YAArB,0BAAqBA,YAArB;;AACA,UAAID,WAAJ,EAAiB;AACf,aAAKxD,UAAL,CAAgB,IAAI0D,iBAAJ,CAAS;AAAEC,UAAAA,QAAQ,EAAEF;AAAZ,SAAT,CAAhB;AACD;AACF","sourcesContent":["import { Logo } from '@antv/l7-component';\nimport {\n Bounds,\n createLayerContainer,\n createSceneContainer,\n ICameraOptions,\n IControl,\n IControlService,\n IFontService,\n IIconFontGlyph,\n IIconService,\n IImage,\n IInteractionService,\n ILayer,\n ILayerService,\n ILngLat,\n IMapService,\n IMarker,\n IMarkerLayer,\n IMarkerService,\n IPoint,\n IPopup,\n IPopupService,\n IPostProcessingPass,\n IRendererService,\n ISceneConfig,\n ISceneService,\n IStatusOptions,\n Point,\n SceneEventList,\n TYPES,\n} from '@antv/l7-core';\nimport { ReglRendererService } from '@antv/l7-renderer';\nimport { DOM } from '@antv/l7-utils';\nimport { Container } from 'inversify';\nimport ILayerManager from './ILayerManager';\nimport IMapController from './IMapController';\nimport IPostProcessingPassPluggable from './IPostProcessingPassPluggable';\n\n/**\n * 暴露 Scene API\n *\n * @example\n * import { Scene } from 'l7/scene';\n * import { PointLayer } from 'l7/layers';\n *\n * const scene = new Scene();\n * const pointLayer = new PointLayer();\n * scene.addLayer(pointLayer);\n *\n */\nclass Scene\n implements IPostProcessingPassPluggable, IMapController, ILayerManager {\n private sceneService: ISceneService;\n private mapService: IMapService<unknown>;\n private controlService: IControlService;\n private layerService: ILayerService;\n private iconService: IIconService;\n private markerService: IMarkerService;\n private popupService: IPopupService;\n private fontService: IFontService;\n private interactionService: IInteractionService;\n private container: Container;\n\n public constructor(config: ISceneConfig) {\n const { id, map } = config;\n // 创建场景容器\n const sceneContainer = createSceneContainer();\n this.container = sceneContainer;\n // 绑定地图服务\n map.setContainer(sceneContainer, id);\n\n // 绑定渲染引擎服务\n sceneContainer\n .bind<IRendererService>(TYPES.IRendererService)\n .to(ReglRendererService)\n .inSingletonScope();\n\n // 依赖注入\n this.sceneService = sceneContainer.get<ISceneService>(TYPES.ISceneService);\n this.mapService = sceneContainer.get<IMapService<unknown>>(\n TYPES.IMapService,\n );\n this.iconService = sceneContainer.get<IIconService>(TYPES.IIconService);\n this.fontService = sceneContainer.get<IFontService>(TYPES.IFontService);\n this.controlService = sceneContainer.get<IControlService>(\n TYPES.IControlService,\n );\n this.layerService = sceneContainer.get<ILayerService>(TYPES.ILayerService);\n\n this.markerService = sceneContainer.get<IMarkerService>(\n TYPES.IMarkerService,\n );\n this.interactionService = sceneContainer.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n this.popupService = sceneContainer.get<IPopupService>(TYPES.IPopupService);\n\n this.initComponent(id);\n\n // 初始化 scene\n this.sceneService.init(config);\n // TODO: 初始化组件\n\n this.initControl();\n }\n public getServiceContainer(): Container {\n return this.container;\n }\n public getSize(): [number, number] {\n return this.mapService.getSize();\n }\n public getMinZoom(): number {\n return this.mapService.getMinZoom();\n }\n public getMaxZoom(): number {\n return this.mapService.getMaxZoom();\n }\n public getType(): string {\n return this.mapService.getType();\n }\n public getMapContainer(): HTMLElement | null {\n return this.mapService.getMapContainer();\n }\n public getMapCanvasContainer(): HTMLElement {\n return this.mapService.getMapCanvasContainer() as HTMLElement;\n }\n\n public getMapService(): IMapService<unknown> {\n return this.mapService;\n }\n public exportPng(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public exportMap(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public registerRenderService(render: any) {\n if (this.sceneService.loaded) {\n const renderSerivce = new render(this);\n renderSerivce.init();\n } else {\n this.on('loaded', () => {\n const renderSerivce = new render(this);\n renderSerivce.init();\n });\n }\n }\n\n public get map() {\n return this.mapService.map;\n }\n\n public setBgColor(color: string) {\n this.mapService.setBgColor(color);\n }\n\n // layer 管理\n public addLayer(layer: ILayer): void {\n // 为当前图层创建一个容器\n // TODO: 初始化的时候设置 容器\n const layerContainer = createLayerContainer(this.container);\n layer.setContainer(layerContainer, this.container);\n this.sceneService.addLayer(layer);\n }\n\n public getLayers(): ILayer[] {\n return this.layerService.getLayers();\n }\n\n public getLayer(id: string): ILayer | undefined {\n return this.layerService.getLayer(id);\n }\n\n public getLayerByName(name: string): ILayer | undefined {\n return this.layerService.getLayerByName(name);\n }\n\n public removeLayer(layer: ILayer, parentLayer?: ILayer): void {\n this.layerService.remove(layer, parentLayer);\n }\n\n public removeAllLayer(): void {\n this.layerService.removeAllLayers();\n }\n\n public render(): void {\n this.sceneService.render();\n }\n\n // asset method\n /**\n * 为 layer/point/text 支持 iconfont 模式支持\n * @param fontUnicode\n * @param name\n */\n public addIconFont(name: string, fontUnicode: string): void {\n this.fontService.addIconFont(name, fontUnicode);\n }\n\n public addIconFonts(options: string[][]): void {\n options.forEach(([name, fontUnicode]) => {\n this.fontService.addIconFont(name, fontUnicode);\n });\n }\n /**\n * 用户自定义添加第三方字体\n * @param fontFamily\n * @param fontPath\n */\n public addFontFace(fontFamily: string, fontPath: string): void {\n this.sceneService.addFontFace(fontFamily, fontPath);\n }\n\n public addImage(id: string, img: IImage) {\n this.iconService.addImage(id, img);\n }\n\n public hasImage(id: string) {\n return this.iconService.hasImage(id);\n }\n\n public removeImage(id: string) {\n this.iconService.removeImage(id);\n }\n\n public addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]) {\n this.fontService.addIconGlyphs(glyphs);\n }\n\n // map control method\n public addControl(ctr: IControl) {\n this.controlService.addControl(ctr, this.container);\n }\n\n public removeControl(ctr: IControl) {\n this.controlService.removeControl(ctr);\n }\n\n public getControlByName(name: string) {\n return this.controlService.getControlByName(name);\n }\n\n // marker\n public addMarker(marker: IMarker) {\n this.markerService.addMarker(marker);\n }\n\n public addMarkerLayer(layer: IMarkerLayer) {\n this.markerService.addMarkerLayer(layer);\n }\n\n public removeMarkerLayer(layer: IMarkerLayer) {\n this.markerService.removeMarkerLayer(layer);\n }\n\n public removeAllMakers() {\n this.markerService.removeAllMarkers();\n }\n\n public addPopup(popup: IPopup) {\n this.popupService.addPopup(popup);\n }\n\n public on(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.on(type, handle)\n : this.sceneService.on(type, handle);\n }\n\n public once(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.once(type, handle)\n : this.sceneService.once(type, handle);\n }\n\n public off(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.off(type, handle)\n : this.sceneService.off(type, handle);\n }\n\n // implements IMapController\n\n public getZoom(): number {\n return this.mapService.getZoom();\n }\n\n public getCenter(options?: ICameraOptions): ILngLat {\n return this.mapService.getCenter(options);\n }\n\n public setCenter(center: [number, number], options?: ICameraOptions) {\n return this.mapService.setCenter(center, options);\n }\n\n public getPitch(): number {\n return this.mapService.getPitch();\n }\n\n public setPitch(pitch: number) {\n return this.mapService.setPitch(pitch);\n }\n\n public getRotation(): number {\n return this.mapService.getRotation();\n }\n\n public getBounds(): Bounds {\n return this.mapService.getBounds();\n }\n\n public setRotation(rotation: number): void {\n this.mapService.setRotation(rotation);\n }\n public zoomIn(): void {\n this.mapService.zoomIn();\n }\n\n public zoomOut(): void {\n this.mapService.zoomOut();\n }\n\n public panTo(p: Point): void {\n this.mapService.panTo(p);\n }\n\n public panBy(x: number, y: number): void {\n this.mapService.panBy(x, y);\n }\n\n public getContainer() {\n return this.mapService.getContainer();\n }\n public setZoom(zoom: number): void {\n this.mapService.setZoom(zoom);\n }\n public fitBounds(bound: Bounds, options?: unknown): void {\n const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();\n this.mapService.fitBounds(\n bound,\n // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入\n options || {\n ...(fitBoundsOptions as object),\n animate,\n },\n );\n }\n\n public setZoomAndCenter(zoom: number, center: Point): void {\n this.mapService.setZoomAndCenter(zoom, center);\n }\n\n public setMapStyle(style: any): void {\n this.mapService.setMapStyle(style);\n }\n\n public setMapStatus(options: Partial<IStatusOptions>) {\n this.mapService.setMapStatus(options);\n }\n\n // conversion Method\n public pixelToLngLat(pixel: Point): ILngLat {\n return this.mapService.pixelToLngLat(pixel);\n }\n\n public lngLatToPixel(lnglat: Point): IPoint {\n return this.mapService.lngLatToPixel(lnglat);\n }\n\n public containerToLngLat(pixel: Point): ILngLat {\n return this.mapService.containerToLngLat(pixel);\n }\n\n public lngLatToContainer(lnglat: Point): IPoint {\n return this.mapService.lngLatToContainer(lnglat);\n }\n\n public destroy() {\n this.sceneService.destroy();\n // TODO: 清理其他 Service 例如 IconService\n }\n\n public registerPostProcessingPass(\n constructor: new (...args: any[]) => IPostProcessingPass<unknown>,\n name: string,\n ) {\n this.container\n .bind<IPostProcessingPass<unknown>>(TYPES.IPostProcessingPass)\n .to(constructor)\n .whenTargetNamed(name);\n }\n\n private initComponent(id: string | HTMLDivElement) {\n this.controlService.init(\n {\n container: DOM.getContainer(id),\n },\n this.container,\n );\n this.markerService.init(this.container);\n this.popupService.init(this.container);\n }\n\n private initControl() {\n const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();\n if (logoVisible) {\n this.addControl(new Logo({ position: logoPosition }));\n }\n }\n // 资源管理\n}\n\nexport { Scene };\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-scene",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"author": "xiaoiver",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@antv/l7-component": "^2.5.
|
|
27
|
-
"@antv/l7-core": "^2.5.
|
|
28
|
-
"@antv/l7-layers": "^2.5.
|
|
29
|
-
"@antv/l7-maps": "^2.5.
|
|
30
|
-
"@antv/l7-renderer": "^2.5.
|
|
31
|
-
"@antv/l7-utils": "^2.5.
|
|
26
|
+
"@antv/l7-component": "^2.5.39",
|
|
27
|
+
"@antv/l7-core": "^2.5.39",
|
|
28
|
+
"@antv/l7-layers": "^2.5.39",
|
|
29
|
+
"@antv/l7-maps": "^2.5.39",
|
|
30
|
+
"@antv/l7-renderer": "^2.5.39",
|
|
31
|
+
"@antv/l7-utils": "^2.5.39",
|
|
32
32
|
"@babel/runtime": "^7.7.7",
|
|
33
33
|
"inversify": "^5.0.1",
|
|
34
34
|
"mapbox-gl": "^1.2.1",
|
|
35
35
|
"reflect-metadata": "^0.1.13"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b86055f322aa2ae6d996b331b087878bbf6f4fb0",
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
}
|