|
@@ -45,6 +45,7 @@ interface Props {
|
|
pointType: PointType[];
|
|
pointType: PointType[];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const containerScale = inject('containerScale');
|
|
const props = withDefaults(defineProps<Props>(), {});
|
|
const props = withDefaults(defineProps<Props>(), {});
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
|
|
const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
|
|
@@ -174,7 +175,6 @@ const handlePointDetails = (data) => {
|
|
}
|
|
}
|
|
showInfo(content, [data.longitude, data.latitude]);
|
|
showInfo(content, [data.longitude, data.latitude]);
|
|
}
|
|
}
|
|
-
|
|
|
|
});
|
|
});
|
|
};
|
|
};
|
|
// 监听地图类型变化
|
|
// 监听地图类型变化
|
|
@@ -262,8 +262,8 @@ const setCenter = (item) => {
|
|
|
|
|
|
defineExpose({ addMarker, addSearchMarker, setCenter, getMarkers, clearMarker, handleUndo });
|
|
defineExpose({ addMarker, addSearchMarker, setCenter, getMarkers, clearMarker, handleUndo });
|
|
const handleResize = () => {
|
|
const handleResize = () => {
|
|
- const containerWidth = containerRef.value.clientWidth * (document.body.clientWidth / 8960);
|
|
|
|
- const containerHeight = containerRef.value.clientHeight * (document.body.clientHeight / 2520);
|
|
|
|
|
|
+ const containerWidth = containerRef.value.clientWidth * containerScale().scaleX;
|
|
|
|
+ const containerHeight = containerRef.value.clientHeight * containerScale().scaleY;
|
|
width.value = containerWidth + 'px';
|
|
width.value = containerWidth + 'px';
|
|
height.value = containerHeight + 'px';
|
|
height.value = containerHeight + 'px';
|
|
map.resize();
|
|
map.resize();
|
|
@@ -320,14 +320,14 @@ onUnmounted(() => {
|
|
:deep(.amap-scalecontrol) {
|
|
:deep(.amap-scalecontrol) {
|
|
left: unset !important;
|
|
left: unset !important;
|
|
background-color: unset !important;
|
|
background-color: unset !important;
|
|
- right: 170px;
|
|
|
|
- bottom: 30px !important;
|
|
|
|
|
|
+ right: vw(170);
|
|
|
|
+ bottom: vw(0) !important;
|
|
}
|
|
}
|
|
:deep(.amap-scale-text) {
|
|
:deep(.amap-scale-text) {
|
|
text-align: left !important;
|
|
text-align: left !important;
|
|
padding-left: 20px;
|
|
padding-left: 20px;
|
|
color: #eaf3fc;
|
|
color: #eaf3fc;
|
|
- font-size: 25.73px;
|
|
|
|
|
|
+ font-size: vw(25.73);
|
|
font-family: 'SourceHanSansCN';
|
|
font-family: 'SourceHanSansCN';
|
|
}
|
|
}
|
|
:deep(.amap-scale-edgeleft),
|
|
:deep(.amap-scale-edgeleft),
|