|
@@ -161,19 +161,19 @@ export default {
|
|
|
flytoSchoolDataToMap(data) {
|
|
|
let that = this;
|
|
|
// 首先判断是否存在
|
|
|
- if (this.mapWallEntity[data.title]) {
|
|
|
- // 先删除其他的
|
|
|
- this.mapWallEntity[data.title].forEach((item) => {
|
|
|
- item.show = false;
|
|
|
- });
|
|
|
- if (viewer.dataSources) {
|
|
|
- viewer.dataSources.forEach((item) => {
|
|
|
- viewer.dataSources.remove(item);
|
|
|
- });
|
|
|
- }
|
|
|
- this.geojsonDataSource[item.id] = null;
|
|
|
- delete this.geojsonDataSource[item.id];
|
|
|
- }
|
|
|
+ // if (this.mapWallEntity[data.title]) {
|
|
|
+ // // 先删除其他的
|
|
|
+ // this.mapWallEntity[data.title].forEach((item) => {
|
|
|
+ // item.show = false;
|
|
|
+ // });
|
|
|
+ // if (viewer.dataSources) {
|
|
|
+ // viewer.dataSources.forEach((item) => {
|
|
|
+ // viewer.dataSources.remove(item);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // this.geojsonDataSource[item.id] = null;
|
|
|
+ // delete this.geojsonDataSource[item.id];
|
|
|
+ // }
|
|
|
// 不存在的话要新建并定位
|
|
|
// 添加围墙
|
|
|
this.mapWallEntity[data.title] = [];
|
|
@@ -251,26 +251,23 @@ export default {
|
|
|
},
|
|
|
data.title
|
|
|
);
|
|
|
+ // 定位
|
|
|
+ viewer.camera.setView({
|
|
|
+ destination: SkyScenery.Cartesian3.fromDegrees(
|
|
|
+ data.c_latlon.split(",")[0],
|
|
|
+ data.c_latlon.split(",")[1],
|
|
|
+ 3000
|
|
|
+ ), // 设置位置
|
|
|
+ orientation: {
|
|
|
+ heading: SkyScenery.Math.toRadians(356.03124515798294), // 方向
|
|
|
+ pitch: SkyScenery.Math.toRadians(-90), // 倾斜角度
|
|
|
+ roll: SkyScenery.Math.toRadians(0.0047792745453184024),
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
// 加载geojson数据
|
|
|
addGeoJson(pointData, options, id) {
|
|
|
- // options = {
|
|
|
- // point: {
|
|
|
- // imgUrl: ""
|
|
|
- // },
|
|
|
- // polyline: {
|
|
|
- // color: "#ffffff",
|
|
|
- // width: 3,
|
|
|
- // alpha: 0.7
|
|
|
- // },
|
|
|
- // polygon: {
|
|
|
- // outerColor: "#ffffff",
|
|
|
- // outerWidth: 3,
|
|
|
- // innerColor: "#ffffff",
|
|
|
- // alpha: 0.7
|
|
|
- // }
|
|
|
- // };
|
|
|
SkyScenery.GeoJsonDataSource.load(pointData).then(function (dataSource) {
|
|
|
viewer.dataSources.add(dataSource);
|
|
|
var entities = dataSource.entities.values;
|