diff --git a/src/components/AMap/src/AMapDesigner/index.vue b/src/components/AMap/src/AMapDesigner/index.vue
index a3f09ff..bd642b4 100644
--- a/src/components/AMap/src/AMapDesigner/index.vue
+++ b/src/components/AMap/src/AMapDesigner/index.vue
@@ -25,17 +25,17 @@
-
+
- {{ Math.ceil(mapState.defaultZoom * 10 * 10) + "%" }}
+ {{ Math.ceil(mapState.defaultZoom * 10 * 1.1) + "%" }}
-
+
@@ -100,7 +100,7 @@
import AButton from "/@/components/Button/src/BasicButton.vue";
import { Icon } from '/@/components/Icon';
import { useUserStore } from "/@/store/modules/user";
- import { split } from 'lodash-es';
+ import { split, divide, subtract } from 'lodash-es';
import componentSetting from '/@/settings/componentSetting';
/** 类型规范统一声明定义区域 */
@@ -123,7 +123,10 @@
orgList: MapCommonType[];
mapTask: Recordable[];
mapLogisticPoint: Recordable[];
- mapConfig: Recordable;
+ mapConfig: {
+ amapKey: string;
+ options: Recordable;
+ };
}
const mapProps = defineProps({
@@ -177,8 +180,9 @@
viewMode:'3D',
resizeEnable: true,
center: split((userStore.getUserInfo.mapCenter || mapDesigner.mapCenter), ',', 2),
- zoom: 17,
- keyboardEnable: true
+ zoom: mapDesigner.defaultZoom,
+ keyboardEnable: true,
+ zooms: [2, 20]
}
}
});
@@ -263,6 +267,9 @@
})
);
});
+ map.on('zoomchange', ctx => {
+ mapState.defaultZoom = subtract(divide(map.getZoom(),2), 1);
+ });
// 医检机构集群标记点
orgMarkerCluster = new AMap.MarkerCluster(map, [], {
@@ -410,9 +417,9 @@
radius: 14000,
borderWeight: 3,
strokeColor: '#3600ff',
- strokeOpacity: 0.2,
+ strokeOpacity: 0,
strokeWeight: 6,
- fillOpacity: 0.4,
+ fillOpacity: 0,
strokeStyle: 'dashed',
strokeDasharray: [8, 8],
fillColor: '#1791fc',
@@ -422,7 +429,7 @@
// todo: 修改
- // 构造路线导航类
+ // 构造路线导航类`
driving = new AMap.Driving({
map: map,
panel: instance.refs.mapPanel
@@ -522,10 +529,21 @@
mapPointOpenModal(true, { driving });
}
+ /** 处理地图放大 */
+ function handleMapZoomIn() {
+ map.zoomIn();
+ }
+
+ /** 处理地图缩小 */
+ function handleMapZoomOut() {
+ map.zoomOut();
+ }
+
/** 处理地图重置 */
function handleMapReset() {
- // 清除地图扫描圈
- map.remove(scanCourierUserCircleRange || {});
+ // 清除地图
+ map.resize();
+ map.clearMap();
// 清除表单数据
formElRef.value.resetFields();
formElRef.value.clearValidate();
@@ -533,7 +551,8 @@
mapState.mapTask = [];
mapState.mapLogisticPoint = [];
// 重置地图画布
- map.setZoomAndCenter(17, mapState.mapConfig.center);
+ map.setZoomAndCenter(mapState.mapConfig.options.zoom, mapState.mapConfig.options.center);
+ mapState.defaultZoom = mapState.mapConfig.options.zoom;
}
diff --git a/src/components/AMap/src/amap.data.ts b/src/components/AMap/src/amap.data.ts
index e0aff95..9dd60e2 100644
--- a/src/components/AMap/src/amap.data.ts
+++ b/src/components/AMap/src/amap.data.ts
@@ -28,12 +28,6 @@ export const smallHospitalMapList: mapType[] = [
{id: '003', title: '下级医院:第三医院', orientation: 0, lng: 112.918019, lat: 28.283991, notify: true}
];
-export const specimenMapList: mapType[] = [
- {id: '001', title: '收样员:小狗', orientation: 0, lng: 112.915897, lat: 28.295506},
- {id: '002', title: '收样员:小红', orientation: 0, lng: 112.914481, lat: 28.294977},
- {id: '003', title: '收样员:小明', orientation: 0, lng: 112.913864, lat: 28.295114}
-];
-
export const columns: BasicColumn[] = [
{
title: '任务名称',
diff --git a/src/settings/componentSetting.ts b/src/settings/componentSetting.ts
index 2a383c5..3247302 100644
--- a/src/settings/componentSetting.ts
+++ b/src/settings/componentSetting.ts
@@ -48,6 +48,8 @@ export default {
// 地图设计器设置
mapDesigner: {
// 默认中心点
- mapCenter: '112.919043, 28.288623'
+ mapCenter: '112.919043, 28.288623',
+ // 默认缩放
+ defaultZoom: 17
}
};