bruce-cesium 1.3.2 → 1.3.3
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-cesium.es5.js +54 -14
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +53 -13
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +3 -1
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +21 -0
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +30 -12
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +3 -0
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +4 -2
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Cartesian3, Entity, Primitive, Cesium3DTileFeature, Color, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, HeadingPitchRange, Cesium3DTileColorBlendMode, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance, CallbackProperty } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -1218,6 +1218,8 @@ var EntityRenderEngine;
|
|
|
1218
1218
|
else if (displayType == "polygon") {
|
|
1219
1219
|
displayType = ZoomControl.EDisplayType.Geometry;
|
|
1220
1220
|
}
|
|
1221
|
+
displayType = ZoomControl.EDisplayType.Geometry;
|
|
1222
|
+
// @ts-ignore
|
|
1221
1223
|
if (displayType != ZoomControl.EDisplayType.Hidden) {
|
|
1222
1224
|
newRenderId = getRenderGroupId(zoomItem);
|
|
1223
1225
|
existingRego = params.visualRegister.GetRego({
|
|
@@ -1229,6 +1231,7 @@ var EntityRenderEngine;
|
|
|
1229
1231
|
cEntities[id] = existingRego.visual;
|
|
1230
1232
|
}
|
|
1231
1233
|
else {
|
|
1234
|
+
// @ts-ignore
|
|
1232
1235
|
if (displayType == ZoomControl.EDisplayType.Model3D) {
|
|
1233
1236
|
models.push(entity);
|
|
1234
1237
|
}
|
|
@@ -1732,7 +1735,6 @@ var EntityRenderEngine;
|
|
|
1732
1735
|
show: false
|
|
1733
1736
|
});
|
|
1734
1737
|
cEntity._siblingGraphics = [];
|
|
1735
|
-
console.count("POLYGON WIDTH = " + width + ", COLOR = " + (cLineColor === null || cLineColor === void 0 ? void 0 : cLineColor.toCssColorString()));
|
|
1736
1738
|
if (width > 0 && cLineColor) {
|
|
1737
1739
|
var cEntityBorder = new Entity({
|
|
1738
1740
|
polyline: new PolylineGraphics({
|
|
@@ -2040,6 +2042,8 @@ var EntitiesRenderManager;
|
|
|
2040
2042
|
this.entityCheckRemoval = null;
|
|
2041
2043
|
this.isRunningCheck = false;
|
|
2042
2044
|
this.viewMonitorRemoval = null;
|
|
2045
|
+
this.renderQueue = [];
|
|
2046
|
+
this.renderQueueInterval = null;
|
|
2043
2047
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register, sharedGetters = params.sharedGetters;
|
|
2044
2048
|
this.viewer = viewer;
|
|
2045
2049
|
this.sharedGetters = sharedGetters;
|
|
@@ -2072,6 +2076,7 @@ var EntitiesRenderManager;
|
|
|
2072
2076
|
if (!tagsToRender) {
|
|
2073
2077
|
tagsToRender = [];
|
|
2074
2078
|
}
|
|
2079
|
+
tagsToRender = [].concat(tagsToRender);
|
|
2075
2080
|
shouldRender = !isTagItem || tagsToRender.length > 0;
|
|
2076
2081
|
(_a = this.getter) === null || _a === void 0 ? void 0 : _a.ExcludeMenuItem(this.item.id);
|
|
2077
2082
|
this.getter = null;
|
|
@@ -2081,6 +2086,9 @@ var EntitiesRenderManager;
|
|
|
2081
2086
|
this.viewMonitorRemoval = null;
|
|
2082
2087
|
(_d = this.entityCheckQueue) === null || _d === void 0 ? void 0 : _d.Dispose();
|
|
2083
2088
|
this.entityCheckQueue = null;
|
|
2089
|
+
clearInterval(this.renderQueueInterval);
|
|
2090
|
+
this.renderQueueInterval = null;
|
|
2091
|
+
this.renderQueue = [];
|
|
2084
2092
|
this.visualsManager.RemoveRegos({
|
|
2085
2093
|
menuItemId: this.item.id
|
|
2086
2094
|
});
|
|
@@ -2093,15 +2101,17 @@ var EntitiesRenderManager;
|
|
|
2093
2101
|
attrFilter: (_e = this.item.BruceEntity.Filter) !== null && _e !== void 0 ? _e : {},
|
|
2094
2102
|
batchSize: 500,
|
|
2095
2103
|
typeId: this.item.BruceEntity["EntityType.ID"],
|
|
2096
|
-
monitor: this.monitor
|
|
2104
|
+
monitor: this.monitor,
|
|
2105
|
+
viewer: this.viewer,
|
|
2106
|
+
debugShowBounds: false
|
|
2097
2107
|
});
|
|
2098
2108
|
minMax = RenderManager.GetZoomMinMax({
|
|
2099
2109
|
zoomControl: this.item.CameraZoomSettings
|
|
2100
2110
|
});
|
|
2101
|
-
this.getter.IncludeMenuItem(this.item.id,
|
|
2111
|
+
this.getter.IncludeMenuItem(this.item.id, [], minMax[0], minMax[1]);
|
|
2102
2112
|
this.getterSub = this.getter.OnUpdate.Subscribe(function (entities) {
|
|
2103
2113
|
if (isTagItem) {
|
|
2104
|
-
_this.
|
|
2114
|
+
_this.distributeForRender(entities.filter(function (entity) {
|
|
2105
2115
|
var entityTags = entity.Bruce["Layer.ID"];
|
|
2106
2116
|
if (!entityTags) {
|
|
2107
2117
|
entityTags = [];
|
|
@@ -2112,7 +2122,7 @@ var EntitiesRenderManager;
|
|
|
2112
2122
|
}));
|
|
2113
2123
|
}
|
|
2114
2124
|
else {
|
|
2115
|
-
_this.
|
|
2125
|
+
_this.distributeForRender(entities);
|
|
2116
2126
|
}
|
|
2117
2127
|
});
|
|
2118
2128
|
this.viewMonitorRemoval = this.monitor.Updated().Subscribe(function () {
|
|
@@ -2141,6 +2151,8 @@ var EntitiesRenderManager;
|
|
|
2141
2151
|
});
|
|
2142
2152
|
(_b = this.entityCheckRemoval) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
2143
2153
|
(_c = this.viewMonitorRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
2154
|
+
clearInterval(this.renderQueueInterval);
|
|
2155
|
+
this.renderQueue = [];
|
|
2144
2156
|
};
|
|
2145
2157
|
Manager.prototype.ReRender = function (entityIds) {
|
|
2146
2158
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2204,7 +2216,7 @@ var EntitiesRenderManager;
|
|
|
2204
2216
|
if (this.disposed) {
|
|
2205
2217
|
return [2 /*return*/];
|
|
2206
2218
|
}
|
|
2207
|
-
this.
|
|
2219
|
+
this.distributeForRender(entities);
|
|
2208
2220
|
return [2 /*return*/];
|
|
2209
2221
|
}
|
|
2210
2222
|
});
|
|
@@ -2228,14 +2240,22 @@ var EntitiesRenderManager;
|
|
|
2228
2240
|
});
|
|
2229
2241
|
});
|
|
2230
2242
|
};
|
|
2231
|
-
Manager.prototype.
|
|
2232
|
-
var
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2243
|
+
Manager.prototype.distributeForRender = function (entities) {
|
|
2244
|
+
var _this = this;
|
|
2245
|
+
var BATCH_SIZE = 300;
|
|
2246
|
+
this.renderQueue = this.renderQueue.concat(entities);
|
|
2247
|
+
if (!this.renderQueueInterval && this.renderQueue.length) {
|
|
2248
|
+
this.renderQueueInterval = setInterval(function () {
|
|
2249
|
+
var batch = _this.renderQueue.splice(0, BATCH_SIZE);
|
|
2250
|
+
_this.renderEntities(batch);
|
|
2251
|
+
if (_this.renderQueue.length <= 0) {
|
|
2252
|
+
clearInterval(_this.renderQueueInterval);
|
|
2253
|
+
_this.renderQueueInterval = null;
|
|
2254
|
+
}
|
|
2255
|
+
}, 50);
|
|
2236
2256
|
}
|
|
2237
2257
|
};
|
|
2238
|
-
Manager.prototype.
|
|
2258
|
+
Manager.prototype.renderEntities = function (entities) {
|
|
2239
2259
|
var _a, _b, _c;
|
|
2240
2260
|
return __awaiter(this, void 0, void 0, function () {
|
|
2241
2261
|
var typeId_1, cEntities, i, entity, id, cEntity, visual, tagIds, e_2;
|
|
@@ -2280,7 +2300,7 @@ var EntitiesRenderManager;
|
|
|
2280
2300
|
priority: 0,
|
|
2281
2301
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
2282
2302
|
accountId: this.apiGetter.accountId,
|
|
2283
|
-
tagIds: tagIds ? tagIds : []
|
|
2303
|
+
tagIds: tagIds ? [].concat(tagIds) : []
|
|
2284
2304
|
}
|
|
2285
2305
|
});
|
|
2286
2306
|
}
|
|
@@ -5072,6 +5092,26 @@ var SharedGetters;
|
|
|
5072
5092
|
if (!getter) {
|
|
5073
5093
|
getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter, true);
|
|
5074
5094
|
this.data[cacheKey] = getter;
|
|
5095
|
+
if (params.viewer && params.debugShowBounds) {
|
|
5096
|
+
getter.OnScanUpdate.Subscribe(function (cells) {
|
|
5097
|
+
cells.forEach(function (cell) {
|
|
5098
|
+
var bounds = cell.GetBounds();
|
|
5099
|
+
var id = bounds.east + "_" + bounds.north + "_" + bounds.south + "_" + bounds.west;
|
|
5100
|
+
if (params.viewer.entities.getById(id)) {
|
|
5101
|
+
return;
|
|
5102
|
+
}
|
|
5103
|
+
var rect = new Rectangle(Math$1.toRadians(bounds.west), Math$1.toRadians(bounds.south), Math$1.toRadians(bounds.east), Math$1.toRadians(bounds.north));
|
|
5104
|
+
params.viewer.entities.add(new Entity({
|
|
5105
|
+
id: id,
|
|
5106
|
+
rectangle: {
|
|
5107
|
+
coordinates: rect,
|
|
5108
|
+
fill: true,
|
|
5109
|
+
material: Color.fromRandom().withAlpha(0.3)
|
|
5110
|
+
}
|
|
5111
|
+
}));
|
|
5112
|
+
});
|
|
5113
|
+
});
|
|
5114
|
+
}
|
|
5075
5115
|
}
|
|
5076
5116
|
return getter;
|
|
5077
5117
|
};
|