明树Git Lab

Commit af84499e authored by yangyajing's avatar yangyajing

调整地图交互样式

parent cd03062e
Pipeline #104348 passed with stage
in 12 seconds
......@@ -26,10 +26,8 @@ watch(
// 根据页面内容,调整地图显示位置
const center = ["lixiang", "tuichu"].includes(props.tabKey) ? [100.808299, 35.791787] : [127.808299, 35.791787];
map && map.setCenter(center);
let zoom = map.getZoom();
if (zoom < 7) {
handleAddMarket();
}
map.setZoom(4);
handleAddMarket();
}
);
......@@ -245,16 +243,6 @@ const handleAddMarket = () => {
const markerData = positionsList[i];
// 创建悬浮窗口内容
// const infoContent = `
// <div class="marker-info-window">
// <div class="marker-info-title">${markerData.province}</div>
// <div class="marker-info-content">
// <span class="marker-info-label">路线数量:</span>
// <span class="marker-info-value">${markerData.number}</span>
// <span class="marker-info-unit"></span>
// </div>
// </div>
// `;
let infoContent = `
<div class="infoWindow-title">${markerData.province}</div>
<div class="infoWindow-content">
......@@ -270,8 +258,8 @@ const handleAddMarket = () => {
const infoWindow = new AMap.InfoWindow({
isCustom: true,
content: infoContent,
// offset: new AMap.Pixel(3, -3),
closeWhenClickMap: true,
offset: new AMap.Pixel(5, 0),
closeWhenClickMap: true
});
const marker = new AMap.Marker({
......@@ -283,16 +271,17 @@ const handleAddMarket = () => {
'<img src="//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png" style="width: 40px;height: 40px;">' +
`<div class="anchorPoint">${markerData.number}</div>` +
"</div>",
zIndex: 100
});
// 鼠标悬浮事件
marker.on("mouseover", function (e) {
infoWindow.open(map, [`${e.lnglat.getLng()}`, `${e.lnglat.getLat()}`]);
infoWindow.open(map, markerData.position);
});
// 鼠标移出事件
marker.on("mouseout", function () {
infoWindow.close();
// infoWindow.close();
});
// 点击事件:聚焦到对应省份并显示省份地图
......@@ -587,4 +576,10 @@ onActivated(() => {
:deep(.amap-copyright) {
opacity: 0;
}
</style>
\ No newline at end of file
</style>
<style lang="less">
.amap-info{
z-index: 2;
pointer-events: none;
}
</style>
\ No newline at end of file
......@@ -220,6 +220,7 @@
<el-table-column prop="xmzt" label="项目状态" :align="'center'" width="100" />
<el-table-column prop="tcsj" label="通车时间" width="110" :align="'center'"/>
<el-table-column prop="hbfs" label="回报方式" :align="'center'" width="150" />
<el-table-column prop="irr" label="IRR" :align="'center'" width="100" />
</el-table>
</div>
<!-- <div class="page-wrap">
......@@ -1191,6 +1192,7 @@ const initProgressPie = () => {
// 1. 外层圆环边框(浅色蓝环)
{
type: "pie",
animationDuration: 2000,
radius: ["85%", "70%"], // 外层边框的粗细
startAngle: 0,
itemStyle: {
......
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