|
@@ -13,6 +13,7 @@
|
|
import { SGraphView, SGraphScene } from "@persagy-web/graph";
|
|
import { SGraphView, SGraphScene } from "@persagy-web/graph";
|
|
import { PTopoParser } from "./PTopoParser";
|
|
import { PTopoParser } from "./PTopoParser";
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
|
+import { data } from "./data/data1.js"; //模拟接口返回参数
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -29,8 +30,6 @@ export default {
|
|
this.view ? (this.view.scene = this.scene) : null;
|
|
this.view ? (this.view.scene = this.scene) : null;
|
|
// 获取压缩包数据并解压
|
|
// 获取压缩包数据并解压
|
|
this.getMapBlob();
|
|
this.getMapBlob();
|
|
-
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
|
|
|
|
// 请求获取地图的压缩包
|
|
// 请求获取地图的压缩包
|
|
@@ -63,8 +62,8 @@ export default {
|
|
const parse = new PTopoParser();
|
|
const parse = new PTopoParser();
|
|
|
|
|
|
// 获取数据解析数据再将转化得实例添加到场景中
|
|
// 获取数据解析数据再将转化得实例添加到场景中
|
|
-
|
|
|
|
- parse.parseData(res.data.content.elements);
|
|
|
|
|
|
+ // 测试数据
|
|
|
|
+ parse.parseData(data.content.elements);
|
|
parse.markers.forEach((item) => {
|
|
parse.markers.forEach((item) => {
|
|
this.scene.addItem(item);
|
|
this.scene.addItem(item);
|
|
});
|
|
});
|