bruce-models 0.0.2 → 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.
- package/dist/bruce-models.es5.js +105 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +103 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -0
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/common/cartes.js +20 -0
- package/dist/lib/common/cartes.js.map +1 -1
- package/dist/lib/common/carto.js +10 -0
- package/dist/lib/common/carto.js.map +1 -1
- package/dist/lib/entity/getters/entity-filter-getter.js +1 -1
- package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/entity/getters/entity-loaded-getter.js +77 -0
- package/dist/lib/entity/getters/entity-loaded-getter.js.map +1 -0
- package/dist/types/bruce-models.d.ts +1 -0
- package/dist/types/common/cartes.d.ts +2 -0
- package/dist/types/common/carto.d.ts +1 -0
- package/dist/types/entity/getters/entity-loaded-getter.d.ts +21 -0
- package/dist/types/entity/getters/view-monitor.d.ts +3 -3
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -1291,6 +1291,26 @@ var Cartes;
|
|
|
1291
1291
|
return true;
|
|
1292
1292
|
}
|
|
1293
1293
|
Cartes.ValidateCartes3 = ValidateCartes3;
|
|
1294
|
+
function IsEqualCartes2(a, b) {
|
|
1295
|
+
if (a.x != b.x) {
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
else if (a.y != b.y) {
|
|
1299
|
+
return false;
|
|
1300
|
+
}
|
|
1301
|
+
return true;
|
|
1302
|
+
}
|
|
1303
|
+
Cartes.IsEqualCartes2 = IsEqualCartes2;
|
|
1304
|
+
function IsEqualCartes3(a, b) {
|
|
1305
|
+
if (!IsEqualCartes2(a, b)) {
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
else if (a.z != b.z) {
|
|
1309
|
+
return false;
|
|
1310
|
+
}
|
|
1311
|
+
return true;
|
|
1312
|
+
}
|
|
1313
|
+
Cartes.IsEqualCartes3 = IsEqualCartes3;
|
|
1294
1314
|
})(Cartes || (Cartes = {}));
|
|
1295
1315
|
|
|
1296
1316
|
var Carto;
|
|
@@ -1308,6 +1328,16 @@ var Carto;
|
|
|
1308
1328
|
return true;
|
|
1309
1329
|
}
|
|
1310
1330
|
Carto.ValidateCarto = ValidateCarto;
|
|
1331
|
+
function IsEqual(a, b) {
|
|
1332
|
+
if (a.longitude != b.longitude) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
else if (a.latitude != b.latitude) {
|
|
1336
|
+
return false;
|
|
1337
|
+
}
|
|
1338
|
+
return true;
|
|
1339
|
+
}
|
|
1340
|
+
Carto.IsEqual = IsEqual;
|
|
1311
1341
|
})(Carto || (Carto = {}));
|
|
1312
1342
|
|
|
1313
1343
|
var DelayQueue = /** @class */ (function () {
|
|
@@ -2868,7 +2898,7 @@ var EntityFilterGetter;
|
|
|
2868
2898
|
this.updateState();
|
|
2869
2899
|
};
|
|
2870
2900
|
Getter.prototype.updateBounds = function () {
|
|
2871
|
-
var viewRect = this.viewPort.
|
|
2901
|
+
var viewRect = this.viewPort.GetBounds();
|
|
2872
2902
|
var poi = this.viewPort.GetTarget();
|
|
2873
2903
|
if (viewRect && poi) {
|
|
2874
2904
|
if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES) {
|
|
@@ -3069,6 +3099,79 @@ var EntityFilterGetter;
|
|
|
3069
3099
|
EntityFilterGetter.Getter = Getter;
|
|
3070
3100
|
})(EntityFilterGetter || (EntityFilterGetter = {}));
|
|
3071
3101
|
|
|
3102
|
+
var MAX_AREA_IN_DEGREES$1 = 90;
|
|
3103
|
+
var GETTER_DELAY = 50;
|
|
3104
|
+
var EntityLoadedGetter;
|
|
3105
|
+
(function (EntityLoadedGetter) {
|
|
3106
|
+
var Getter = /** @class */ (function () {
|
|
3107
|
+
function Getter(entities, viewPort, batchSize) {
|
|
3108
|
+
var _this = this;
|
|
3109
|
+
this.viewPortRemoval = null;
|
|
3110
|
+
this.viewRect = null;
|
|
3111
|
+
this.viewCenter = null;
|
|
3112
|
+
this.onUpdate = null;
|
|
3113
|
+
this.entities = entities;
|
|
3114
|
+
this.viewPort = viewPort;
|
|
3115
|
+
this.batchSize = batchSize;
|
|
3116
|
+
this.viewPortRemoval = this.viewPort.Updated().Subscribe(function () {
|
|
3117
|
+
_this.updateBounds();
|
|
3118
|
+
_this.startGetterLoop();
|
|
3119
|
+
});
|
|
3120
|
+
}
|
|
3121
|
+
Object.defineProperty(Getter.prototype, "OnUpdate", {
|
|
3122
|
+
get: function () {
|
|
3123
|
+
if (!this.onUpdate) {
|
|
3124
|
+
this.onUpdate = new BruceEvent();
|
|
3125
|
+
}
|
|
3126
|
+
return this.onUpdate;
|
|
3127
|
+
},
|
|
3128
|
+
enumerable: false,
|
|
3129
|
+
configurable: true
|
|
3130
|
+
});
|
|
3131
|
+
Getter.prototype.Dispose = function () {
|
|
3132
|
+
var _a;
|
|
3133
|
+
(_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3134
|
+
};
|
|
3135
|
+
Getter.prototype.updateBounds = function () {
|
|
3136
|
+
var viewRect = this.viewPort.GetBounds();
|
|
3137
|
+
var poi = this.viewPort.GetTarget();
|
|
3138
|
+
if (viewRect && poi) {
|
|
3139
|
+
if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3142
|
+
if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES$1) {
|
|
3143
|
+
return;
|
|
3144
|
+
}
|
|
3145
|
+
this.viewRect = viewRect;
|
|
3146
|
+
this.viewCenter = poi;
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
Getter.prototype.startGetterLoop = function () {
|
|
3150
|
+
var _this = this;
|
|
3151
|
+
clearInterval(this.getterInterval);
|
|
3152
|
+
if (!this.viewRect || !this.viewCenter) {
|
|
3153
|
+
return;
|
|
3154
|
+
}
|
|
3155
|
+
var index = 0;
|
|
3156
|
+
this.getterInterval = setInterval(function () {
|
|
3157
|
+
_this.processBatch(_this.entities.slice(index, index + _this.batchSize));
|
|
3158
|
+
index += _this.batchSize;
|
|
3159
|
+
if (index >= _this.entities.length) {
|
|
3160
|
+
clearInterval(_this.getterInterval);
|
|
3161
|
+
}
|
|
3162
|
+
}, GETTER_DELAY);
|
|
3163
|
+
};
|
|
3164
|
+
Getter.prototype.processBatch = function (batch) {
|
|
3165
|
+
var _a;
|
|
3166
|
+
if (batch.length > 0) {
|
|
3167
|
+
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
|
|
3168
|
+
}
|
|
3169
|
+
};
|
|
3170
|
+
return Getter;
|
|
3171
|
+
}());
|
|
3172
|
+
EntityLoadedGetter.Getter = Getter;
|
|
3173
|
+
})(EntityLoadedGetter || (EntityLoadedGetter = {}));
|
|
3174
|
+
|
|
3072
3175
|
var ClientFile;
|
|
3073
3176
|
(function (ClientFile) {
|
|
3074
3177
|
function GetCacheKey(fileId) {
|
|
@@ -4681,5 +4784,5 @@ var MathUtils;
|
|
|
4681
4784
|
MathUtils.RandInt = RandInt;
|
|
4682
4785
|
})(MathUtils || (MathUtils = {}));
|
|
4683
4786
|
|
|
4684
|
-
export { AnnDocument, AbstractApi, Api, BruceApi, CamApi, IdmApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, ClientFile, ProgramKey, MenuItemZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, EncryptUtils, MathUtils, ObjectUtils, PathUtils };
|
|
4787
|
+
export { AnnDocument, AbstractApi, Api, BruceApi, CamApi, IdmApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, EntityLoadedGetter, ClientFile, ProgramKey, MenuItemZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, EncryptUtils, MathUtils, ObjectUtils, PathUtils };
|
|
4685
4788
|
//# sourceMappingURL=bruce-models.es5.js.map
|