xy-cesium3 0.0.42 → 0.0.44

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/img/local.png ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-cesium3",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "雄越cesium3",
5
5
  "main": "xy-cesium3.umd.js",
6
6
  "scripts": {
package/xy-cesium3.es.js CHANGED
@@ -2583,6 +2583,7 @@ function removeEntityLayer(viewer2, entity) {
2583
2583
  const defaultOptions$8 = {
2584
2584
  id: "point",
2585
2585
  data: [],
2586
+ show: true,
2586
2587
  image: {
2587
2588
  image: "/img/marker.png",
2588
2589
  width: 30,
@@ -2615,13 +2616,14 @@ const addEntityPoint = (viewer2, option) => {
2615
2616
  const labelStyle = opt.text || {};
2616
2617
  const data = opt.data || [];
2617
2618
  const props = opt.props || {};
2619
+ const show2 = opt.show === void 0 ? true : show2;
2618
2620
  const dataSource = new Cesium.CustomDataSource(opt.id);
2619
2621
  viewer2.dataSources.add(dataSource);
2620
2622
  data.forEach((item) => {
2621
2623
  if (item[props.lgtd] && item[props.lttd]) {
2622
2624
  var entity = new Cesium.Entity({
2623
2625
  name: item.id,
2624
- show: true,
2626
+ show: show2,
2625
2627
  position: Cesium.Cartesian3.fromDegrees(
2626
2628
  Number(item[props.lgtd]),
2627
2629
  Number(item[props.lttd]),
@@ -3503,13 +3505,21 @@ const defaultOptions$7 = {
3503
3505
  lgtd: "lgtd",
3504
3506
  lttd: "lttd",
3505
3507
  image: "image",
3506
- scale: "scale"
3508
+ scale: "scale",
3509
+ name: "name"
3510
+ },
3511
+ style: {},
3512
+ text: {
3513
+ show: true,
3514
+ style: {}
3507
3515
  }
3508
3516
  };
3509
3517
  const addEntityGif = (viewer2, option) => {
3510
3518
  let opt = Object.assign({}, defaultOptions$7, option);
3511
3519
  let props = opt.props;
3512
3520
  let data = opt.data || [];
3521
+ const billboardStyle = opt.style || {};
3522
+ const labelStyle = opt.text || {};
3513
3523
  let dataSource = new Cesium.CustomDataSource(opt.id);
3514
3524
  viewer2.dataSources.add(dataSource);
3515
3525
  data.forEach((item) => {
@@ -3527,10 +3537,28 @@ const addEntityGif = (viewer2, option) => {
3527
3537
  var entity = new Cesium.Entity({
3528
3538
  name: item.id,
3529
3539
  position: Cesium.Cartesian3.fromDegrees(item[props.lgtd], item[props.lttd]),
3530
- billboard: {
3540
+ billboard: Object.assign({
3531
3541
  image: new Cesium.CallbackProperty(() => loader.get_canvas().toDataURL("image/png"), false),
3532
- scale: item[props.scale] || opt.scale
3533
- }
3542
+ scale: item[props.scale] || opt.scale,
3543
+ heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
3544
+ horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
3545
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
3546
+ zIndex: 0
3547
+ }, billboardStyle),
3548
+ label: labelStyle.show ? Object.assign(
3549
+ {
3550
+ text: item[props.name],
3551
+ font: "12px Helvetica",
3552
+ fillColor: Cesium.Color.WHITE,
3553
+ outlineColor: Cesium.Color.fromCssColorString("#000000").withAlpha(1),
3554
+ outlineWidth: 1,
3555
+ style: Cesium.LabelStyle.FILL_AND_OUTLINE,
3556
+ heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
3557
+ pixelOffset: new Cesium.Cartesian2(0, 5)
3558
+ },
3559
+ labelStyle.style
3560
+ ) : null,
3561
+ description: JSON.stringify(item)
3534
3562
  });
3535
3563
  dataSource.entities.add(entity);
3536
3564
  });
@@ -6145,6 +6173,7 @@ class FlowGradientMaterial extends Cesium.Material {
6145
6173
  const defaultOptions$5 = {
6146
6174
  id: "",
6147
6175
  data: [],
6176
+ show: true,
6148
6177
  line: {},
6149
6178
  text: {
6150
6179
  show: true
@@ -6161,6 +6190,7 @@ const addEntityLine = (viewer2, option) => {
6161
6190
  let props = opt.props || {};
6162
6191
  let data = opt.data || [];
6163
6192
  data = data.filter((item) => item[props.lglt]);
6193
+ const show2 = opt.show === void 0 ? true : show2;
6164
6194
  let dataSource = new Cesium.CustomDataSource(opt.id);
6165
6195
  viewer2.dataSources.add(dataSource);
6166
6196
  data.forEach((item) => {
@@ -6168,7 +6198,7 @@ const addEntityLine = (viewer2, option) => {
6168
6198
  let polylinePosition = Cesium.Cartesian3.fromDegreesArray(lglt);
6169
6199
  var entity = new Cesium.Entity({
6170
6200
  name: "line_" + item.id,
6171
- show: true,
6201
+ show: show2,
6172
6202
  polyline: Object.assign({
6173
6203
  positions: polylinePosition,
6174
6204
  width: lineStyle.width || 5,
@@ -6183,7 +6213,7 @@ const addEntityLine = (viewer2, option) => {
6183
6213
  const centerPoint = computePolyLineCenter(polylinePosition);
6184
6214
  let label = {
6185
6215
  name: "line_text_" + item.id,
6186
- show: true,
6216
+ show: show2,
6187
6217
  position: centerPoint,
6188
6218
  label: Object.assign({
6189
6219
  text: item[props.name],
@@ -6533,6 +6563,7 @@ const addPrimitiveRadar = (viewer2, option) => {
6533
6563
  const defaultOptions$2 = {
6534
6564
  id: "",
6535
6565
  data: [],
6566
+ show: true,
6536
6567
  polygon: {
6537
6568
  extrudedHeight: 0,
6538
6569
  outline: false,
@@ -6552,6 +6583,7 @@ const addEntityPolygon = (viewer2, option) => {
6552
6583
  let labelStyle = opt.text || {};
6553
6584
  let props = opt.props || {};
6554
6585
  let data = opt.data || [];
6586
+ const show2 = opt.show === void 0 ? true : show2;
6555
6587
  data = data.filter((item) => item[props.lglt]);
6556
6588
  let dataSource = new Cesium.CustomDataSource(opt.id);
6557
6589
  viewer2.dataSources.add(dataSource);
@@ -6564,6 +6596,7 @@ const addEntityPolygon = (viewer2, option) => {
6564
6596
  }
6565
6597
  if (!pStyle.extrudedHeight && pStyle.outline) {
6566
6598
  polyline = {
6599
+ show: show2,
6567
6600
  positions: Cesium.Cartesian3.fromDegreesArray(lglt),
6568
6601
  width: pStyle.outlineWidth,
6569
6602
  material: pStyle.outlineColor,
@@ -6575,7 +6608,7 @@ const addEntityPolygon = (viewer2, option) => {
6575
6608
  let polygonPositions = Cesium.Cartesian3.fromDegreesArray(lglt);
6576
6609
  var entity = new Cesium.Entity({
6577
6610
  name: "polygon_" + item.id,
6578
- show: true,
6611
+ show: show2,
6579
6612
  polygon: Object.assign({
6580
6613
  hierarchy: polygonPositions,
6581
6614
  material: Cesium.Color.RED,
@@ -6593,7 +6626,7 @@ const addEntityPolygon = (viewer2, option) => {
6593
6626
  const centerLat = Cesium.Math.toDegrees(centerCartographic.latitude);
6594
6627
  let label = {
6595
6628
  name: "polygon_text_" + item.id,
6596
- show: true,
6629
+ show: show2,
6597
6630
  position: Cesium.Cartesian3.fromDegrees(centerLon, centerLat, 0),
6598
6631
  label: Object.assign({
6599
6632
  text: item[props.name],