bruce-cesium 1.3.9 → 1.4.0
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 +72 -5
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +71 -4
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +68 -3
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +1 -1
- package/dist/lib/utils/entity-utils.js.map +1 -1
- 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, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, Rectangle, KmlDataSource, OrthographicFrustum, JulianDate, CallbackProperty, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, Matrix4, Cesium3DTileset, IonResource, PolygonPipeline, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, ColorMaterialProperty, Matrix3, EasingFunction, GeometryInstance } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -702,7 +702,7 @@ var EntityUtils;
|
|
|
702
702
|
}
|
|
703
703
|
else if (visual.polyline) {
|
|
704
704
|
visualHeightRef = GetValue(viewer, visual.polyline.clampToGround) ?
|
|
705
|
-
HeightReference.
|
|
705
|
+
HeightReference.CLAMP_TO_GROUND : HeightReference.NONE;
|
|
706
706
|
}
|
|
707
707
|
else if (visual.billboard) {
|
|
708
708
|
visualHeightRef = GetValue(viewer, visual.billboard.heightReference);
|
|
@@ -1440,6 +1440,7 @@ var EntityRenderEngine;
|
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
1442
|
var cEntity = null;
|
|
1443
|
+
var siblings = [];
|
|
1443
1444
|
if (type == Style.EPointType.Icon) {
|
|
1444
1445
|
// Fixing poor data.
|
|
1445
1446
|
var iconUrlRows = style.iconUrl == null ? [] : style.iconUrl;
|
|
@@ -1482,7 +1483,67 @@ var EntityRenderEngine;
|
|
|
1482
1483
|
}
|
|
1483
1484
|
}
|
|
1484
1485
|
}
|
|
1485
|
-
if (type == Style.EPointType.Cylinder)
|
|
1486
|
+
if (type == Style.EPointType.Cylinder) {
|
|
1487
|
+
var radius = EnsureNumber(Calculator.GetNumber(style.CylinderRadius, entity, params.tags));
|
|
1488
|
+
if (radius <= 0) {
|
|
1489
|
+
return null;
|
|
1490
|
+
}
|
|
1491
|
+
var bFill = style.CylinderFillColor ? Calculator.GetColor(style.CylinderFillColor, entity, params.tags) : null;
|
|
1492
|
+
var cFill = bFill ? colorToCColor(bFill) : Color.RED;
|
|
1493
|
+
var outline = Boolean(style.CylinderBorderEnabled);
|
|
1494
|
+
var cOutline = null;
|
|
1495
|
+
var outlineWidth = 1;
|
|
1496
|
+
var outlineHeight = 0;
|
|
1497
|
+
if (outline) {
|
|
1498
|
+
var bOutline = style.CylinderBorderColor ? Calculator.GetColor(style.CylinderBorderColor, entity, params.tags) : null;
|
|
1499
|
+
cOutline = bOutline ? colorToCColor(bOutline) : Color.BLACK;
|
|
1500
|
+
outlineWidth = EnsureNumber(Calculator.GetNumber(style.CylinderBorderWidth, entity, params.tags), 1);
|
|
1501
|
+
outlineHeight = EnsureNumber(Calculator.GetNumber(style.CylinderBorderExtrusion, entity, params.tags), 0);
|
|
1502
|
+
}
|
|
1503
|
+
var fillHeight = EnsureNumber(Calculator.GetNumber(style.CylinderFillExtrusion, entity, params.tags));
|
|
1504
|
+
var exHeightRef = undefined;
|
|
1505
|
+
if (fillHeight > 0) {
|
|
1506
|
+
exHeightRef = HeightReference.RELATIVE_TO_GROUND;
|
|
1507
|
+
}
|
|
1508
|
+
var pos = EntityUtils.GetPos({
|
|
1509
|
+
viewer: params.viewer,
|
|
1510
|
+
entity: entity
|
|
1511
|
+
});
|
|
1512
|
+
cEntity = new Entity({
|
|
1513
|
+
ellipse: {
|
|
1514
|
+
semiMajorAxis: radius,
|
|
1515
|
+
semiMinorAxis: radius,
|
|
1516
|
+
material: cFill,
|
|
1517
|
+
outlineWidth: null,
|
|
1518
|
+
extrudedHeight: fillHeight,
|
|
1519
|
+
heightReference: HeightReference.CLAMP_TO_GROUND,
|
|
1520
|
+
extrudedHeightReference: exHeightRef,
|
|
1521
|
+
zIndex: 1
|
|
1522
|
+
},
|
|
1523
|
+
position: pos === null || pos === void 0 ? void 0 : pos.clone(),
|
|
1524
|
+
show: false
|
|
1525
|
+
});
|
|
1526
|
+
if (outline && outlineWidth > 0) {
|
|
1527
|
+
if (!exHeightRef && outlineHeight > 0) {
|
|
1528
|
+
exHeightRef = HeightReference.RELATIVE_TO_GROUND;
|
|
1529
|
+
// We need height reference to match between rings.
|
|
1530
|
+
cEntity.ellipse.extrudedHeightReference = exHeightRef;
|
|
1531
|
+
}
|
|
1532
|
+
siblings.push(new Entity({
|
|
1533
|
+
ellipse: {
|
|
1534
|
+
semiMajorAxis: radius + outlineWidth,
|
|
1535
|
+
semiMinorAxis: radius + outlineWidth,
|
|
1536
|
+
material: cOutline,
|
|
1537
|
+
outlineWidth: undefined,
|
|
1538
|
+
extrudedHeight: outlineHeight,
|
|
1539
|
+
heightReference: HeightReference.CLAMP_TO_GROUND,
|
|
1540
|
+
extrudedHeightReference: exHeightRef,
|
|
1541
|
+
zIndex: 2
|
|
1542
|
+
},
|
|
1543
|
+
position: pos === null || pos === void 0 ? void 0 : pos.clone()
|
|
1544
|
+
}));
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1486
1547
|
if (!cEntity) {
|
|
1487
1548
|
var bColor = style.color ? Calculator.GetColor(style.color, entity, params.tags) : null;
|
|
1488
1549
|
var cColor = bColor ? colorToCColor(bColor) : Color.RED;
|
|
@@ -1509,6 +1570,12 @@ var EntityRenderEngine;
|
|
|
1509
1570
|
}
|
|
1510
1571
|
if (cEntity) {
|
|
1511
1572
|
params.viewer.entities.add(cEntity);
|
|
1573
|
+
if (siblings) {
|
|
1574
|
+
siblings.forEach(function (sibling) {
|
|
1575
|
+
params.viewer.entities.add(sibling);
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
cEntity._siblingGraphics = siblings;
|
|
1512
1579
|
}
|
|
1513
1580
|
return cEntity;
|
|
1514
1581
|
}
|
|
@@ -1932,7 +1999,7 @@ var EntityRenderEngine;
|
|
|
1932
1999
|
tags = (_e.sent()).tags;
|
|
1933
2000
|
_e.label = 4;
|
|
1934
2001
|
case 4:
|
|
1935
|
-
mStyle = (_b = (_a = style === null || style === void 0 ? void 0 : style.Settings) === null || _a === void 0 ? void 0 : _a.
|
|
2002
|
+
mStyle = (_b = (_a = style === null || style === void 0 ? void 0 : style.Settings) === null || _a === void 0 ? void 0 : _a.modelStyle) !== null && _b !== void 0 ? _b : {};
|
|
1936
2003
|
group = mStyle.lodGroup ? Calculator.GetString(mStyle.lodGroup, entity, tags) : null;
|
|
1937
2004
|
if (!group) {
|
|
1938
2005
|
group = "DEFAULT";
|
|
@@ -1986,7 +2053,7 @@ var EntityRenderEngine;
|
|
|
1986
2053
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
1987
2054
|
return [2 /*return*/, "continue"];
|
|
1988
2055
|
}
|
|
1989
|
-
mStyle = (_d = (_c = style === null || style === void 0 ? void 0 : style.Settings) === null || _c === void 0 ? void 0 : _c.
|
|
2056
|
+
mStyle = (_d = (_c = style === null || style === void 0 ? void 0 : style.Settings) === null || _c === void 0 ? void 0 : _c.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
1990
2057
|
cEntity = Render({
|
|
1991
2058
|
entity: entity,
|
|
1992
2059
|
style: mStyle,
|