bruce-models 0.0.3 → 0.0.5
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 +74 -70
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +72 -70
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/entity/getters/batched-data-getter.js +77 -0
- package/dist/lib/entity/getters/batched-data-getter.js.map +1 -0
- package/dist/lib/project/menu-item.js +8 -8
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/getters/batched-data-getter.d.ts +20 -0
- package/dist/types/project/menu-item.d.ts +4 -4
- package/package.json +1 -1
- package/dist/lib/entity/getters/entity-loaded-getter.js +0 -74
- package/dist/lib/entity/getters/entity-loaded-getter.js.map +0 -1
- package/dist/types/entity/getters/entity-loaded-getter.d.ts +0 -19
package/dist/bruce-models.umd.js
CHANGED
|
@@ -3083,72 +3083,75 @@
|
|
|
3083
3083
|
|
|
3084
3084
|
var MAX_AREA_IN_DEGREES$1 = 90;
|
|
3085
3085
|
var GETTER_DELAY = 50;
|
|
3086
|
-
|
|
3087
|
-
function
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3086
|
+
(function (BatchedDataGetter) {
|
|
3087
|
+
var Getter = /** @class */ (function () {
|
|
3088
|
+
function Getter(data, viewPort, batchSize) {
|
|
3089
|
+
var _this = this;
|
|
3090
|
+
this.viewPortRemoval = null;
|
|
3091
|
+
this.viewRect = null;
|
|
3092
|
+
this.viewCenter = null;
|
|
3093
|
+
this.onUpdate = null;
|
|
3094
|
+
this.data = data;
|
|
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
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3126
|
-
this.
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
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.data.slice(index, index + _this.batchSize));
|
|
3139
|
+
index += _this.batchSize;
|
|
3140
|
+
if (index >= _this.data.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
|
-
}
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
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
|
+
BatchedDataGetter.Getter = Getter;
|
|
3154
|
+
})(exports.BatchedDataGetter || (exports.BatchedDataGetter = {}));
|
|
3152
3155
|
|
|
3153
3156
|
(function (ClientFile) {
|
|
3154
3157
|
function GetCacheKey(fileId) {
|
|
@@ -3711,20 +3714,20 @@
|
|
|
3711
3714
|
var EType;
|
|
3712
3715
|
(function (EType) {
|
|
3713
3716
|
EType["None"] = "NONE";
|
|
3714
|
-
EType["
|
|
3715
|
-
EType["
|
|
3717
|
+
EType["Entities"] = "BruceEntity";
|
|
3718
|
+
EType["Entity"] = "SingleEntity";
|
|
3716
3719
|
EType["Osm"] = "OSMBuildingsTileset";
|
|
3717
3720
|
EType["CadTileset"] = "ModelTileset";
|
|
3718
3721
|
EType["ArbTileset"] = "Cesium3DTileset";
|
|
3719
3722
|
EType["Kml"] = "StaticKML";
|
|
3720
|
-
EType["
|
|
3721
|
-
EType["
|
|
3723
|
+
EType["EntityTileset"] = "EntitiesTileset";
|
|
3724
|
+
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
3722
3725
|
EType["PointCloud"] = "PointCloudTileset";
|
|
3723
3726
|
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
3724
3727
|
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
3725
3728
|
return {
|
|
3726
3729
|
id: exports.ObjectUtils.UId(),
|
|
3727
|
-
Type: EType.
|
|
3730
|
+
Type: EType.Entity,
|
|
3728
3731
|
Caption: "Generated Entity Menu Item",
|
|
3729
3732
|
BruceEntity: {
|
|
3730
3733
|
"EntityType.ID": typeId,
|
|
@@ -3744,7 +3747,7 @@
|
|
|
3744
3747
|
function CreateFromTypeId(typeId, styleId) {
|
|
3745
3748
|
return {
|
|
3746
3749
|
id: exports.ObjectUtils.UId(),
|
|
3747
|
-
Type: EType.
|
|
3750
|
+
Type: EType.Entities,
|
|
3748
3751
|
Caption: "Generated Entity Type Menu Item",
|
|
3749
3752
|
BruceEntity: {
|
|
3750
3753
|
"EntityType.ID": typeId
|
|
@@ -3775,7 +3778,7 @@
|
|
|
3775
3778
|
else if (type == exports.Tileset.EType.EntitiesSet) {
|
|
3776
3779
|
return {
|
|
3777
3780
|
id: exports.ObjectUtils.UId(),
|
|
3778
|
-
Type: EType.
|
|
3781
|
+
Type: EType.EntityTileset,
|
|
3779
3782
|
Caption: "Generated Entities Menu Item",
|
|
3780
3783
|
FlyTo: false,
|
|
3781
3784
|
tileset: {
|
|
@@ -3797,7 +3800,7 @@
|
|
|
3797
3800
|
else if (type == exports.Tileset.EType.EntitiesMap) {
|
|
3798
3801
|
return {
|
|
3799
3802
|
id: exports.ObjectUtils.UId(),
|
|
3800
|
-
Type: EType.
|
|
3803
|
+
Type: EType.EntityRaster,
|
|
3801
3804
|
Caption: "Generated Entities Menu Item",
|
|
3802
3805
|
tileset: {
|
|
3803
3806
|
TilesetID: tilesetId
|
|
@@ -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
|
|