bbj-screen-widget 2.4.74 → 2.4.76
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/bbj-screen-widget.metadata.json +1 -1
- package/bundles/bbj-screen-widget-core.umd.js +20 -0
- package/bundles/bbj-screen-widget-core.umd.js.map +1 -1
- package/bundles/bbj-screen-widget-core.umd.min.js +1 -1
- package/bundles/bbj-screen-widget-core.umd.min.js.map +1 -1
- package/bundles/bbj-screen-widget.umd.js +313 -132
- package/bundles/bbj-screen-widget.umd.js.map +1 -1
- package/bundles/bbj-screen-widget.umd.min.js +1 -1
- package/bundles/bbj-screen-widget.umd.min.js.map +1 -1
- package/core/bbj-screen-widget-core.metadata.json +1 -1
- package/core/util/map.util.d.ts +10 -0
- package/esm2015/core/util/map.util.js +20 -1
- package/esm2015/lib/custom-baidu-map/baidu-fence/baidu-fence.component.js +162 -61
- package/esm2015/lib/custom-baidu-map/baidu-lushu/baidu-lushu.component.js +32 -10
- package/fesm2015/bbj-screen-widget-core.js +20 -1
- package/fesm2015/bbj-screen-widget-core.js.map +1 -1
- package/fesm2015/bbj-screen-widget.js +191 -68
- package/fesm2015/bbj-screen-widget.js.map +1 -1
- package/lib/custom-baidu-map/baidu-fence/baidu-fence.component.d.ts +7 -0
- package/package.json +1 -1
|
@@ -15221,7 +15221,7 @@ TyphoonAreaLayerComponent = __decorate([
|
|
|
15221
15221
|
], TyphoonAreaLayerComponent);
|
|
15222
15222
|
|
|
15223
15223
|
const EARTH_RADIUS$1 = 6371393;
|
|
15224
|
-
const ɵ0$c = { type: 'string', title: 'ID' };
|
|
15224
|
+
const ɵ0$c = { type: 'string', title: 'ID' }, ɵ1$c = { type: 'string', title: 'ID' };
|
|
15225
15225
|
let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
15226
15226
|
constructor(parent, zone, message) {
|
|
15227
15227
|
super(parent, zone);
|
|
@@ -15257,6 +15257,7 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15257
15257
|
},
|
|
15258
15258
|
];
|
|
15259
15259
|
this.create = new EventEmitter();
|
|
15260
|
+
this.update = new EventEmitter();
|
|
15260
15261
|
this.editData = [];
|
|
15261
15262
|
this.stopEdit$ = new Subject();
|
|
15262
15263
|
}
|
|
@@ -15292,7 +15293,10 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15292
15293
|
}
|
|
15293
15294
|
updateData() {
|
|
15294
15295
|
const data = [];
|
|
15295
|
-
this.data
|
|
15296
|
+
for (const r of this.data) {
|
|
15297
|
+
if (r.id && r.id === this.editId) {
|
|
15298
|
+
continue;
|
|
15299
|
+
}
|
|
15296
15300
|
if (r.type === 'circle') {
|
|
15297
15301
|
if (!r.radius || !r.lnglat) {
|
|
15298
15302
|
return;
|
|
@@ -15305,7 +15309,7 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15305
15309
|
// 转换中心点纬度为弧度
|
|
15306
15310
|
const centerLatRad = (centerLat * Math.PI) / 180;
|
|
15307
15311
|
// 存储轨迹点的数组
|
|
15308
|
-
const
|
|
15312
|
+
const coordinates = [];
|
|
15309
15313
|
// 遍历 0~360°,生成等间隔的点
|
|
15310
15314
|
for (let i = 0; i < pointsCount; i++) {
|
|
15311
15315
|
// 计算当前点的方位角(弧度):从0°到360°,均分pointsCount份
|
|
@@ -15317,12 +15321,12 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15317
15321
|
const newLat = centerLat + (deltaLatRad * 180) / Math.PI;
|
|
15318
15322
|
const newLng = centerLng + (deltaLngRad * 180) / Math.PI;
|
|
15319
15323
|
// 添加到轨迹数组(保留6位小数,经纬度常规精度)
|
|
15320
|
-
|
|
15324
|
+
coordinates.push([parseFloat(newLng.toFixed(6)), parseFloat(newLat.toFixed(6))]);
|
|
15321
15325
|
}
|
|
15322
15326
|
data.push({
|
|
15323
15327
|
geometry: {
|
|
15324
15328
|
type: 'Polygon',
|
|
15325
|
-
coordinates: [
|
|
15329
|
+
coordinates: [coordinates],
|
|
15326
15330
|
},
|
|
15327
15331
|
});
|
|
15328
15332
|
}
|
|
@@ -15339,26 +15343,28 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15339
15343
|
return [+lnglat[0], +lnglat[1]];
|
|
15340
15344
|
}));
|
|
15341
15345
|
data.push({
|
|
15346
|
+
id: r.id,
|
|
15342
15347
|
geometry: {
|
|
15343
15348
|
type: 'Polygon',
|
|
15344
15349
|
coordinates: coordinates,
|
|
15345
15350
|
},
|
|
15346
15351
|
});
|
|
15347
15352
|
}
|
|
15348
|
-
}
|
|
15353
|
+
}
|
|
15349
15354
|
this.layer.setData(data);
|
|
15350
15355
|
}
|
|
15351
|
-
|
|
15356
|
+
createScene() {
|
|
15352
15357
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15353
|
-
const { DrawScene,
|
|
15358
|
+
const { DrawScene, OperateEventType } = yield import('bmap-draw');
|
|
15354
15359
|
if (!this.scene) {
|
|
15355
15360
|
this.scene = new DrawScene(this.parent.map, { noLimit: true });
|
|
15356
15361
|
this.scene.addEventListener(OperateEventType.COMPLETE, (e) => {
|
|
15357
15362
|
console.log(e);
|
|
15363
|
+
let data;
|
|
15358
15364
|
if (e.target.overlay.radius) {
|
|
15359
15365
|
const radius = e.target.overlay.radius;
|
|
15360
15366
|
const lnglat = e.target.overlay.latLng;
|
|
15361
|
-
|
|
15367
|
+
data = {
|
|
15362
15368
|
type: 'circle',
|
|
15363
15369
|
lnglat: `${lnglat.lng},${lnglat.lat}`,
|
|
15364
15370
|
radius: radius,
|
|
@@ -15367,14 +15373,12 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15367
15373
|
// this.parent.map.removeOverlay(r);
|
|
15368
15374
|
// });
|
|
15369
15375
|
this.create.emit(data);
|
|
15370
|
-
this.editOverlay = null;
|
|
15371
15376
|
}
|
|
15372
15377
|
else {
|
|
15373
15378
|
const points = e.target.overlay.getPoints();
|
|
15374
15379
|
if (!this.data) {
|
|
15375
15380
|
this.data = [];
|
|
15376
15381
|
}
|
|
15377
|
-
let data;
|
|
15378
15382
|
if (points.length && Array.isArray(points[0])) {
|
|
15379
15383
|
data = {
|
|
15380
15384
|
type: 'polygon',
|
|
@@ -15384,20 +15388,55 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15384
15388
|
else {
|
|
15385
15389
|
data = {
|
|
15386
15390
|
type: 'polygon',
|
|
15387
|
-
lnglat: points
|
|
15391
|
+
lnglat: points
|
|
15392
|
+
.map((p) => {
|
|
15393
|
+
let latLng = p.latLng;
|
|
15394
|
+
if (!latLng) {
|
|
15395
|
+
const [lng, lat] = this.parent.map.mercatorToLnglat(p.lng, p.lat);
|
|
15396
|
+
return `${lng},${lat}`;
|
|
15397
|
+
}
|
|
15398
|
+
else {
|
|
15399
|
+
return `${latLng.lng},${latLng.lat}`;
|
|
15400
|
+
}
|
|
15401
|
+
})
|
|
15402
|
+
.join(';'),
|
|
15388
15403
|
};
|
|
15389
15404
|
}
|
|
15405
|
+
}
|
|
15406
|
+
this.editOverlay = null;
|
|
15407
|
+
this.parent.map.removeOverlay(e.target.overlay);
|
|
15408
|
+
if (this.editId) {
|
|
15409
|
+
data.id = this.editId;
|
|
15410
|
+
const index = this.data.findIndex((r) => r.id === this.editId);
|
|
15411
|
+
if (index !== -1) {
|
|
15412
|
+
this.data[index] = data;
|
|
15413
|
+
}
|
|
15414
|
+
this.editId = null;
|
|
15415
|
+
this.updateData();
|
|
15416
|
+
}
|
|
15417
|
+
else {
|
|
15418
|
+
this.data.push(data);
|
|
15419
|
+
this.updateData();
|
|
15390
15420
|
this.create.emit(data);
|
|
15391
15421
|
}
|
|
15392
15422
|
});
|
|
15393
15423
|
this.scene.addEventListener(OperateEventType.CANCEL, (e) => {
|
|
15394
|
-
console.log(e);
|
|
15395
15424
|
if (this.editOverlay) {
|
|
15396
15425
|
this.parent.map.removeOverlay(this.editOverlay);
|
|
15397
15426
|
this.editOverlay = null;
|
|
15398
15427
|
}
|
|
15428
|
+
if (this.editId) {
|
|
15429
|
+
this.editId = null;
|
|
15430
|
+
this.updateData();
|
|
15431
|
+
}
|
|
15399
15432
|
});
|
|
15400
15433
|
}
|
|
15434
|
+
});
|
|
15435
|
+
}
|
|
15436
|
+
startDraw(type) {
|
|
15437
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15438
|
+
this.createScene();
|
|
15439
|
+
const { PolygonDraw, CircleDraw } = yield import('bmap-draw');
|
|
15401
15440
|
switch (type) {
|
|
15402
15441
|
case 'polygon':
|
|
15403
15442
|
if (!this.polygon) {
|
|
@@ -15490,10 +15529,42 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15490
15529
|
// }
|
|
15491
15530
|
// this.editData = null;
|
|
15492
15531
|
}
|
|
15532
|
+
editPolygon(boundaries) {
|
|
15533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15534
|
+
const { PolygonEdit } = yield import('bmap-draw');
|
|
15535
|
+
this.stopDraw();
|
|
15536
|
+
if (!this.polygonEdit) {
|
|
15537
|
+
this.polygonEdit = new PolygonEdit(this.scene);
|
|
15538
|
+
}
|
|
15539
|
+
const points = boundaries.map((boundary) => boundary.split(';').map((p) => {
|
|
15540
|
+
const [lng, lat] = p.split(',');
|
|
15541
|
+
return new BMapGL.Point(Number(lng), Number(lat));
|
|
15542
|
+
}));
|
|
15543
|
+
const overlay = new BMapGL.Polygon(points, this.getOptions());
|
|
15544
|
+
console.log(overlay);
|
|
15545
|
+
this.editOverlay = overlay;
|
|
15546
|
+
this.parent.map.addOverlay(overlay);
|
|
15547
|
+
this.parent.map.setViewport([].concat.apply([], points));
|
|
15548
|
+
this.polygonEdit.edit(overlay);
|
|
15549
|
+
});
|
|
15550
|
+
}
|
|
15551
|
+
editCircle(lng, lat, r) {
|
|
15552
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15553
|
+
const { CircleEdit } = yield import('bmap-draw');
|
|
15554
|
+
if (!this.circleEdit) {
|
|
15555
|
+
this.circleEdit = new CircleEdit(this.scene);
|
|
15556
|
+
}
|
|
15557
|
+
const center = new BMapGL.Point(lng, lat);
|
|
15558
|
+
this.moveCircleToView(lng, lat, r);
|
|
15559
|
+
const overlay = new BMapGL.Circle(center, r, this.getOptions());
|
|
15560
|
+
this.editOverlay = overlay;
|
|
15561
|
+
this.parent.map.addOverlay(overlay);
|
|
15562
|
+
this.circleEdit.open(overlay);
|
|
15563
|
+
});
|
|
15564
|
+
}
|
|
15493
15565
|
search() {
|
|
15494
15566
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15495
15567
|
// 如果正在绘制多边形围栏,获取地名边界并绘制
|
|
15496
|
-
const { PolygonEdit } = yield import('bmap-draw');
|
|
15497
15568
|
if (this.areaName) {
|
|
15498
15569
|
const boundary = new BMapGL.Boundary();
|
|
15499
15570
|
// 百度地图 Geocoder.getLocation 回调签名:(results, status)
|
|
@@ -15501,20 +15572,7 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15501
15572
|
console.log('边界坐标数组:', results);
|
|
15502
15573
|
// 检查状态是否成功
|
|
15503
15574
|
if (results && results.boundaries && results.boundaries.length) {
|
|
15504
|
-
this.
|
|
15505
|
-
if (!this.polygonEdit) {
|
|
15506
|
-
this.polygonEdit = new PolygonEdit(this.scene);
|
|
15507
|
-
}
|
|
15508
|
-
const points = results.boundaries.map((boundary) => boundary.split(';').map((p) => {
|
|
15509
|
-
const [lng, lat] = p.split(',');
|
|
15510
|
-
return new BMapGL.Point(Number(lng), Number(lat));
|
|
15511
|
-
}));
|
|
15512
|
-
const overlay = new BMapGL.Polygon(points, this.getOptions());
|
|
15513
|
-
console.log(overlay);
|
|
15514
|
-
this.editOverlay = overlay;
|
|
15515
|
-
this.parent.map.addOverlay(overlay);
|
|
15516
|
-
this.parent.map.setViewport([].concat.apply([], points));
|
|
15517
|
-
this.polygonEdit.edit(overlay);
|
|
15575
|
+
this.editPolygon(results.boundaries);
|
|
15518
15576
|
}
|
|
15519
15577
|
else {
|
|
15520
15578
|
this.message.error('行政区域不存在');
|
|
@@ -15536,15 +15594,7 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15536
15594
|
console.log(e);
|
|
15537
15595
|
// 如果正在绘制圆形围栏
|
|
15538
15596
|
if (this.circle) {
|
|
15539
|
-
|
|
15540
|
-
this.circleEdit = new CircleEdit(this.scene);
|
|
15541
|
-
}
|
|
15542
|
-
const center = new BMapGL.Point(value.location.lng, value.location.lat);
|
|
15543
|
-
this.parent.map.centerAndZoom(center, 16);
|
|
15544
|
-
const overlay = new BMapGL.Circle(center, 300, this.getOptions());
|
|
15545
|
-
this.editOverlay = overlay;
|
|
15546
|
-
this.parent.map.addOverlay(overlay);
|
|
15547
|
-
this.circleEdit.open(overlay);
|
|
15597
|
+
this.editCircle(value.location.lng, value.location.lat, 300);
|
|
15548
15598
|
this.searchText = null;
|
|
15549
15599
|
}
|
|
15550
15600
|
});
|
|
@@ -15560,27 +15610,7 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15560
15610
|
}
|
|
15561
15611
|
if (data.type === 'circle') {
|
|
15562
15612
|
const [lng, lat] = data.lnglat.split(',');
|
|
15563
|
-
|
|
15564
|
-
const centerLat = Number(lat);
|
|
15565
|
-
const radius = Number(data.radius);
|
|
15566
|
-
// 转换中心点纬度为弧度
|
|
15567
|
-
const centerLatRad = (centerLat * Math.PI) / 180;
|
|
15568
|
-
// 计算经度方向的偏移(弧度)
|
|
15569
|
-
const deltaLngRad = radius / (EARTH_RADIUS$1 * Math.cos(centerLatRad));
|
|
15570
|
-
// 计算纬度方向的偏移(弧度)
|
|
15571
|
-
const deltaLatRad = radius / EARTH_RADIUS$1;
|
|
15572
|
-
// 转换为角度偏移
|
|
15573
|
-
const deltaLng = (deltaLngRad * 180) / Math.PI;
|
|
15574
|
-
const deltaLat = (deltaLatRad * 180) / Math.PI;
|
|
15575
|
-
// 计算圆形的四个边界点(上、下、左、右)
|
|
15576
|
-
const points = [
|
|
15577
|
-
new BMapGL.Point(centerLng, centerLat + deltaLat),
|
|
15578
|
-
new BMapGL.Point(centerLng, centerLat - deltaLat),
|
|
15579
|
-
new BMapGL.Point(centerLng - deltaLng, centerLat),
|
|
15580
|
-
new BMapGL.Point(centerLng + deltaLng, centerLat),
|
|
15581
|
-
];
|
|
15582
|
-
// 使用 setViewport 方法调整视图,使整个圆形可见
|
|
15583
|
-
this.parent.map.setViewport(points);
|
|
15613
|
+
this.moveCircleToView(Number(lng), Number(lat), Number(data.radius));
|
|
15584
15614
|
}
|
|
15585
15615
|
else {
|
|
15586
15616
|
this.parent.map.setViewport(data.lnglat.split(/[;\n\r]+/).map((p) => {
|
|
@@ -15589,11 +15619,62 @@ let BaiduFenceComponent = class BaiduFenceComponent extends BaseLayer {
|
|
|
15589
15619
|
}));
|
|
15590
15620
|
}
|
|
15591
15621
|
}
|
|
15622
|
+
moveCircleToView(lng, lat, r) {
|
|
15623
|
+
const centerLng = Number(lng);
|
|
15624
|
+
const centerLat = Number(lat);
|
|
15625
|
+
const radius = Number(r);
|
|
15626
|
+
// 转换中心点纬度为弧度
|
|
15627
|
+
const centerLatRad = (centerLat * Math.PI) / 180;
|
|
15628
|
+
// 计算经度方向的偏移(弧度)
|
|
15629
|
+
const deltaLngRad = radius / (EARTH_RADIUS$1 * Math.cos(centerLatRad));
|
|
15630
|
+
// 计算纬度方向的偏移(弧度)
|
|
15631
|
+
const deltaLatRad = radius / EARTH_RADIUS$1;
|
|
15632
|
+
// 转换为角度偏移
|
|
15633
|
+
const deltaLng = (deltaLngRad * 180) / Math.PI;
|
|
15634
|
+
const deltaLat = (deltaLatRad * 180) / Math.PI;
|
|
15635
|
+
// 计算圆形的四个边界点(上、下、左、右)
|
|
15636
|
+
const points = [
|
|
15637
|
+
new BMapGL.Point(centerLng, centerLat + deltaLat),
|
|
15638
|
+
new BMapGL.Point(centerLng, centerLat - deltaLat),
|
|
15639
|
+
new BMapGL.Point(centerLng - deltaLng, centerLat),
|
|
15640
|
+
new BMapGL.Point(centerLng + deltaLng, centerLat),
|
|
15641
|
+
];
|
|
15642
|
+
// 使用 setViewport 方法调整视图,使整个圆形可见
|
|
15643
|
+
this.parent.map.setViewport(points);
|
|
15644
|
+
}
|
|
15645
|
+
edit(id) {
|
|
15646
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15647
|
+
if (!this.data) {
|
|
15648
|
+
console.log('没有数据');
|
|
15649
|
+
return;
|
|
15650
|
+
}
|
|
15651
|
+
const item = this.data.find((item) => item.id === id);
|
|
15652
|
+
if (!item) {
|
|
15653
|
+
console.log('找不到id', id);
|
|
15654
|
+
return;
|
|
15655
|
+
}
|
|
15656
|
+
if (!item.lnglat) {
|
|
15657
|
+
console.log('没有经纬度', item);
|
|
15658
|
+
return;
|
|
15659
|
+
}
|
|
15660
|
+
this.createScene();
|
|
15661
|
+
switch (item.type) {
|
|
15662
|
+
case 'circle':
|
|
15663
|
+
const [lng, lat] = item.lnglat.split(',');
|
|
15664
|
+
yield this.editCircle(Number(lng), Number(lat), Number(item.radius));
|
|
15665
|
+
break;
|
|
15666
|
+
default:
|
|
15667
|
+
yield this.editPolygon(item.lnglat.split('\r'));
|
|
15668
|
+
}
|
|
15669
|
+
this.editId = id;
|
|
15670
|
+
this.updateData();
|
|
15671
|
+
});
|
|
15672
|
+
}
|
|
15592
15673
|
};
|
|
15593
15674
|
BaiduFenceComponent.decorators = [
|
|
15594
15675
|
{ type: Component, args: [{
|
|
15595
15676
|
selector: 'sc-baidu-fence',
|
|
15596
|
-
template: "<ng-container *ngIf=\"showDrawButton\">\n <button nz-button (click)=\"startDraw('polygon')\">\u7ED8\u5236\u591A\u8FB9\u5F62</button>\n <button nz-button (click)=\"startDraw('circle')\">\u7ED8\u5236\u5706\u5F62</button>\n <button nz-button (click)=\"stopDraw()\">\u7ED3\u675F\u7ED8\u5236</button>\n <button nz-button (click)=\"
|
|
15677
|
+
template: "<ng-container *ngIf=\"showDrawButton\">\n <button nz-button (click)=\"startDraw('polygon')\">\u7ED8\u5236\u591A\u8FB9\u5F62</button>\n <button nz-button (click)=\"startDraw('circle')\">\u7ED8\u5236\u5706\u5F62</button>\n <button nz-button (click)=\"stopDraw()\">\u7ED3\u675F\u7ED8\u5236</button>\n <!-- <button nz-button (click)=\"edit('1')\">\u7F16\u8F91</button>\n <button nz-button (click)=\"edit('2')\">\u7F16\u8F912</button> -->\n</ng-container>\n<input\n nz-input\n [ngClass]=\"{ hidden: !circle?.isOpen }\"\n #suggest\n type=\"text\"\n [(ngModel)]=\"searchText\"\n placeholder=\"\u8BF7\u8F93\u5165\u4E2D\u5FC3\u70B9\u4F4D\u7F6E\"\n class=\"input\"\n/>\n<ng-container *ngIf=\"polygon?.isOpen\">\n <input nz-input type=\"text\" placeholder=\"\u8BF7\u8F93\u5165\u884C\u653F\u533A\u540D\u79F0\" [(ngModel)]=\"areaName\" class=\"input\" />\n <button nz-button (click)=\"search()\" style=\"margin-left: 12px\">\u786E\u8BA4</button>\n</ng-container>\n<!-- <input type=\"text\" placeholder=\"\u8BF7\u8F93\u5165\u5730\u70B9\" [(ngModel)]=\"searchText\" />\n<button nz-button (click)=\"search()\">\u67E5\u8BE2</button> -->\n",
|
|
15597
15678
|
styles: [":host{position:absolute;display:block;left:0;top:0;z-index:100;padding:12px;pointer-events:auto}button{transition:none}.hidden{display:none}.input{width:300px;margin-left:12px}"]
|
|
15598
15679
|
},] }
|
|
15599
15680
|
];
|
|
@@ -15657,6 +15738,19 @@ __decorate([
|
|
|
15657
15738
|
}),
|
|
15658
15739
|
__metadata("design:type", Object)
|
|
15659
15740
|
], BaiduFenceComponent.prototype, "create", void 0);
|
|
15741
|
+
__decorate([
|
|
15742
|
+
Event('编辑围栏', {
|
|
15743
|
+
params: {
|
|
15744
|
+
properties: {
|
|
15745
|
+
id: ɵ1$c,
|
|
15746
|
+
type: { type: 'string', title: '围栏类型' },
|
|
15747
|
+
lnglat: { type: 'string', title: '经纬度' },
|
|
15748
|
+
radius: { type: 'number', title: '半径' },
|
|
15749
|
+
},
|
|
15750
|
+
},
|
|
15751
|
+
}),
|
|
15752
|
+
__metadata("design:type", Object)
|
|
15753
|
+
], BaiduFenceComponent.prototype, "update", void 0);
|
|
15660
15754
|
__decorate([
|
|
15661
15755
|
Method('开始绘制'),
|
|
15662
15756
|
__param(0, Param('类型', {
|
|
@@ -15683,6 +15777,13 @@ __decorate([
|
|
|
15683
15777
|
__metadata("design:paramtypes", [String]),
|
|
15684
15778
|
__metadata("design:returntype", void 0)
|
|
15685
15779
|
], BaiduFenceComponent.prototype, "moveToView", null);
|
|
15780
|
+
__decorate([
|
|
15781
|
+
Method('编辑'),
|
|
15782
|
+
__param(0, Param('id')),
|
|
15783
|
+
__metadata("design:type", Function),
|
|
15784
|
+
__metadata("design:paramtypes", [String]),
|
|
15785
|
+
__metadata("design:returntype", Promise)
|
|
15786
|
+
], BaiduFenceComponent.prototype, "edit", null);
|
|
15686
15787
|
BaiduFenceComponent = __decorate([
|
|
15687
15788
|
Widget('电子围栏', {
|
|
15688
15789
|
group: 'component',
|
|
@@ -15754,17 +15855,36 @@ let BaiduLushuComponent = class BaiduLushuComponent {
|
|
|
15754
15855
|
return;
|
|
15755
15856
|
}
|
|
15756
15857
|
const landmarkPois = [];
|
|
15757
|
-
const arrPois =
|
|
15858
|
+
const arrPois = [];
|
|
15859
|
+
let lastPoint = null;
|
|
15860
|
+
let lastLandmark = null;
|
|
15861
|
+
for (const item of this.data) {
|
|
15862
|
+
const lng = Number(item.lng);
|
|
15863
|
+
const lat = Number(item.lat);
|
|
15864
|
+
// 去掉重复的点,重复的点会导致乱跳
|
|
15865
|
+
if (lastPoint && lastPoint.lng === lng && lastPoint.lat === lat) {
|
|
15866
|
+
if (lastLandmark && item.pauseTime) {
|
|
15867
|
+
lastLandmark.pauseTime += Number(item.pauseTime);
|
|
15868
|
+
}
|
|
15869
|
+
continue;
|
|
15870
|
+
}
|
|
15871
|
+
const point = new BMapGL.Point(lng, lat);
|
|
15872
|
+
arrPois.push(point);
|
|
15873
|
+
lastPoint = point;
|
|
15758
15874
|
if (item.landmark || item.pauseTime) {
|
|
15759
|
-
|
|
15760
|
-
lng
|
|
15761
|
-
lat
|
|
15875
|
+
const landmark = {
|
|
15876
|
+
lng,
|
|
15877
|
+
lat,
|
|
15762
15878
|
html: item.landmark || this.defaultContent,
|
|
15763
15879
|
pauseTime: item.pauseTime ? Number(item.pauseTime) : 0,
|
|
15764
|
-
}
|
|
15880
|
+
};
|
|
15881
|
+
landmarkPois.push(landmark);
|
|
15882
|
+
lastLandmark = landmark;
|
|
15765
15883
|
}
|
|
15766
|
-
|
|
15767
|
-
|
|
15884
|
+
else {
|
|
15885
|
+
lastLandmark = null;
|
|
15886
|
+
}
|
|
15887
|
+
}
|
|
15768
15888
|
if (this.showPolyline) {
|
|
15769
15889
|
this.polyline = new BMapGL.Polyline(arrPois, { strokeColor: this.polylineColor });
|
|
15770
15890
|
this.parent.map.addOverlay(this.polyline);
|
|
@@ -15802,11 +15922,13 @@ let BaiduLushuComponent = class BaiduLushuComponent {
|
|
|
15802
15922
|
}
|
|
15803
15923
|
clear() {
|
|
15804
15924
|
if (this.lushu) {
|
|
15925
|
+
this.lushu.stop();
|
|
15805
15926
|
this.lushu.clear();
|
|
15806
15927
|
this.lushu = null;
|
|
15807
15928
|
}
|
|
15808
15929
|
if (this.polyline) {
|
|
15809
15930
|
this.parent.map.removeOverlay(this.polyline);
|
|
15931
|
+
this.polyline = null;
|
|
15810
15932
|
}
|
|
15811
15933
|
}
|
|
15812
15934
|
setSpeed(speed) {
|
|
@@ -15895,6 +16017,7 @@ __decorate([
|
|
|
15895
16017
|
], BaiduLushuComponent.prototype, "pause", null);
|
|
15896
16018
|
__decorate([
|
|
15897
16019
|
Method('设置速度'),
|
|
16020
|
+
__param(0, Param('速度')),
|
|
15898
16021
|
__metadata("design:type", Function),
|
|
15899
16022
|
__metadata("design:paramtypes", [Number]),
|
|
15900
16023
|
__metadata("design:returntype", void 0)
|
|
@@ -19977,7 +20100,7 @@ BaseLayer$1.ctorParameters = () => [
|
|
|
19977
20100
|
{ type: NgZone }
|
|
19978
20101
|
];
|
|
19979
20102
|
|
|
19980
|
-
const ɵ0$e = { type: 'string', title: 'id' }, ɵ1$
|
|
20103
|
+
const ɵ0$e = { type: 'string', title: 'id' }, ɵ1$d = { type: 'string', title: 'id' }, ɵ2$a = { type: 'string', title: 'id' };
|
|
19981
20104
|
let TiandituMarkerComponent = class TiandituMarkerComponent extends BaseLayer$1 {
|
|
19982
20105
|
constructor(parent, zone, fileUrlService, nzContextMenuService) {
|
|
19983
20106
|
super(parent, zone);
|
|
@@ -20596,7 +20719,7 @@ __decorate([
|
|
|
20596
20719
|
Event('选中值改变', {
|
|
20597
20720
|
params: {
|
|
20598
20721
|
properties: {
|
|
20599
|
-
id: ɵ1$
|
|
20722
|
+
id: ɵ1$d,
|
|
20600
20723
|
address: { type: 'string', title: '地点' },
|
|
20601
20724
|
lng: { type: 'number', title: '经度' },
|
|
20602
20725
|
lat: { type: 'number', title: '纬度' },
|