|
@@ -773,20 +773,21 @@ export default {
|
|
|
setShipMarker(i);
|
|
setShipMarker(i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ map.value.setFitView();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function setShipMarker(item) {
|
|
function setShipMarker(item) {
|
|
|
let { longitude, latitude, viewUrl, id } = item;
|
|
let { longitude, latitude, viewUrl, id } = item;
|
|
|
let content = `<div style='width:160px'>
|
|
let content = `<div style='width:160px'>
|
|
|
<img id='img${id}' style='width:160px;height:160px;object-fit:contain;' src='${viewUrl}'/>
|
|
<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>`;
|
|
</div>`;
|
|
|
|
|
|
|
|
map.value.setCenter([longitude, latitude]);
|
|
map.value.setCenter([longitude, latitude]);
|
|
|
var marker = new AMap.Marker({
|
|
var marker = new AMap.Marker({
|
|
|
content,
|
|
content,
|
|
|
position: new AMap.LngLat(longitude, latitude),
|
|
position: new AMap.LngLat(longitude, latitude),
|
|
|
- offset: new AMap.Pixel(-55, -165),
|
|
|
|
|
|
|
+ offset: new AMap.Pixel(-75, -195),
|
|
|
});
|
|
});
|
|
|
map.value.add(marker);
|
|
map.value.add(marker);
|
|
|
document.getElementById(`img${id}`).addEventListener("click", () => {
|
|
document.getElementById(`img${id}`).addEventListener("click", () => {
|