bbj-screen-widget 2.4.73 → 2.4.75

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.
@@ -16662,24 +16662,53 @@
16662
16662
  this.clear();
16663
16663
  };
16664
16664
  BaiduLushuComponent.prototype.update = function () {
16665
- var _this = this;
16665
+ var e_1, _b;
16666
16666
  var _a;
16667
16667
  this.clear();
16668
16668
  if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.length)) {
16669
16669
  return;
16670
16670
  }
16671
16671
  var landmarkPois = [];
16672
- var arrPois = this.data.map(function (item) {
16673
- if (item.landmark || item.pauseTime) {
16674
- landmarkPois.push({
16675
- lng: Number(item.lng),
16676
- lat: Number(item.lat),
16677
- html: item.landmark || _this.defaultContent,
16678
- pauseTime: item.pauseTime ? Number(item.pauseTime) : 0,
16679
- });
16672
+ var arrPois = [];
16673
+ var lastPoint = null;
16674
+ var lastLandmark = null;
16675
+ try {
16676
+ for (var _c = __values(this.data), _d = _c.next(); !_d.done; _d = _c.next()) {
16677
+ var item = _d.value;
16678
+ var lng = Number(item.lng);
16679
+ var lat = Number(item.lat);
16680
+ // 去掉重复的点,重复的点会导致乱跳
16681
+ if (lastPoint && lastPoint.lng === lng && lastPoint.lat === lat) {
16682
+ if (lastLandmark && item.pauseTime) {
16683
+ lastLandmark.pauseTime += Number(item.pauseTime);
16684
+ }
16685
+ continue;
16686
+ }
16687
+ var point = new BMapGL.Point(lng, lat);
16688
+ arrPois.push(point);
16689
+ lastPoint = point;
16690
+ if (item.landmark || item.pauseTime) {
16691
+ var landmark = {
16692
+ lng: lng,
16693
+ lat: lat,
16694
+ html: item.landmark || this.defaultContent,
16695
+ pauseTime: item.pauseTime ? Number(item.pauseTime) : 0,
16696
+ };
16697
+ landmarkPois.push(landmark);
16698
+ lastLandmark = landmark;
16699
+ }
16700
+ else {
16701
+ lastLandmark = null;
16702
+ }
16680
16703
  }
16681
- return new BMapGL.Point(item.lng, item.lat);
16682
- });
16704
+ }
16705
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
16706
+ finally {
16707
+ try {
16708
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
16709
+ }
16710
+ finally { if (e_1) throw e_1.error; }
16711
+ }
16683
16712
  if (this.showPolyline) {
16684
16713
  this.polyline = new BMapGL.Polyline(arrPois, { strokeColor: this.polylineColor });
16685
16714
  this.parent.map.addOverlay(this.polyline);
@@ -16694,7 +16723,6 @@
16694
16723
  enableRotation: this.enableRotation,
16695
16724
  // defaultContent不为空时才会显示
16696
16725
  landmarkPois: landmarkPois,
16697
- replaceDefaultContent: true,
16698
16726
  });
16699
16727
  if (this.autoStart) {
16700
16728
  this.start();
@@ -16718,11 +16746,13 @@
16718
16746
  };
16719
16747
  BaiduLushuComponent.prototype.clear = function () {
16720
16748
  if (this.lushu) {
16749
+ this.lushu.stop();
16721
16750
  this.lushu.clear();
16722
16751
  this.lushu = null;
16723
16752
  }
16724
16753
  if (this.polyline) {
16725
16754
  this.parent.map.removeOverlay(this.polyline);
16755
+ this.polyline = null;
16726
16756
  }
16727
16757
  };
16728
16758
  BaiduLushuComponent.prototype.setSpeed = function (speed) {
@@ -16812,6 +16842,7 @@
16812
16842
  ], exports.ɵdf.prototype, "pause", null);
16813
16843
  __decorate([
16814
16844
  bbjWidgetBase.Method('设置速度'),
16845
+ __param(0, bbjWidgetBase.Param('速度')),
16815
16846
  __metadata("design:type", Function),
16816
16847
  __metadata("design:paramtypes", [Number]),
16817
16848
  __metadata("design:returntype", void 0)