bbj-screen-widget 2.4.74 → 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);
@@ -16717,11 +16746,13 @@
16717
16746
  };
16718
16747
  BaiduLushuComponent.prototype.clear = function () {
16719
16748
  if (this.lushu) {
16749
+ this.lushu.stop();
16720
16750
  this.lushu.clear();
16721
16751
  this.lushu = null;
16722
16752
  }
16723
16753
  if (this.polyline) {
16724
16754
  this.parent.map.removeOverlay(this.polyline);
16755
+ this.polyline = null;
16725
16756
  }
16726
16757
  };
16727
16758
  BaiduLushuComponent.prototype.setSpeed = function (speed) {
@@ -16811,6 +16842,7 @@
16811
16842
  ], exports.ɵdf.prototype, "pause", null);
16812
16843
  __decorate([
16813
16844
  bbjWidgetBase.Method('设置速度'),
16845
+ __param(0, bbjWidgetBase.Param('速度')),
16814
16846
  __metadata("design:type", Function),
16815
16847
  __metadata("design:paramtypes", [Number]),
16816
16848
  __metadata("design:returntype", void 0)