This commit is contained in:
zk
2024-09-23 16:43:57 +08:00
parent ca4a9a8c28
commit 278e91c262
26 changed files with 376 additions and 45 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+6 -2
View File
@@ -1,4 +1,4 @@
import { mapIcon1, mapIcon2, mapIcon3, mapIcon4 } from '/@/components/chinaMap/chinaHooks.ts';
import { mapIcon1, mapIcon2, mapIcon3, mapIcon4, mapIcon7 } from '/@/components/chinaMap/chinaHooks.ts';
import { watchIcon } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
import * as turf from '@turf/turf';
@@ -20,7 +20,7 @@ export function createIcon({ icon, iconSize, imageSize }) {
* @desc 根据类型创建Icon
* @type 1:油田医院,2:合作医院,3:医疗点
*/
export function typeToIcon(type: string) {
export function typeToIcon(type: string, centerResource: boolean) {
const iconSize = [18, 44];
const imageSize = [18, 44];
if (type == '1') {
@@ -29,6 +29,10 @@ export function typeToIcon(type: string) {
if (type == '2') {
return createIcon({ icon: mapIcon4, iconSize, imageSize });
}
//关联医疗点
if (type == '3' && centerResource) {
return createIcon({ icon: mapIcon7, iconSize, imageSize });
}
if (type == '3') {
return createIcon({ icon: mapIcon2, iconSize, imageSize });
}
+2 -2
View File
@@ -144,7 +144,7 @@ export const Map = {
this.setZoomCenter(center, zoom);
}
for (let i = 0; i < result.length; i++) {
let { type, lon, lat, lng } = result[i];
let { type, lon, lat, lng, centerResource } = result[i];
if (lng) {
lon = lng;
}
@@ -152,7 +152,7 @@ export const Map = {
continue;
}
// 创建一个 Icon
let startIcon = typeToIcon(type);
let startIcon = typeToIcon(type, centerResource);
// 将 icon 传入 marker
let startMarker = new AMap.Marker({
// 点的坐标