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.es5.js
CHANGED
|
@@ -3101,72 +3101,76 @@ var EntityFilterGetter;
|
|
|
3101
3101
|
|
|
3102
3102
|
var MAX_AREA_IN_DEGREES$1 = 90;
|
|
3103
3103
|
var GETTER_DELAY = 50;
|
|
3104
|
-
var
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3104
|
+
var BatchedDataGetter;
|
|
3105
|
+
(function (BatchedDataGetter) {
|
|
3106
|
+
var Getter = /** @class */ (function () {
|
|
3107
|
+
function Getter(data, viewPort, batchSize) {
|
|
3108
|
+
var _this = this;
|
|
3109
|
+
this.viewPortRemoval = null;
|
|
3110
|
+
this.viewRect = null;
|
|
3111
|
+
this.viewCenter = null;
|
|
3112
|
+
this.onUpdate = null;
|
|
3113
|
+
this.data = data;
|
|
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
|
|
3117
3130
|
});
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
var viewRect = this.viewPort.GetBounds();
|
|
3135
|
-
var poi = this.viewPort.GetTarget();
|
|
3136
|
-
if (viewRect && poi) {
|
|
3137
|
-
if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES$1) {
|
|
3138
|
-
return;
|
|
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;
|
|
3139
3147
|
}
|
|
3140
|
-
|
|
3148
|
+
};
|
|
3149
|
+
Getter.prototype.startGetterLoop = function () {
|
|
3150
|
+
var _this = this;
|
|
3151
|
+
clearInterval(this.getterInterval);
|
|
3152
|
+
if (!this.viewRect || !this.viewCenter) {
|
|
3141
3153
|
return;
|
|
3142
3154
|
}
|
|
3143
|
-
|
|
3144
|
-
this.
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
index += _this.batchSize;
|
|
3157
|
-
if (index >= _this.entities.length) {
|
|
3158
|
-
clearInterval(_this.getterInterval);
|
|
3155
|
+
var index = 0;
|
|
3156
|
+
this.getterInterval = setInterval(function () {
|
|
3157
|
+
_this.processBatch(_this.data.slice(index, index + _this.batchSize));
|
|
3158
|
+
index += _this.batchSize;
|
|
3159
|
+
if (index >= _this.data.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);
|
|
3159
3168
|
}
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
|
|
3166
|
-
}
|
|
3167
|
-
};
|
|
3168
|
-
return EntityLoadedGetter;
|
|
3169
|
-
}());
|
|
3169
|
+
};
|
|
3170
|
+
return Getter;
|
|
3171
|
+
}());
|
|
3172
|
+
BatchedDataGetter.Getter = Getter;
|
|
3173
|
+
})(BatchedDataGetter || (BatchedDataGetter = {}));
|
|
3170
3174
|
|
|
3171
3175
|
var ClientFile;
|
|
3172
3176
|
(function (ClientFile) {
|
|
@@ -3734,20 +3738,20 @@ var MenuItem;
|
|
|
3734
3738
|
var EType;
|
|
3735
3739
|
(function (EType) {
|
|
3736
3740
|
EType["None"] = "NONE";
|
|
3737
|
-
EType["
|
|
3738
|
-
EType["
|
|
3741
|
+
EType["Entities"] = "BruceEntity";
|
|
3742
|
+
EType["Entity"] = "SingleEntity";
|
|
3739
3743
|
EType["Osm"] = "OSMBuildingsTileset";
|
|
3740
3744
|
EType["CadTileset"] = "ModelTileset";
|
|
3741
3745
|
EType["ArbTileset"] = "Cesium3DTileset";
|
|
3742
3746
|
EType["Kml"] = "StaticKML";
|
|
3743
|
-
EType["
|
|
3744
|
-
EType["
|
|
3747
|
+
EType["EntityTileset"] = "EntitiesTileset";
|
|
3748
|
+
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
3745
3749
|
EType["PointCloud"] = "PointCloudTileset";
|
|
3746
3750
|
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
3747
3751
|
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
3748
3752
|
return {
|
|
3749
3753
|
id: ObjectUtils.UId(),
|
|
3750
|
-
Type: EType.
|
|
3754
|
+
Type: EType.Entity,
|
|
3751
3755
|
Caption: "Generated Entity Menu Item",
|
|
3752
3756
|
BruceEntity: {
|
|
3753
3757
|
"EntityType.ID": typeId,
|
|
@@ -3767,7 +3771,7 @@ var MenuItem;
|
|
|
3767
3771
|
function CreateFromTypeId(typeId, styleId) {
|
|
3768
3772
|
return {
|
|
3769
3773
|
id: ObjectUtils.UId(),
|
|
3770
|
-
Type: EType.
|
|
3774
|
+
Type: EType.Entities,
|
|
3771
3775
|
Caption: "Generated Entity Type Menu Item",
|
|
3772
3776
|
BruceEntity: {
|
|
3773
3777
|
"EntityType.ID": typeId
|
|
@@ -3798,7 +3802,7 @@ var MenuItem;
|
|
|
3798
3802
|
else if (type == Tileset.EType.EntitiesSet) {
|
|
3799
3803
|
return {
|
|
3800
3804
|
id: ObjectUtils.UId(),
|
|
3801
|
-
Type: EType.
|
|
3805
|
+
Type: EType.EntityTileset,
|
|
3802
3806
|
Caption: "Generated Entities Menu Item",
|
|
3803
3807
|
FlyTo: false,
|
|
3804
3808
|
tileset: {
|
|
@@ -3820,7 +3824,7 @@ var MenuItem;
|
|
|
3820
3824
|
else if (type == Tileset.EType.EntitiesMap) {
|
|
3821
3825
|
return {
|
|
3822
3826
|
id: ObjectUtils.UId(),
|
|
3823
|
-
Type: EType.
|
|
3827
|
+
Type: EType.EntityRaster,
|
|
3824
3828
|
Caption: "Generated Entities Menu Item",
|
|
3825
3829
|
tileset: {
|
|
3826
3830
|
TilesetID: tilesetId
|
|
@@ -4780,5 +4784,5 @@ var MathUtils;
|
|
|
4780
4784
|
MathUtils.RandInt = RandInt;
|
|
4781
4785
|
})(MathUtils || (MathUtils = {}));
|
|
4782
4786
|
|
|
4783
|
-
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,
|
|
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, BatchedDataGetter, ClientFile, ProgramKey, MenuItemZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, EncryptUtils, MathUtils, ObjectUtils, PathUtils };
|
|
4784
4788
|
//# sourceMappingURL=bruce-models.es5.js.map
|