bruce-cesium 0.1.7 → 0.1.8
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 +55 -19
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +54 -18
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +56 -18
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/types/rendering/entity-render-engine.d.ts +1 -0
- package/package.json +1 -1
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, DelayQueue, Entity as Entity$1, EntityFilterGetter, BatchedDataGetter, ObjectUtils, Tileset, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTileSource, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1, Viewer, ArcGisMapServerImageryProvider, ScreenSpaceEventType, Color, HeightReference,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Viewer, ArcGisMapServerImageryProvider, ScreenSpaceEventType, Entity, Primitive, Cesium3DTileFeature, Color, Cartesian3, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, HeadingPitchRange, OrthographicFrustum, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, createWorldTerrain, CesiumTerrainProvider, EllipsoidTerrainProvider, Matrix4, Cesium3DTileset, EllipsoidGeodesic } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -829,25 +829,60 @@ var EntityRenderEngine;
|
|
|
829
829
|
function Render(params) {
|
|
830
830
|
var entity = params.entity;
|
|
831
831
|
var style = params.style;
|
|
832
|
-
var
|
|
833
|
-
var
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
832
|
+
var type = style.Type;
|
|
833
|
+
var cEntity = null;
|
|
834
|
+
if (type == Style.EPointType.Icon) {
|
|
835
|
+
var icon = Calculator.GetValue(style.iconUrl, entity, params.tags);
|
|
836
|
+
var iconUrl = null;
|
|
837
|
+
if (typeof icon == "string") {
|
|
838
|
+
iconUrl = icon;
|
|
839
|
+
}
|
|
840
|
+
if (!iconUrl && style.iconId) {
|
|
841
|
+
iconUrl = ClientFile.GetUrl(params.api, style.iconId);
|
|
842
|
+
}
|
|
843
|
+
if (iconUrl) {
|
|
844
|
+
var iconScale = +Calculator.GetValue(style.iconScale, entity, params.tags);
|
|
845
|
+
if (!iconScale && iconScale != 0) {
|
|
846
|
+
iconScale = 1;
|
|
847
|
+
}
|
|
848
|
+
if (iconScale > 0) {
|
|
849
|
+
cEntity = new Entity({
|
|
850
|
+
billboard: {
|
|
851
|
+
horizontalOrigin: HorizontalOrigin.CENTER,
|
|
852
|
+
verticalOrigin: VerticalOrigin.BOTTOM,
|
|
853
|
+
image: iconUrl,
|
|
854
|
+
heightReference: getHeightRef(style)
|
|
855
|
+
},
|
|
856
|
+
position: EntityUtils.GetPos(params.viewer, entity),
|
|
857
|
+
show: false
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
}
|
|
837
861
|
}
|
|
838
|
-
if (
|
|
839
|
-
|
|
862
|
+
if (type == Style.EPointType.Cylinder) ;
|
|
863
|
+
if (!cEntity) {
|
|
864
|
+
var bColor = style.color ? Calculator.GetValue(style.color, entity, params.tags) : null;
|
|
865
|
+
var cColor = bColor ? colorToCColor(bColor) : Color.RED;
|
|
866
|
+
var size = style.size ? Calculator.GetValue(style.size, entity, params.tags) : null;
|
|
867
|
+
if (size == null) {
|
|
868
|
+
size = 30;
|
|
869
|
+
}
|
|
870
|
+
if (size <= 0) {
|
|
871
|
+
return null;
|
|
872
|
+
}
|
|
873
|
+
cEntity = new Entity({
|
|
874
|
+
point: {
|
|
875
|
+
pixelSize: size,
|
|
876
|
+
color: cColor,
|
|
877
|
+
heightReference: getHeightRef(style)
|
|
878
|
+
},
|
|
879
|
+
position: EntityUtils.GetPos(params.viewer, entity),
|
|
880
|
+
show: false
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
if (cEntity) {
|
|
884
|
+
params.viewer.entities.add(cEntity);
|
|
840
885
|
}
|
|
841
|
-
var cEntity = new Entity({
|
|
842
|
-
point: {
|
|
843
|
-
pixelSize: size,
|
|
844
|
-
color: cColor,
|
|
845
|
-
heightReference: getHeightRef(style)
|
|
846
|
-
},
|
|
847
|
-
position: EntityUtils.GetPos(params.viewer, entity),
|
|
848
|
-
show: false
|
|
849
|
-
});
|
|
850
|
-
params.viewer.entities.add(cEntity);
|
|
851
886
|
return cEntity;
|
|
852
887
|
}
|
|
853
888
|
Point.Render = Render;
|
|
@@ -882,7 +917,8 @@ var EntityRenderEngine;
|
|
|
882
917
|
entity: entity,
|
|
883
918
|
style: pStyle,
|
|
884
919
|
tags: tags,
|
|
885
|
-
viewer: params.viewer
|
|
920
|
+
viewer: params.viewer,
|
|
921
|
+
api: api
|
|
886
922
|
});
|
|
887
923
|
cEntity._renderGroup = getRenderGroupId(zoomItem);
|
|
888
924
|
cEntities[entity.Bruce.ID] = cEntity;
|