From 25bb0f9e47785ab9b51ffec7d72b67a6b5af5ac0 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 23 Aug 2022 10:33:14 +0800
Subject: [PATCH] 地图模式显示图片
---
src/components/map/plotMap.vue | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/src/components/map/plotMap.vue b/src/components/map/plotMap.vue
index 8f78a7e..94060dc 100644
--- a/src/components/map/plotMap.vue
+++ b/src/components/map/plotMap.vue
@@ -253,25 +253,22 @@
addPlotPolygon (positions, item) {
const that = this
-
const center = this.getCenter(positions)
-
- // const divIcon = new global.DC.DivIcon(
- // new global.DC.Position(center[0], center[1], 0),
- // `
- // <div class="farm-map-icon">
- // <img src="/img/icon/3858.png" alt="">
- // // <div>${item.farmName}</div>
- // </div>
- // `
- // )
- // divIcon.attrParams = item
- // farmLogoLayer.addOverlay(divIcon)
-
- // divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
- // that.$parent.showDetailPopup(e.overlay.attrParams)
- // })
-
+ if(item.strainUrl !=""){
+ const divIcon = new global.DC.DivIcon(
+ new global.DC.Position(center[0], center[1], 0),
+ `
+ <div class="farm-map-icon">
+ <img src="${item.strainUrl}" alt=""width="50%" height="50%" text-align="center">
+ </div>
+ `
+ )
+ divIcon.attrParams = item
+ farmLogoLayer.addOverlay(divIcon)
+ divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
+ that.$parent.showDetailPopup(e.overlay.attrParams)
+ })
+ }
const polygon = new global.DC.Polygon(positions)
polygon.attrParams = item
polygon.setStyle({
--
Gitblit v1.9.3