|
|
@@ -66,6 +66,7 @@ class IndexMap {
|
|
|
let that = this;
|
|
|
let vectorStyle = new KMap.VectorStyle();
|
|
|
this.vectorStyle = vectorStyle;
|
|
|
+ this.onlyName = false;
|
|
|
this.labelStyleCache = {};
|
|
|
|
|
|
this.borderStyle = new Style({
|
|
|
@@ -83,7 +84,7 @@ class IndexMap {
|
|
|
minZoom: 6,
|
|
|
maxZoom: 22,
|
|
|
style: (feature) => {
|
|
|
- const labelText = (feature.get("executeDate") + ' ' + feature.get("farmName")) || feature.get("mapInfo") || "";
|
|
|
+ const labelText = this.onlyName ? feature.get("farmName") : ((feature.get("executeDate") + ' ' + feature.get("farmName")) || feature.get("mapInfo") || "");
|
|
|
if (!this.labelStyleCache[labelText]) {
|
|
|
this.labelStyleCache[labelText] = new Style({
|
|
|
image: new Icon({
|
|
|
@@ -109,9 +110,10 @@ class IndexMap {
|
|
|
this.kmap.addLayer(this.gardenPointLayer.layer);
|
|
|
}
|
|
|
|
|
|
- initData(taskList, label, pointType = "point") {
|
|
|
+ initData(taskList, label, pointType = "point", onlyNameVal = false) {
|
|
|
this.labelStyleCache = {};
|
|
|
this.gardenPointLayer.source.clear();
|
|
|
+ this.onlyName = onlyNameVal;
|
|
|
if (taskList.length > 0) {
|
|
|
for (let item of taskList) {
|
|
|
item.mapInfo = label
|