Commit c0996d3f by 李萌萌

文本信息放到point图层中

parent efa2a985
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-12-24 09:50:39 * @Date: 2021-12-24 09:50:39
* @LastEditTime: 2022-01-13 16:22:13 * @LastEditTime: 2022-01-14 13:56:36
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \founder_vue\src\views\SystemManage\QueryPermission.vue * @FilePath: \founder_vue\src\views\SystemManage\QueryPermission.vue
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
<el-checkbox class="ckbAuto" fill="#055FE7" v-model="isAutoDistribute" <el-checkbox class="ckbAuto" fill="#055FE7" v-model="isAutoDistribute"
>省厅总数自动分配</el-checkbox >省厅总数自动分配</el-checkbox
> >
<button @click="autoDistribute" class="f-primary-button">一键分配</button> <button @click="autoDistribute" class="f-primary-button">
一键分配
</button>
</div> </div>
<div class="stTongji"> <div class="stTongji">
<div>省/区厅发查询总数:</div> <div>省/区厅发查询总数:</div>
...@@ -226,7 +228,8 @@ export default { ...@@ -226,7 +228,8 @@ export default {
features: featuresP, features: featuresP,
}), }),
style: function(feature) { style: function(feature) {
const style = new Style({ const style = [
new Style({
text: new Text({ text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC", font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({ fill: new Fill({
...@@ -243,21 +246,8 @@ export default { ...@@ -243,21 +246,8 @@ export default {
anchorYUnits: "pixels", anchorYUnits: "pixels",
src: marker, src: marker,
}), }),
});
return style;
},
});
const layer = new VectorLayer({
source: vectorSource,
style: function(feature) {
const style = new Style({
fill: new Fill({
color: self.getFeatureColor(feature.get("percentage")),
}),
stroke: new Stroke({
color: "#fff",
width: 2,
}), }),
new Style({
text: new Text({ text: new Text({
font: "14px HarmonyOS_Sans_SC", font: "14px HarmonyOS_Sans_SC",
fill: new Fill({ fill: new Fill({
...@@ -274,31 +264,29 @@ export default { ...@@ -274,31 +264,29 @@ export default {
padding: [3, 1, 0, 3], padding: [3, 1, 0, 3],
text: feature.get("MC"), text: feature.get("MC"),
}), }),
}); }),
];
return style; return style;
}, },
}); });
selectedRegionLayer = new VectorLayer({ const layer = new VectorLayer({
source: new VectorSource(), source: vectorSource,
style: function(feature) { style: function(feature) {
const pstyle = new Style({ const style = new Style({
text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({ fill: new Fill({
color: "#333333", color: self.getFeatureColor(feature.get("percentage")),
}),
offsetY: -35,
textAlign: "center",
text: feature.get("totalCount") || "",
}), }),
image: new Icon({ stroke: new Stroke({
scale: 0.5, color: "#fff",
anchor: [0.5, 120], width: 2,
anchorXUnits: "fraction",
anchorYUnits: "pixels",
src: markers,
}), }),
}); });
return style;
},
});
selectedRegionLayer = new VectorLayer({
source: new VectorSource(),
style: function(feature) {
const rstyle = new Style({ const rstyle = new Style({
fill: new Fill({ fill: new Fill({
color: "rgba(154, 218, 252, 0)", color: "rgba(154, 218, 252, 0)",
...@@ -307,27 +295,15 @@ export default { ...@@ -307,27 +295,15 @@ export default {
color: "#055FE7", color: "#055FE7",
width: 3, width: 3,
}), }),
text: new Text({
font: "14px HarmonyOS_Sans_SC",
fill: new Fill({
color: "rgba(51, 51, 51, 1)",
}),
backgroundFill: new Fill({
color: "rgba(255, 255, 255, 1)",
}),
textAlign: "center",
padding: [3, 1, 0, 3],
text: feature.get("MC"),
}),
}); });
const isPoint = feature.getGeometry() instanceof Point; return rstyle;
return isPoint ? pstyle : rstyle;
}, },
}); });
selectedPointLayer = new VectorLayer({ selectedPointLayer = new VectorLayer({
source: new VectorSource(), source: new VectorSource(),
style: function(feature) { style: function(feature) {
const pstyle = new Style({ const pstyle = [
new Style({
text: new Text({ text: new Text({
font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC", font: "14px HarmonyOS_Sans_SC-Bold, HarmonyOS_Sans_SC",
fill: new Fill({ fill: new Fill({
...@@ -344,15 +320,8 @@ export default { ...@@ -344,15 +320,8 @@ export default {
anchorYUnits: "pixels", anchorYUnits: "pixels",
src: markers, src: markers,
}), }),
});
const rstyle = new Style({
fill: new Fill({
color: "rgba(154, 218, 252, 0)",
}),
stroke: new Stroke({
color: "#055FE7",
width: 3,
}), }),
new Style({
text: new Text({ text: new Text({
font: "14px HarmonyOS_Sans_SC", font: "14px HarmonyOS_Sans_SC",
fill: new Fill({ fill: new Fill({
...@@ -365,9 +334,9 @@ export default { ...@@ -365,9 +334,9 @@ export default {
padding: [3, 1, 0, 3], padding: [3, 1, 0, 3],
text: feature.get("MC"), text: feature.get("MC"),
}), }),
}); }),
const isPoint = feature.getGeometry() instanceof Point; ];
return isPoint ? pstyle : rstyle; return pstyle;
}, },
}); });
......
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