bruce-models 0.5.4 → 0.5.6
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/dist/bruce-models.es5.js +22 -10
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +22 -10
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/getters/batched-data-getter.js +21 -10
- package/dist/lib/entity/getters/batched-data-getter.js.map +1 -1
- package/dist/lib/entity/getters/entity-filter-getter.js +1 -0
- package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
- package/dist/types/entity/getters/batched-data-getter.d.ts +2 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -3458,6 +3458,7 @@ var EntityFilterGetter;
|
|
|
3458
3458
|
this.batchSize = batchSize;
|
|
3459
3459
|
this.viewPort = viewPort;
|
|
3460
3460
|
this.attrFilter = attrFilter;
|
|
3461
|
+
this.updateBounds();
|
|
3461
3462
|
}
|
|
3462
3463
|
Object.defineProperty(Getter.prototype, "OnUpdate", {
|
|
3463
3464
|
get: function () {
|
|
@@ -3715,7 +3716,6 @@ var BatchedDataGetter;
|
|
|
3715
3716
|
(function (BatchedDataGetter) {
|
|
3716
3717
|
var Getter = /** @class */ (function () {
|
|
3717
3718
|
function Getter(data, viewPort, batchSize) {
|
|
3718
|
-
var _this = this;
|
|
3719
3719
|
this.viewPortRemoval = null;
|
|
3720
3720
|
this.viewRect = null;
|
|
3721
3721
|
this.viewCenter = null;
|
|
@@ -3723,10 +3723,6 @@ var BatchedDataGetter;
|
|
|
3723
3723
|
this.data = data;
|
|
3724
3724
|
this.viewPort = viewPort;
|
|
3725
3725
|
this.batchSize = batchSize;
|
|
3726
|
-
this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
|
|
3727
|
-
_this.updateBounds();
|
|
3728
|
-
_this.startGetterLoop();
|
|
3729
|
-
});
|
|
3730
3726
|
}
|
|
3731
3727
|
Object.defineProperty(Getter.prototype, "OnUpdate", {
|
|
3732
3728
|
get: function () {
|
|
@@ -3738,10 +3734,21 @@ var BatchedDataGetter;
|
|
|
3738
3734
|
enumerable: false,
|
|
3739
3735
|
configurable: true
|
|
3740
3736
|
});
|
|
3737
|
+
Getter.prototype.Start = function () {
|
|
3738
|
+
var _this = this;
|
|
3739
|
+
this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
|
|
3740
|
+
_this.updateViewport();
|
|
3741
|
+
});
|
|
3742
|
+
this.updateViewport();
|
|
3743
|
+
};
|
|
3741
3744
|
Getter.prototype.Dispose = function () {
|
|
3742
3745
|
var _a;
|
|
3743
3746
|
(_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3744
3747
|
};
|
|
3748
|
+
Getter.prototype.updateViewport = function () {
|
|
3749
|
+
this.updateBounds();
|
|
3750
|
+
this.startGetterLoop();
|
|
3751
|
+
};
|
|
3745
3752
|
Getter.prototype.updateBounds = function () {
|
|
3746
3753
|
var viewRect = this.viewPort.GetBounds();
|
|
3747
3754
|
var poi = this.viewPort.GetTarget();
|
|
@@ -3763,13 +3770,18 @@ var BatchedDataGetter;
|
|
|
3763
3770
|
return;
|
|
3764
3771
|
}
|
|
3765
3772
|
var index = 0;
|
|
3766
|
-
|
|
3773
|
+
var onTick = function () {
|
|
3767
3774
|
_this.processBatch(_this.data.slice(index, index + _this.batchSize));
|
|
3768
3775
|
index += _this.batchSize;
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3776
|
+
return index >= _this.data.length;
|
|
3777
|
+
};
|
|
3778
|
+
if (!onTick()) {
|
|
3779
|
+
this.getterInterval = setInterval(function () {
|
|
3780
|
+
if (onTick()) {
|
|
3781
|
+
clearInterval(_this.getterInterval);
|
|
3782
|
+
}
|
|
3783
|
+
}, GETTER_DELAY);
|
|
3784
|
+
}
|
|
3773
3785
|
};
|
|
3774
3786
|
Getter.prototype.processBatch = function (batch) {
|
|
3775
3787
|
var _a;
|