地图区域背景效果

main
许宏杰 3 weeks ago
parent c7a1c740cd
commit b8ca40b0dc

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

@ -43,7 +43,6 @@
<dict-tag :options="gd_status" :value="scope.row.status" /> <dict-tag :options="gd_status" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="400" class-name="small-padding fixed-width "> <el-table-column label="操作" align="center" width="400" class-name="small-padding fixed-width ">
<template #default="scope"> <template #default="scope">
<div class="table-operation-row"> <div class="table-operation-row">

@ -14,6 +14,7 @@ import MarsMap from "@/components/mars-work/mars-map.vue";
import mapOptions from "../mapOptions"; import mapOptions from "../mapOptions";
import { onUnmounted } from "vue"; import { onUnmounted } from "vue";
import wallImg from "@/assets/images/visualization/fence-top.png"; import wallImg from "@/assets/images/visualization/fence-top.png";
import areaBg from "@/assets/images/visualization/area-bg.png";
// //
const configUrl = "lib/config/config.json"; const configUrl = "lib/config/config.json";
@ -28,19 +29,26 @@ const initAreaCover = async () => {
const arr = mars3d.Util.geoJsonToGraphics(jsonData); // geojson const arr = mars3d.Util.geoJsonToGraphics(jsonData); // geojson
arr.forEach((item) => { arr.forEach((item) => {
inintEntity(item, "#8EF4FF"); inintEntity(item, true);
}); });
}; };
const inintEntity = (data, lineColor, height, outline = true,) => { const inintEntity = (data, fill=false, height, ) => {
const polylineGraphic = new mars3d.graphic.PolygonEntity({ const polylineGraphic = new mars3d.graphic.PolygonEntity({
positions: data.positions, positions: data.positions,
style: { style: {
fill:false, fill:fill,
outline: outline, // materialType: "Image",
outlineWidth: 3, materialOptions: {
outlineColor: lineColor, image: areaBg,
height:height opacity: 1,
repeat_x: 1,
repeat_y: 1,
materialType: "Image",
},
workMaterialType: "Image",
stRotationDegree: 6,
height: height,
}, },
}); });
mapLayer.arealayer.addGraphic(polylineGraphic); mapLayer.arealayer.addGraphic(polylineGraphic);
@ -75,7 +83,7 @@ const initStyleFeatures = async () => {
url: "/lib/geoJson/park-rectangle.json", url: "/lib/geoJson/park-rectangle.json",
}); });
const arr = mars3d.Util.geoJsonToGraphics(jsonData); // geojson const arr = mars3d.Util.geoJsonToGraphics(jsonData); // geojson
inintEntity(arr[0],"#395EB0",10,false); inintEntity(arr[0], false);
}; };
/** /**

Loading…
Cancel
Save