@antv/l7-scene 2.21.1 → 2.21.2
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/es/boxSelect.js +99 -115
- package/es/index.js +432 -681
- package/lib/ILayerManager.d.ts +9 -0
- package/lib/IMapController.d.ts +62 -0
- package/lib/IPostProcessingPassPluggable.d.ts +9 -0
- package/lib/boxSelect.d.ts +23 -0
- package/lib/index.d.ts +132 -0
- package/lib/index.js +59 -13
- package/package.json +19 -22
- package/CHANGELOG.md +0 -275
- package/LICENSE.md +0 -21
package/es/index.js
CHANGED
|
@@ -1,48 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __async = (__this, __arguments, generator) => {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
var fulfilled = (value) => {
|
|
23
|
+
try {
|
|
24
|
+
step(generator.next(value));
|
|
25
|
+
} catch (e) {
|
|
26
|
+
reject(e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var rejected = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.throw(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
13
40
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var id = config.id,
|
|
30
|
-
map = config.map,
|
|
31
|
-
canvas = config.canvas,
|
|
32
|
-
_config$renderer = config.renderer,
|
|
33
|
-
renderer = _config$renderer === void 0 ? 'regl' : _config$renderer;
|
|
34
|
-
// 创建场景容器
|
|
35
|
-
var sceneContainer = createSceneContainer();
|
|
41
|
+
// src/index.ts
|
|
42
|
+
import { Logo } from "@antv/l7-component";
|
|
43
|
+
import {
|
|
44
|
+
SceneEventList,
|
|
45
|
+
createLayerContainer,
|
|
46
|
+
createSceneContainer
|
|
47
|
+
} from "@antv/l7-core";
|
|
48
|
+
import { MaskLayer, TileLayer } from "@antv/l7-layers";
|
|
49
|
+
import { DeviceRendererService, ReglRendererService } from "@antv/l7-renderer";
|
|
50
|
+
import { DOM, SceneConifg } from "@antv/l7-utils";
|
|
51
|
+
import BoxSelect, { BoxSelectEventList } from "./boxSelect";
|
|
52
|
+
var Scene = class {
|
|
53
|
+
constructor(config) {
|
|
54
|
+
const { id, map, canvas, renderer = "regl" } = config;
|
|
55
|
+
const sceneContainer = createSceneContainer();
|
|
36
56
|
this.container = sceneContainer;
|
|
37
|
-
// 绑定地图服务
|
|
38
57
|
map.setContainer(sceneContainer, id, canvas);
|
|
39
|
-
if (renderer ===
|
|
58
|
+
if (renderer === "regl") {
|
|
40
59
|
sceneContainer.rendererService = new ReglRendererService();
|
|
41
60
|
} else {
|
|
42
61
|
sceneContainer.rendererService = new DeviceRendererService();
|
|
43
62
|
}
|
|
44
|
-
|
|
45
|
-
// 依赖注入
|
|
46
63
|
this.sceneService = sceneContainer.sceneService;
|
|
47
64
|
this.mapService = sceneContainer.mapService;
|
|
48
65
|
this.iconService = sceneContainer.iconService;
|
|
@@ -56,667 +73,401 @@ var Scene = /*#__PURE__*/function () {
|
|
|
56
73
|
this.popupService = sceneContainer.popupService;
|
|
57
74
|
this.boxSelect = new BoxSelect(this, {});
|
|
58
75
|
this.initComponent(id);
|
|
59
|
-
|
|
60
|
-
// 初始化 scene
|
|
61
76
|
this.sceneService.init(config);
|
|
62
|
-
// TODO: 初始化组件
|
|
63
|
-
|
|
64
77
|
this.initControl();
|
|
65
78
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
}, {
|
|
122
|
-
key: "getDebugService",
|
|
123
|
-
value: function getDebugService() {
|
|
124
|
-
return this.debugService;
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "exportPng",
|
|
128
|
-
value: function () {
|
|
129
|
-
var _exportPng = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(type) {
|
|
130
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
131
|
-
while (1) switch (_context.prev = _context.next) {
|
|
132
|
-
case 0:
|
|
133
|
-
return _context.abrupt("return", this.sceneService.exportPng(type));
|
|
134
|
-
case 1:
|
|
135
|
-
case "end":
|
|
136
|
-
return _context.stop();
|
|
137
|
-
}
|
|
138
|
-
}, _callee, this);
|
|
139
|
-
}));
|
|
140
|
-
function exportPng(_x) {
|
|
141
|
-
return _exportPng.apply(this, arguments);
|
|
142
|
-
}
|
|
143
|
-
return exportPng;
|
|
144
|
-
}()
|
|
145
|
-
}, {
|
|
146
|
-
key: "exportMap",
|
|
147
|
-
value: function () {
|
|
148
|
-
var _exportMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(type) {
|
|
149
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
150
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
151
|
-
case 0:
|
|
152
|
-
return _context2.abrupt("return", this.sceneService.exportPng(type));
|
|
153
|
-
case 1:
|
|
154
|
-
case "end":
|
|
155
|
-
return _context2.stop();
|
|
156
|
-
}
|
|
157
|
-
}, _callee2, this);
|
|
158
|
-
}));
|
|
159
|
-
function exportMap(_x2) {
|
|
160
|
-
return _exportMap.apply(this, arguments);
|
|
161
|
-
}
|
|
162
|
-
return exportMap;
|
|
163
|
-
}()
|
|
164
|
-
}, {
|
|
165
|
-
key: "registerRenderService",
|
|
166
|
-
value: function registerRenderService(render) {
|
|
167
|
-
var _this = this;
|
|
168
|
-
if (this.sceneService.loaded) {
|
|
169
|
-
var renderSerivce = new render(this);
|
|
79
|
+
get map() {
|
|
80
|
+
return this.mapService.map;
|
|
81
|
+
}
|
|
82
|
+
get loaded() {
|
|
83
|
+
return this.sceneService.loaded;
|
|
84
|
+
}
|
|
85
|
+
getServiceContainer() {
|
|
86
|
+
return this.container;
|
|
87
|
+
}
|
|
88
|
+
getSize() {
|
|
89
|
+
return this.mapService.getSize();
|
|
90
|
+
}
|
|
91
|
+
getMinZoom() {
|
|
92
|
+
return this.mapService.getMinZoom();
|
|
93
|
+
}
|
|
94
|
+
getMaxZoom() {
|
|
95
|
+
return this.mapService.getMaxZoom();
|
|
96
|
+
}
|
|
97
|
+
getType() {
|
|
98
|
+
return this.mapService.getType();
|
|
99
|
+
}
|
|
100
|
+
getMapContainer() {
|
|
101
|
+
return this.mapService.getMapContainer();
|
|
102
|
+
}
|
|
103
|
+
getMapCanvasContainer() {
|
|
104
|
+
return this.mapService.getMapCanvasContainer();
|
|
105
|
+
}
|
|
106
|
+
getMapService() {
|
|
107
|
+
return this.mapService;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 对外暴露 debugService
|
|
111
|
+
* @returns
|
|
112
|
+
*/
|
|
113
|
+
getDebugService() {
|
|
114
|
+
return this.debugService;
|
|
115
|
+
}
|
|
116
|
+
exportPng(type) {
|
|
117
|
+
return __async(this, null, function* () {
|
|
118
|
+
return this.sceneService.exportPng(type);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
exportMap(type) {
|
|
122
|
+
return __async(this, null, function* () {
|
|
123
|
+
return this.sceneService.exportPng(type);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
registerRenderService(render) {
|
|
127
|
+
if (this.sceneService.loaded) {
|
|
128
|
+
const renderSerivce = new render(this);
|
|
129
|
+
renderSerivce.init();
|
|
130
|
+
} else {
|
|
131
|
+
this.on("loaded", () => {
|
|
132
|
+
const renderSerivce = new render(this);
|
|
170
133
|
renderSerivce.init();
|
|
171
|
-
}
|
|
172
|
-
this.on('loaded', function () {
|
|
173
|
-
var renderSerivce = new render(_this);
|
|
174
|
-
renderSerivce.init();
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}, {
|
|
179
|
-
key: "setBgColor",
|
|
180
|
-
value: function setBgColor(color) {
|
|
181
|
-
this.mapService.setBgColor(color);
|
|
134
|
+
});
|
|
182
135
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
136
|
+
}
|
|
137
|
+
setBgColor(color) {
|
|
138
|
+
this.mapService.setBgColor(color);
|
|
139
|
+
}
|
|
140
|
+
addLayer(layer) {
|
|
141
|
+
if (this.loaded) {
|
|
142
|
+
this.preAddLayer(layer);
|
|
143
|
+
} else {
|
|
144
|
+
this.once("loaded", () => {
|
|
188
145
|
this.preAddLayer(layer);
|
|
189
|
-
}
|
|
190
|
-
this.once('loaded', function () {
|
|
191
|
-
_this2.preAddLayer(layer);
|
|
192
|
-
});
|
|
193
|
-
}
|
|
146
|
+
});
|
|
194
147
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
layer.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// mask 在 scene loaded 之后执行
|
|
208
|
-
if (layer.inited) {
|
|
148
|
+
}
|
|
149
|
+
// layer 管理
|
|
150
|
+
preAddLayer(layer) {
|
|
151
|
+
const layerContainer = createLayerContainer(this.container);
|
|
152
|
+
layer.setContainer(layerContainer);
|
|
153
|
+
this.sceneService.addLayer(layer);
|
|
154
|
+
if (layer.inited) {
|
|
155
|
+
this.initTileLayer(layer);
|
|
156
|
+
const maskInstance = this.initMask(layer);
|
|
157
|
+
this.addMask(maskInstance, layer.id);
|
|
158
|
+
} else {
|
|
159
|
+
layer.on("inited", () => {
|
|
209
160
|
this.initTileLayer(layer);
|
|
210
|
-
|
|
211
|
-
var maskInstance = this.initMask(layer);
|
|
161
|
+
const maskInstance = this.initMask(layer);
|
|
212
162
|
this.addMask(maskInstance, layer.id);
|
|
213
|
-
} else {
|
|
214
|
-
layer.on('inited', function () {
|
|
215
|
-
_this3.initTileLayer(layer);
|
|
216
|
-
var maskInstance = _this3.initMask(layer); // 初始化 mask
|
|
217
|
-
_this3.addMask(maskInstance, layer.id);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// 兼容历史接口
|
|
222
|
-
}, {
|
|
223
|
-
key: "initMask",
|
|
224
|
-
value: function initMask(layer) {
|
|
225
|
-
var _layer$getLayerConfig = layer.getLayerConfig(),
|
|
226
|
-
mask = _layer$getLayerConfig.mask,
|
|
227
|
-
maskfence = _layer$getLayerConfig.maskfence,
|
|
228
|
-
_layer$getLayerConfig2 = _layer$getLayerConfig.maskColor,
|
|
229
|
-
maskColor = _layer$getLayerConfig2 === void 0 ? '#000' : _layer$getLayerConfig2,
|
|
230
|
-
_layer$getLayerConfig3 = _layer$getLayerConfig.maskOpacity,
|
|
231
|
-
maskOpacity = _layer$getLayerConfig3 === void 0 ? 0 : _layer$getLayerConfig3;
|
|
232
|
-
if (!mask || !maskfence) {
|
|
233
|
-
return undefined;
|
|
234
|
-
}
|
|
235
|
-
var maskInstance = new MaskLayer().source(maskfence).shape('fill').style({
|
|
236
|
-
color: maskColor,
|
|
237
|
-
opacity: maskOpacity
|
|
238
163
|
});
|
|
239
|
-
return maskInstance;
|
|
240
164
|
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
}, {
|
|
273
|
-
key: "getLayerByName",
|
|
274
|
-
value: function getLayerByName(name) {
|
|
275
|
-
return this.layerService.getLayerByName(name);
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "removeLayer",
|
|
279
|
-
value: function () {
|
|
280
|
-
var _removeLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layer, parentLayer) {
|
|
281
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
282
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
283
|
-
case 0:
|
|
284
|
-
_context3.next = 2;
|
|
285
|
-
return this.layerService.remove(layer, parentLayer);
|
|
286
|
-
case 2:
|
|
287
|
-
case "end":
|
|
288
|
-
return _context3.stop();
|
|
289
|
-
}
|
|
290
|
-
}, _callee3, this);
|
|
291
|
-
}));
|
|
292
|
-
function removeLayer(_x3, _x4) {
|
|
293
|
-
return _removeLayer.apply(this, arguments);
|
|
294
|
-
}
|
|
295
|
-
return removeLayer;
|
|
296
|
-
}()
|
|
297
|
-
}, {
|
|
298
|
-
key: "removeAllLayer",
|
|
299
|
-
value: function () {
|
|
300
|
-
var _removeAllLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
301
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
302
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
303
|
-
case 0:
|
|
304
|
-
_context4.next = 2;
|
|
305
|
-
return this.layerService.removeAllLayers();
|
|
306
|
-
case 2:
|
|
307
|
-
case "end":
|
|
308
|
-
return _context4.stop();
|
|
309
|
-
}
|
|
310
|
-
}, _callee4, this);
|
|
311
|
-
}));
|
|
312
|
-
function removeAllLayer() {
|
|
313
|
-
return _removeAllLayer.apply(this, arguments);
|
|
314
|
-
}
|
|
315
|
-
return removeAllLayer;
|
|
316
|
-
}()
|
|
317
|
-
}, {
|
|
318
|
-
key: "render",
|
|
319
|
-
value: function render() {
|
|
320
|
-
this.sceneService.render();
|
|
321
|
-
}
|
|
322
|
-
}, {
|
|
323
|
-
key: "setEnableRender",
|
|
324
|
-
value: function setEnableRender(flag) {
|
|
325
|
-
this.layerService.setEnableRender(flag);
|
|
165
|
+
}
|
|
166
|
+
// 兼容历史接口
|
|
167
|
+
initMask(layer) {
|
|
168
|
+
const {
|
|
169
|
+
mask,
|
|
170
|
+
maskfence,
|
|
171
|
+
maskColor = "#000",
|
|
172
|
+
maskOpacity = 0
|
|
173
|
+
} = layer.getLayerConfig();
|
|
174
|
+
if (!mask || !maskfence) {
|
|
175
|
+
return void 0;
|
|
176
|
+
}
|
|
177
|
+
const maskInstance = new MaskLayer().source(maskfence).shape("fill").style({
|
|
178
|
+
color: maskColor,
|
|
179
|
+
opacity: maskOpacity
|
|
180
|
+
});
|
|
181
|
+
return maskInstance;
|
|
182
|
+
}
|
|
183
|
+
addMask(mask, layerId) {
|
|
184
|
+
if (!mask) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const parent = this.getLayer(layerId);
|
|
188
|
+
if (parent) {
|
|
189
|
+
const layerContainer = createLayerContainer(this.container);
|
|
190
|
+
mask.setContainer(layerContainer);
|
|
191
|
+
parent.addMaskLayer(mask);
|
|
192
|
+
this.sceneService.addMask(mask);
|
|
193
|
+
} else {
|
|
194
|
+
console.warn("parent layer not find!");
|
|
326
195
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
196
|
+
}
|
|
197
|
+
getPickedLayer() {
|
|
198
|
+
return this.layerService.pickedLayerId;
|
|
199
|
+
}
|
|
200
|
+
getLayers() {
|
|
201
|
+
return this.layerService.getLayers();
|
|
202
|
+
}
|
|
203
|
+
getLayer(id) {
|
|
204
|
+
return this.layerService.getLayer(id);
|
|
205
|
+
}
|
|
206
|
+
getLayerByName(name) {
|
|
207
|
+
return this.layerService.getLayerByName(name);
|
|
208
|
+
}
|
|
209
|
+
removeLayer(layer, parentLayer) {
|
|
210
|
+
return __async(this, null, function* () {
|
|
211
|
+
yield this.layerService.remove(layer, parentLayer);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
removeAllLayer() {
|
|
215
|
+
return __async(this, null, function* () {
|
|
216
|
+
yield this.layerService.removeAllLayers();
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
render() {
|
|
220
|
+
this.sceneService.render();
|
|
221
|
+
}
|
|
222
|
+
setEnableRender(flag) {
|
|
223
|
+
this.layerService.setEnableRender(flag);
|
|
224
|
+
}
|
|
225
|
+
// asset method
|
|
226
|
+
/**
|
|
227
|
+
* 为 layer/point/text 支持 iconfont 模式支持
|
|
228
|
+
* @param fontUnicode
|
|
229
|
+
* @param name
|
|
230
|
+
*/
|
|
231
|
+
addIconFont(name, fontUnicode) {
|
|
232
|
+
this.fontService.addIconFont(name, fontUnicode);
|
|
233
|
+
}
|
|
234
|
+
addIconFonts(options) {
|
|
235
|
+
options.forEach(([name, fontUnicode]) => {
|
|
337
236
|
this.fontService.addIconFont(name, fontUnicode);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* 用户自定义添加第三方字体
|
|
241
|
+
* @param fontFamily
|
|
242
|
+
* @param fontPath
|
|
243
|
+
*/
|
|
244
|
+
addFontFace(fontFamily, fontPath) {
|
|
245
|
+
this.fontService.once("fontloaded", (e) => {
|
|
246
|
+
this.emit("fontloaded", e);
|
|
247
|
+
});
|
|
248
|
+
this.fontService.addFontFace(fontFamily, fontPath);
|
|
249
|
+
}
|
|
250
|
+
addImage(id, img) {
|
|
251
|
+
return __async(this, null, function* () {
|
|
252
|
+
yield this.iconService.addImage(id, img);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
hasImage(id) {
|
|
256
|
+
return this.iconService.hasImage(id);
|
|
257
|
+
}
|
|
258
|
+
removeImage(id) {
|
|
259
|
+
this.iconService.removeImage(id);
|
|
260
|
+
}
|
|
261
|
+
addIconFontGlyphs(fontFamily, glyphs) {
|
|
262
|
+
this.fontService.addIconGlyphs(glyphs);
|
|
263
|
+
}
|
|
264
|
+
// map control method
|
|
265
|
+
addControl(ctr) {
|
|
266
|
+
this.controlService.addControl(ctr, this.container);
|
|
267
|
+
}
|
|
268
|
+
removeControl(ctr) {
|
|
269
|
+
this.controlService.removeControl(ctr);
|
|
270
|
+
}
|
|
271
|
+
getControlByName(name) {
|
|
272
|
+
return this.controlService.getControlByName(name);
|
|
273
|
+
}
|
|
274
|
+
// marker
|
|
275
|
+
addMarker(marker) {
|
|
276
|
+
this.markerService.addMarker(marker);
|
|
277
|
+
}
|
|
278
|
+
addMarkerLayer(layer) {
|
|
279
|
+
this.markerService.addMarkerLayer(layer);
|
|
280
|
+
}
|
|
281
|
+
removeMarkerLayer(layer) {
|
|
282
|
+
this.markerService.removeMarkerLayer(layer);
|
|
283
|
+
}
|
|
284
|
+
removeAllMarkers() {
|
|
285
|
+
this.markerService.removeAllMarkers();
|
|
286
|
+
}
|
|
287
|
+
removeAllMakers() {
|
|
288
|
+
console.warn("removeAllMakers 已废弃,请使用 removeAllMarkers");
|
|
289
|
+
this.markerService.removeAllMarkers();
|
|
290
|
+
}
|
|
291
|
+
addPopup(popup) {
|
|
292
|
+
this.popupService.addPopup(popup);
|
|
293
|
+
}
|
|
294
|
+
removePopup(popup) {
|
|
295
|
+
this.popupService.removePopup(popup);
|
|
296
|
+
}
|
|
297
|
+
on(type, handle) {
|
|
298
|
+
var _a;
|
|
299
|
+
if (BoxSelectEventList.includes(type)) {
|
|
300
|
+
(_a = this.boxSelect) == null ? void 0 : _a.on(type, handle);
|
|
301
|
+
} else if (SceneEventList.includes(type)) {
|
|
302
|
+
this.sceneService.on(type, handle);
|
|
303
|
+
} else {
|
|
304
|
+
this.mapService.on(type, handle);
|
|
338
305
|
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* 用户自定义添加第三方字体
|
|
352
|
-
* @param fontFamily
|
|
353
|
-
* @param fontPath
|
|
354
|
-
*/
|
|
355
|
-
}, {
|
|
356
|
-
key: "addFontFace",
|
|
357
|
-
value: function addFontFace(fontFamily, fontPath) {
|
|
358
|
-
var _this5 = this;
|
|
359
|
-
this.fontService.once('fontloaded', function (e) {
|
|
360
|
-
_this5.emit('fontloaded', e);
|
|
361
|
-
});
|
|
362
|
-
this.fontService.addFontFace(fontFamily, fontPath);
|
|
363
|
-
}
|
|
364
|
-
}, {
|
|
365
|
-
key: "addImage",
|
|
366
|
-
value: function () {
|
|
367
|
-
var _addImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, img) {
|
|
368
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
369
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
370
|
-
case 0:
|
|
371
|
-
_context5.next = 2;
|
|
372
|
-
return this.iconService.addImage(id, img);
|
|
373
|
-
case 2:
|
|
374
|
-
case "end":
|
|
375
|
-
return _context5.stop();
|
|
376
|
-
}
|
|
377
|
-
}, _callee5, this);
|
|
378
|
-
}));
|
|
379
|
-
function addImage(_x5, _x6) {
|
|
380
|
-
return _addImage.apply(this, arguments);
|
|
381
|
-
}
|
|
382
|
-
return addImage;
|
|
383
|
-
}()
|
|
384
|
-
}, {
|
|
385
|
-
key: "hasImage",
|
|
386
|
-
value: function hasImage(id) {
|
|
387
|
-
return this.iconService.hasImage(id);
|
|
388
|
-
}
|
|
389
|
-
}, {
|
|
390
|
-
key: "removeImage",
|
|
391
|
-
value: function removeImage(id) {
|
|
392
|
-
this.iconService.removeImage(id);
|
|
393
|
-
}
|
|
394
|
-
}, {
|
|
395
|
-
key: "addIconFontGlyphs",
|
|
396
|
-
value: function addIconFontGlyphs(fontFamily, glyphs) {
|
|
397
|
-
this.fontService.addIconGlyphs(glyphs);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// map control method
|
|
401
|
-
}, {
|
|
402
|
-
key: "addControl",
|
|
403
|
-
value: function addControl(ctr) {
|
|
404
|
-
this.controlService.addControl(ctr, this.container);
|
|
405
|
-
}
|
|
406
|
-
}, {
|
|
407
|
-
key: "removeControl",
|
|
408
|
-
value: function removeControl(ctr) {
|
|
409
|
-
this.controlService.removeControl(ctr);
|
|
410
|
-
}
|
|
411
|
-
}, {
|
|
412
|
-
key: "getControlByName",
|
|
413
|
-
value: function getControlByName(name) {
|
|
414
|
-
return this.controlService.getControlByName(name);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// marker
|
|
418
|
-
}, {
|
|
419
|
-
key: "addMarker",
|
|
420
|
-
value: function addMarker(marker) {
|
|
421
|
-
this.markerService.addMarker(marker);
|
|
422
|
-
}
|
|
423
|
-
}, {
|
|
424
|
-
key: "addMarkerLayer",
|
|
425
|
-
value: function addMarkerLayer(layer) {
|
|
426
|
-
this.markerService.addMarkerLayer(layer);
|
|
427
|
-
}
|
|
428
|
-
}, {
|
|
429
|
-
key: "removeMarkerLayer",
|
|
430
|
-
value: function removeMarkerLayer(layer) {
|
|
431
|
-
this.markerService.removeMarkerLayer(layer);
|
|
432
|
-
}
|
|
433
|
-
}, {
|
|
434
|
-
key: "removeAllMarkers",
|
|
435
|
-
value: function removeAllMarkers() {
|
|
436
|
-
this.markerService.removeAllMarkers();
|
|
437
|
-
}
|
|
438
|
-
}, {
|
|
439
|
-
key: "removeAllMakers",
|
|
440
|
-
value: function removeAllMakers() {
|
|
441
|
-
console.warn('removeAllMakers 已废弃,请使用 removeAllMarkers');
|
|
442
|
-
this.markerService.removeAllMarkers();
|
|
443
|
-
}
|
|
444
|
-
}, {
|
|
445
|
-
key: "addPopup",
|
|
446
|
-
value: function addPopup(popup) {
|
|
447
|
-
this.popupService.addPopup(popup);
|
|
448
|
-
}
|
|
449
|
-
}, {
|
|
450
|
-
key: "removePopup",
|
|
451
|
-
value: function removePopup(popup) {
|
|
452
|
-
this.popupService.removePopup(popup);
|
|
453
|
-
}
|
|
454
|
-
}, {
|
|
455
|
-
key: "on",
|
|
456
|
-
value: function on(type, handle) {
|
|
457
|
-
if (BoxSelectEventList.includes(type)) {
|
|
458
|
-
var _this$boxSelect;
|
|
459
|
-
(_this$boxSelect = this.boxSelect) === null || _this$boxSelect === void 0 || _this$boxSelect.on(type, handle);
|
|
460
|
-
} else if (SceneEventList.includes(type)) {
|
|
461
|
-
this.sceneService.on(type, handle);
|
|
462
|
-
} else {
|
|
463
|
-
this.mapService.on(type, handle);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}, {
|
|
467
|
-
key: "once",
|
|
468
|
-
value: function once(type, handle) {
|
|
469
|
-
if (BoxSelectEventList.includes(type)) {
|
|
470
|
-
var _this$boxSelect2;
|
|
471
|
-
(_this$boxSelect2 = this.boxSelect) === null || _this$boxSelect2 === void 0 || _this$boxSelect2.once(type, handle);
|
|
472
|
-
} else if (SceneEventList.includes(type)) {
|
|
473
|
-
this.sceneService.once(type, handle);
|
|
474
|
-
} else {
|
|
475
|
-
this.mapService.once(type, handle);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}, {
|
|
479
|
-
key: "emit",
|
|
480
|
-
value: function emit(type, handle) {
|
|
481
|
-
SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.emit(type, handle);
|
|
482
|
-
}
|
|
483
|
-
}, {
|
|
484
|
-
key: "off",
|
|
485
|
-
value: function off(type, handle) {
|
|
486
|
-
if (BoxSelectEventList.includes(type)) {
|
|
487
|
-
var _this$boxSelect3;
|
|
488
|
-
(_this$boxSelect3 = this.boxSelect) === null || _this$boxSelect3 === void 0 || _this$boxSelect3.off(type, handle);
|
|
489
|
-
} else if (SceneEventList.includes(type)) {
|
|
490
|
-
this.sceneService.off(type, handle);
|
|
491
|
-
} else {
|
|
492
|
-
this.mapService.off(type, handle);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// implements IMapController
|
|
497
|
-
}, {
|
|
498
|
-
key: "getZoom",
|
|
499
|
-
value: function getZoom() {
|
|
500
|
-
return this.mapService.getZoom();
|
|
501
|
-
}
|
|
502
|
-
}, {
|
|
503
|
-
key: "getCenter",
|
|
504
|
-
value: function getCenter(options) {
|
|
505
|
-
return this.mapService.getCenter(options);
|
|
506
|
-
}
|
|
507
|
-
}, {
|
|
508
|
-
key: "setCenter",
|
|
509
|
-
value: function setCenter(center, options) {
|
|
510
|
-
return this.mapService.setCenter(center, options);
|
|
511
|
-
}
|
|
512
|
-
}, {
|
|
513
|
-
key: "getPitch",
|
|
514
|
-
value: function getPitch() {
|
|
515
|
-
return this.mapService.getPitch();
|
|
516
|
-
}
|
|
517
|
-
}, {
|
|
518
|
-
key: "setPitch",
|
|
519
|
-
value: function setPitch(pitch) {
|
|
520
|
-
return this.mapService.setPitch(pitch);
|
|
521
|
-
}
|
|
522
|
-
}, {
|
|
523
|
-
key: "getRotation",
|
|
524
|
-
value: function getRotation() {
|
|
525
|
-
return this.mapService.getRotation();
|
|
526
|
-
}
|
|
527
|
-
}, {
|
|
528
|
-
key: "getBounds",
|
|
529
|
-
value: function getBounds() {
|
|
530
|
-
return this.mapService.getBounds();
|
|
531
|
-
}
|
|
532
|
-
}, {
|
|
533
|
-
key: "setRotation",
|
|
534
|
-
value: function setRotation(rotation) {
|
|
535
|
-
this.mapService.setRotation(rotation);
|
|
536
|
-
}
|
|
537
|
-
}, {
|
|
538
|
-
key: "zoomIn",
|
|
539
|
-
value: function zoomIn() {
|
|
540
|
-
this.mapService.zoomIn();
|
|
541
|
-
}
|
|
542
|
-
}, {
|
|
543
|
-
key: "zoomOut",
|
|
544
|
-
value: function zoomOut() {
|
|
545
|
-
this.mapService.zoomOut();
|
|
546
|
-
}
|
|
547
|
-
}, {
|
|
548
|
-
key: "panTo",
|
|
549
|
-
value: function panTo(p) {
|
|
550
|
-
this.mapService.panTo(p);
|
|
551
|
-
}
|
|
552
|
-
}, {
|
|
553
|
-
key: "panBy",
|
|
554
|
-
value: function panBy(x, y) {
|
|
555
|
-
this.mapService.panBy(x, y);
|
|
556
|
-
}
|
|
557
|
-
}, {
|
|
558
|
-
key: "getContainer",
|
|
559
|
-
value: function getContainer() {
|
|
560
|
-
return this.mapService.getContainer();
|
|
306
|
+
}
|
|
307
|
+
once(type, handle) {
|
|
308
|
+
var _a;
|
|
309
|
+
if (BoxSelectEventList.includes(type)) {
|
|
310
|
+
(_a = this.boxSelect) == null ? void 0 : _a.once(type, handle);
|
|
311
|
+
} else if (SceneEventList.includes(type)) {
|
|
312
|
+
this.sceneService.once(type, handle);
|
|
313
|
+
} else {
|
|
314
|
+
this.mapService.once(type, handle);
|
|
561
315
|
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
316
|
+
}
|
|
317
|
+
emit(type, handle) {
|
|
318
|
+
SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.emit(type, handle);
|
|
319
|
+
}
|
|
320
|
+
off(type, handle) {
|
|
321
|
+
var _a;
|
|
322
|
+
if (BoxSelectEventList.includes(type)) {
|
|
323
|
+
(_a = this.boxSelect) == null ? void 0 : _a.off(type, handle);
|
|
324
|
+
} else if (SceneEventList.includes(type)) {
|
|
325
|
+
this.sceneService.off(type, handle);
|
|
326
|
+
} else {
|
|
327
|
+
this.mapService.off(type, handle);
|
|
566
328
|
}
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
329
|
+
}
|
|
330
|
+
// implements IMapController
|
|
331
|
+
getZoom() {
|
|
332
|
+
return this.mapService.getZoom();
|
|
333
|
+
}
|
|
334
|
+
getCenter(options) {
|
|
335
|
+
return this.mapService.getCenter(options);
|
|
336
|
+
}
|
|
337
|
+
setCenter(center, options) {
|
|
338
|
+
return this.mapService.setCenter(center, options);
|
|
339
|
+
}
|
|
340
|
+
getPitch() {
|
|
341
|
+
return this.mapService.getPitch();
|
|
342
|
+
}
|
|
343
|
+
setPitch(pitch) {
|
|
344
|
+
return this.mapService.setPitch(pitch);
|
|
345
|
+
}
|
|
346
|
+
getRotation() {
|
|
347
|
+
return this.mapService.getRotation();
|
|
348
|
+
}
|
|
349
|
+
getBounds() {
|
|
350
|
+
return this.mapService.getBounds();
|
|
351
|
+
}
|
|
352
|
+
setRotation(rotation) {
|
|
353
|
+
this.mapService.setRotation(rotation);
|
|
354
|
+
}
|
|
355
|
+
zoomIn() {
|
|
356
|
+
this.mapService.zoomIn();
|
|
357
|
+
}
|
|
358
|
+
zoomOut() {
|
|
359
|
+
this.mapService.zoomOut();
|
|
360
|
+
}
|
|
361
|
+
panTo(p) {
|
|
362
|
+
this.mapService.panTo(p);
|
|
363
|
+
}
|
|
364
|
+
panBy(x, y) {
|
|
365
|
+
this.mapService.panBy(x, y);
|
|
366
|
+
}
|
|
367
|
+
getContainer() {
|
|
368
|
+
return this.mapService.getContainer();
|
|
369
|
+
}
|
|
370
|
+
setZoom(zoom) {
|
|
371
|
+
this.mapService.setZoom(zoom);
|
|
372
|
+
}
|
|
373
|
+
fitBounds(bound, options) {
|
|
374
|
+
const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();
|
|
375
|
+
this.mapService.fitBounds(
|
|
376
|
+
bound,
|
|
574
377
|
// 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入
|
|
575
|
-
options ||
|
|
576
|
-
animate
|
|
577
|
-
})
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
}, {
|
|
623
|
-
key: "registerPostProcessingPass",
|
|
624
|
-
value: function registerPostProcessingPass(constructor) {
|
|
625
|
-
this.container.postProcessingPass.name = new constructor();
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// 控制 shader pick 计算
|
|
629
|
-
}, {
|
|
630
|
-
key: "enableShaderPick",
|
|
631
|
-
value: function enableShaderPick() {
|
|
632
|
-
this.layerService.enableShaderPick();
|
|
633
|
-
}
|
|
634
|
-
}, {
|
|
635
|
-
key: "diasbleShaderPick",
|
|
636
|
-
value: function diasbleShaderPick() {
|
|
637
|
-
this.layerService.disableShaderPick();
|
|
638
|
-
}
|
|
639
|
-
}, {
|
|
640
|
-
key: "enableBoxSelect",
|
|
641
|
-
value: function enableBoxSelect() {
|
|
642
|
-
var _this6 = this;
|
|
643
|
-
var once = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
644
|
-
this.boxSelect.enable();
|
|
645
|
-
if (once) {
|
|
646
|
-
this.boxSelect.once('selectend', function () {
|
|
647
|
-
_this6.disableBoxSelect();
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}, {
|
|
652
|
-
key: "disableBoxSelect",
|
|
653
|
-
value: function disableBoxSelect() {
|
|
654
|
-
this.boxSelect.disable();
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// 数据协议
|
|
658
|
-
}, {
|
|
659
|
-
key: "getProtocol",
|
|
660
|
-
value: function getProtocol(protocol) {
|
|
661
|
-
return SceneConifg.REGISTERED_PROTOCOLS[protocol];
|
|
662
|
-
}
|
|
663
|
-
}, {
|
|
664
|
-
key: "startAnimate",
|
|
665
|
-
value: function startAnimate() {
|
|
666
|
-
this.layerService.startAnimate();
|
|
667
|
-
}
|
|
668
|
-
}, {
|
|
669
|
-
key: "stopAnimate",
|
|
670
|
-
value: function stopAnimate() {
|
|
671
|
-
this.layerService.stopAnimate();
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// get current point size info
|
|
675
|
-
}, {
|
|
676
|
-
key: "getPointSizeRange",
|
|
677
|
-
value: function getPointSizeRange() {
|
|
678
|
-
return this.sceneService.getPointSizeRange();
|
|
378
|
+
options || __spreadProps(__spreadValues({}, fitBoundsOptions), {
|
|
379
|
+
animate
|
|
380
|
+
})
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
setZoomAndCenter(zoom, center) {
|
|
384
|
+
this.mapService.setZoomAndCenter(zoom, center);
|
|
385
|
+
}
|
|
386
|
+
setMapStyle(style) {
|
|
387
|
+
this.mapService.setMapStyle(style);
|
|
388
|
+
}
|
|
389
|
+
setMapStatus(options) {
|
|
390
|
+
this.mapService.setMapStatus(options);
|
|
391
|
+
}
|
|
392
|
+
// conversion Method
|
|
393
|
+
pixelToLngLat(pixel) {
|
|
394
|
+
return this.mapService.pixelToLngLat(pixel);
|
|
395
|
+
}
|
|
396
|
+
lngLatToPixel(lnglat) {
|
|
397
|
+
return this.mapService.lngLatToPixel(lnglat);
|
|
398
|
+
}
|
|
399
|
+
containerToLngLat(pixel) {
|
|
400
|
+
return this.mapService.containerToLngLat(pixel);
|
|
401
|
+
}
|
|
402
|
+
lngLatToContainer(lnglat) {
|
|
403
|
+
return this.mapService.lngLatToContainer(lnglat);
|
|
404
|
+
}
|
|
405
|
+
destroy() {
|
|
406
|
+
this.sceneService.destroy();
|
|
407
|
+
}
|
|
408
|
+
registerPostProcessingPass(constructor) {
|
|
409
|
+
this.container.postProcessingPass.name = new constructor();
|
|
410
|
+
}
|
|
411
|
+
// 控制 shader pick 计算
|
|
412
|
+
enableShaderPick() {
|
|
413
|
+
this.layerService.enableShaderPick();
|
|
414
|
+
}
|
|
415
|
+
diasbleShaderPick() {
|
|
416
|
+
this.layerService.disableShaderPick();
|
|
417
|
+
}
|
|
418
|
+
enableBoxSelect(once = true) {
|
|
419
|
+
this.boxSelect.enable();
|
|
420
|
+
if (once) {
|
|
421
|
+
this.boxSelect.once("selectend", () => {
|
|
422
|
+
this.disableBoxSelect();
|
|
423
|
+
});
|
|
679
424
|
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
425
|
+
}
|
|
426
|
+
disableBoxSelect() {
|
|
427
|
+
this.boxSelect.disable();
|
|
428
|
+
}
|
|
429
|
+
// 数据协议
|
|
430
|
+
static addProtocol(protocol, handler) {
|
|
431
|
+
SceneConifg.REGISTERED_PROTOCOLS[protocol] = handler;
|
|
432
|
+
}
|
|
433
|
+
static removeProtocol(protocol) {
|
|
434
|
+
delete SceneConifg.REGISTERED_PROTOCOLS[protocol];
|
|
435
|
+
}
|
|
436
|
+
getProtocol(protocol) {
|
|
437
|
+
return SceneConifg.REGISTERED_PROTOCOLS[protocol];
|
|
438
|
+
}
|
|
439
|
+
startAnimate() {
|
|
440
|
+
this.layerService.startAnimate();
|
|
441
|
+
}
|
|
442
|
+
stopAnimate() {
|
|
443
|
+
this.layerService.stopAnimate();
|
|
444
|
+
}
|
|
445
|
+
// get current point size info
|
|
446
|
+
getPointSizeRange() {
|
|
447
|
+
return this.sceneService.getPointSizeRange();
|
|
448
|
+
}
|
|
449
|
+
initComponent(id) {
|
|
450
|
+
this.controlService.init(
|
|
451
|
+
{
|
|
684
452
|
container: DOM.getContainer(id)
|
|
685
|
-
},
|
|
686
|
-
this.
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (logoVisible) {
|
|
696
|
-
this.addControl(new Logo({
|
|
697
|
-
position: logoPosition
|
|
698
|
-
}));
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}, {
|
|
702
|
-
key: "initTileLayer",
|
|
703
|
-
value: function initTileLayer(layer) {
|
|
704
|
-
if (layer.getSource().isTile) {
|
|
705
|
-
layer.tileLayer = new TileLayer(layer);
|
|
706
|
-
// Todo 支持瓦片更新
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
}], [{
|
|
710
|
-
key: "addProtocol",
|
|
711
|
-
value: function addProtocol(protocol, handler) {
|
|
712
|
-
SceneConifg.REGISTERED_PROTOCOLS[protocol] = handler;
|
|
453
|
+
},
|
|
454
|
+
this.container
|
|
455
|
+
);
|
|
456
|
+
this.markerService.init(this.container);
|
|
457
|
+
this.popupService.init(this.container);
|
|
458
|
+
}
|
|
459
|
+
initControl() {
|
|
460
|
+
const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();
|
|
461
|
+
if (logoVisible) {
|
|
462
|
+
this.addControl(new Logo({ position: logoPosition }));
|
|
713
463
|
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
464
|
+
}
|
|
465
|
+
initTileLayer(layer) {
|
|
466
|
+
if (layer.getSource().isTile) {
|
|
467
|
+
layer.tileLayer = new TileLayer(layer);
|
|
718
468
|
}
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
export {
|
|
472
|
+
Scene
|
|
473
|
+
};
|