update
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -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 });
|
||||
}
|
||||
|
||||
@@ -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({
|
||||
// 点的坐标
|
||||
|
||||
Reference in New Issue
Block a user