Commit 7b256872 authored by caicaicai's avatar caicaicai

修改

parent ad06f246
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
zuobianData:[], zuobianData:[],
toJavaCoordinates:[], toJavaCoordinates:[],
weilanName:[], weilanName:[],
areaColorData:[],
} }
}, },
...@@ -89,6 +90,7 @@ export default { ...@@ -89,6 +90,7 @@ export default {
let data1 = []; let data1 = [];
for(let key in res){ for(let key in res){
that.weilanName.push(key); that.weilanName.push(key);
that.areaColorData.push(res[key][0].color);
let arrays = []; let arrays = [];
res[key].forEach(function(item){ res[key].forEach(function(item){
var arr = []; var arr = [];
...@@ -140,18 +142,18 @@ export default { ...@@ -140,18 +142,18 @@ export default {
var graphicLayer = new mars3d.layer.GraphicLayer(); var graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer); map.addLayer(graphicLayer);
initLayerManager(graphicLayer,that.weilanName[index]); initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index]); that.addGraphic_01(graphicLayer,item,that.weilanName[index],that.areaColorData[index]);
}) })
// 抛出事件 // 抛出事件
this.$emit('onload', map) this.$emit('onload', map)
}, },
//围栏回显 //围栏回显
addGraphic_01(graphicLayer,positions,weilanName){ addGraphic_01(graphicLayer,positions,weilanName,color){
let graphic = new mars3d.graphic.PolygonEntity({ let graphic = new mars3d.graphic.PolygonEntity({
positions: positions, positions: positions,
style: { style: {
color: "red", color: color,
opacity: 0.5, opacity: 0.5,
outline: true, outline: true,
outlineWidth: 3, outlineWidth: 3,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment