Parcourir la source

更新 航次详情船舶icon;fitView自适应显示所有marker

wzh il y a 4 ans
Parent
commit
07bd3d6da3
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/views/voyage/voyageDetail.vue

+ 3 - 2
src/views/voyage/voyageDetail.vue

@@ -773,20 +773,21 @@ export default {
           setShipMarker(i);
         }
       }
+      map.value.setFitView();
     }
 
     function setShipMarker(item) {
       let { longitude, latitude, viewUrl, id } = item;
       let content = `<div style='width:160px'>
         <img id='img${id}' style='width:160px;height:160px;object-fit:contain;' src='${viewUrl}'/>
-        <div style='width:10px;height:10px;border-radius:50%;background:#d71345;margin:6px auto'></div>
+        <img src='https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png' style='display:block;width:20px;height:20px;margin:6px auto'/
       </div>`;
 
       map.value.setCenter([longitude, latitude]);
       var marker = new AMap.Marker({
         content,
         position: new AMap.LngLat(longitude, latitude),
-        offset: new AMap.Pixel(-55, -165),
+        offset: new AMap.Pixel(-75, -195),
       });
       map.value.add(marker);
       document.getElementById(`img${id}`).addEventListener("click", () => {