bruce-cesium 0.1.6 → 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.
@@ -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, Cartesian3, Entity, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, HeadingPitchRange, OrthographicFrustum, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, createWorldTerrain, CesiumTerrainProvider, EllipsoidTerrainProvider, Matrix4, Cesium3DTileset, EllipsoidGeodesic } from 'cesium';
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 bColor = style.color ? Calculator.GetValue(style.color, entity, params.tags) : null;
833
- var cColor = bColor ? colorToCColor(bColor) : Color.RED;
834
- var size = style.size ? Calculator.GetValue(style.size, entity, params.tags) : null;
835
- if (size == null) {
836
- size = 30;
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 (size <= 0) {
839
- return null;
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;
@@ -3178,7 +3214,7 @@ function createImageryBId(source) {
3178
3214
  if (!source) {
3179
3215
  return "";
3180
3216
  }
3181
- if (isDefaultTerrain(source.Name)) {
3217
+ if (isDefaultImagery(source.Name)) {
3182
3218
  return source.Name;
3183
3219
  }
3184
3220
  if (source.SourceUrl) {
@@ -3491,8 +3527,8 @@ var TileRenderEngine;
3491
3527
  _loop_1(i);
3492
3528
  }
3493
3529
  }
3494
- for (i = 0; i < tiles.length; i++) {
3495
- tile = tiles[i];
3530
+ for (i = 0; i < data.length; i++) {
3531
+ tile = data[i];
3496
3532
  layer = RenderLegacy({
3497
3533
  apiGetter: params.apiGetter,
3498
3534
  viewer: params.viewer,