|
@@ -216,6 +216,7 @@ export default {
|
|
|
// 加载GeoJSON数据
|
|
|
addPolygon(geom, id, colors, fillreset) {
|
|
|
let geojson = parse(geom);
|
|
|
+ console.log("---", geojson.type);
|
|
|
let _this = this;
|
|
|
// viewer.entities.removeAll();
|
|
|
let scolor = colors
|
|
@@ -239,11 +240,23 @@ export default {
|
|
|
viewer.zoomTo(dataSource);
|
|
|
dataSourceList[id] = dataSource;
|
|
|
if (id == "all") _this.isshowAll = true;
|
|
|
- // 可以获取实体并进行操作
|
|
|
- // dataSource.entities.values.forEach((entity) => {
|
|
|
- // // 你可以在这里设置实体的属性,例如位置、颜色等
|
|
|
- // // console.log(entity);
|
|
|
- // });
|
|
|
+ if (!geojson.type.includes("Polygon")) {
|
|
|
+ dataSource.entities.values.forEach((entity, ei) => {
|
|
|
+ if (entity.billboard) {
|
|
|
+ entity.billboard = new Cesium.BillboardGraphics({
|
|
|
+ image: "@/.././static/images/flypng/hos_point.png",
|
|
|
+ height: 40,
|
|
|
+ width: 40,
|
|
|
+ scale: 1.0,
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, -16),
|
|
|
+ });
|
|
|
+ // entity.point = {
|
|
|
+ // pixelsize: 20,
|
|
|
+ // color: Cesium.Color.fromCssColorString(colors),
|
|
|
+ // };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|