bruce-models 0.0.3 → 0.0.4

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.
@@ -3083,72 +3083,75 @@
3083
3083
 
3084
3084
  var MAX_AREA_IN_DEGREES$1 = 90;
3085
3085
  var GETTER_DELAY = 50;
3086
- var EntityLoadedGetter = /** @class */ (function () {
3087
- function EntityLoadedGetter(entities, viewPort, batchSize) {
3088
- var _this = this;
3089
- this.viewPortRemoval = null;
3090
- this.viewRect = null;
3091
- this.viewCenter = null;
3092
- this.onUpdate = null;
3093
- this.entities = entities;
3094
- this.viewPort = viewPort;
3095
- this.batchSize = batchSize;
3096
- this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3097
- _this.updateBounds();
3098
- _this.startGetterLoop();
3086
+ (function (EntityLoadedGetter) {
3087
+ var Getter = /** @class */ (function () {
3088
+ function Getter(entities, viewPort, batchSize) {
3089
+ var _this = this;
3090
+ this.viewPortRemoval = null;
3091
+ this.viewRect = null;
3092
+ this.viewCenter = null;
3093
+ this.onUpdate = null;
3094
+ this.entities = entities;
3095
+ this.viewPort = viewPort;
3096
+ this.batchSize = batchSize;
3097
+ this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
3098
+ _this.updateBounds();
3099
+ _this.startGetterLoop();
3100
+ });
3101
+ }
3102
+ Object.defineProperty(Getter.prototype, "OnUpdate", {
3103
+ get: function () {
3104
+ if (!this.onUpdate) {
3105
+ this.onUpdate = new BruceEvent();
3106
+ }
3107
+ return this.onUpdate;
3108
+ },
3109
+ enumerable: false,
3110
+ configurable: true
3099
3111
  });
3100
- }
3101
- Object.defineProperty(EntityLoadedGetter.prototype, "OnUpdate", {
3102
- get: function () {
3103
- if (!this.onUpdate) {
3104
- this.onUpdate = new BruceEvent();
3105
- }
3106
- return this.onUpdate;
3107
- },
3108
- enumerable: false,
3109
- configurable: true
3110
- });
3111
- EntityLoadedGetter.prototype.Dispose = function () {
3112
- var _a;
3113
- (_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
3114
- };
3115
- EntityLoadedGetter.prototype.updateBounds = function () {
3116
- var viewRect = this.viewPort.GetBounds();
3117
- var poi = this.viewPort.GetTarget();
3118
- if (viewRect && poi) {
3119
- if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
3120
- return;
3112
+ Getter.prototype.Dispose = function () {
3113
+ var _a;
3114
+ (_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
3115
+ };
3116
+ Getter.prototype.updateBounds = function () {
3117
+ var viewRect = this.viewPort.GetBounds();
3118
+ var poi = this.viewPort.GetTarget();
3119
+ if (viewRect && poi) {
3120
+ if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
3121
+ return;
3122
+ }
3123
+ if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES$1) {
3124
+ return;
3125
+ }
3126
+ this.viewRect = viewRect;
3127
+ this.viewCenter = poi;
3121
3128
  }
3122
- if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES$1) {
3129
+ };
3130
+ Getter.prototype.startGetterLoop = function () {
3131
+ var _this = this;
3132
+ clearInterval(this.getterInterval);
3133
+ if (!this.viewRect || !this.viewCenter) {
3123
3134
  return;
3124
3135
  }
3125
- this.viewRect = viewRect;
3126
- this.viewCenter = poi;
3127
- }
3128
- };
3129
- EntityLoadedGetter.prototype.startGetterLoop = function () {
3130
- var _this = this;
3131
- clearInterval(this.getterInterval);
3132
- if (!this.viewRect || !this.viewCenter) {
3133
- return;
3134
- }
3135
- var index = 0;
3136
- this.getterInterval = setInterval(function () {
3137
- _this.processBatch(_this.entities.slice(index, index + _this.batchSize));
3138
- index += _this.batchSize;
3139
- if (index >= _this.entities.length) {
3140
- clearInterval(_this.getterInterval);
3136
+ var index = 0;
3137
+ this.getterInterval = setInterval(function () {
3138
+ _this.processBatch(_this.entities.slice(index, index + _this.batchSize));
3139
+ index += _this.batchSize;
3140
+ if (index >= _this.entities.length) {
3141
+ clearInterval(_this.getterInterval);
3142
+ }
3143
+ }, GETTER_DELAY);
3144
+ };
3145
+ Getter.prototype.processBatch = function (batch) {
3146
+ var _a;
3147
+ if (batch.length > 0) {
3148
+ (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
3141
3149
  }
3142
- }, GETTER_DELAY);
3143
- };
3144
- EntityLoadedGetter.prototype.processBatch = function (batch) {
3145
- var _a;
3146
- if (batch.length > 0) {
3147
- (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
3148
- }
3149
- };
3150
- return EntityLoadedGetter;
3151
- }());
3150
+ };
3151
+ return Getter;
3152
+ }());
3153
+ EntityLoadedGetter.Getter = Getter;
3154
+ })(exports.EntityLoadedGetter || (exports.EntityLoadedGetter = {}));
3152
3155
 
3153
3156
  (function (ClientFile) {
3154
3157
  function GetCacheKey(fileId) {
@@ -4751,7 +4754,6 @@
4751
4754
  exports.BruceEvent = BruceEvent;
4752
4755
  exports.CacheControl = CacheControl;
4753
4756
  exports.DelayQueue = DelayQueue;
4754
- exports.EntityLoadedGetter = EntityLoadedGetter;
4755
4757
 
4756
4758
  Object.defineProperty(exports, '__esModule', { value: true });
4757
4759