refactor(map): 调整相关变量名和参数名
- 将所有点位配置中的 mapIcon 属性修改为 markIcon - 将所有点位配置中的 mapType 属性修改为 markTypemaster
parent
a5d0f2588b
commit
accee1dd51
|
|
@ -30,55 +30,55 @@ export const branchOfficeUtilsList = [
|
||||||
label: "动火作业",
|
label: "动火作业",
|
||||||
type: "hotWork",
|
type: "hotWork",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco9,
|
markIcon: pointIco9,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "受限空间作业",
|
label: "受限空间作业",
|
||||||
type: "confinedSpace",
|
type: "confinedSpace",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco10,
|
markIcon: pointIco10,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "临时用电作业",
|
label: "临时用电作业",
|
||||||
type: "electricity",
|
type: "electricity",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco11,
|
markIcon: pointIco11,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "高处作业",
|
label: "高处作业",
|
||||||
type: "highWork",
|
type: "highWork",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco12,
|
markIcon: pointIco12,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "断路作业",
|
label: "断路作业",
|
||||||
type: "cutRoad",
|
type: "cutRoad",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco13,
|
markIcon: pointIco13,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "动土作业",
|
label: "动土作业",
|
||||||
type: "breakGround",
|
type: "breakGround",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco14,
|
markIcon: pointIco14,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "吊装作业",
|
label: "吊装作业",
|
||||||
type: "hoisting",
|
type: "hoisting",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco15,
|
markIcon: pointIco15,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "盲板抽堵作业",
|
label: "盲板抽堵作业",
|
||||||
type: "blindBoard",
|
type: "blindBoard",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco16,
|
markIcon: pointIco16,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "摄像头",
|
label: "摄像头",
|
||||||
check: false,
|
check: false,
|
||||||
type: "camera",
|
type: "camera",
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -89,19 +89,19 @@ export const branchOfficeUtilsList = [
|
||||||
{
|
{
|
||||||
label: "口门",
|
label: "口门",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco1,
|
markIcon: pointIco1,
|
||||||
type: "car",
|
type: "car",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "人员",
|
label: "人员",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco33,
|
markIcon: pointIco33,
|
||||||
type: "person",
|
type: "person",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "车辆",
|
label: "车辆",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco2,
|
markIcon: pointIco2,
|
||||||
type: "car",
|
type: "car",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -118,7 +118,7 @@ export const branchOfficeUtilsList = [
|
||||||
label: "摄像头",
|
label: "摄像头",
|
||||||
check: false,
|
check: false,
|
||||||
type: "camera",
|
type: "camera",
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -129,38 +129,38 @@ export const branchOfficeUtilsList = [
|
||||||
{
|
{
|
||||||
label: "消防救援队",
|
label: "消防救援队",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco4,
|
markIcon: pointIco4,
|
||||||
type: "xfjyd01",
|
type: "xfjyd01",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防控制室",
|
label: "消防控制室",
|
||||||
check: false,
|
check: false,
|
||||||
type: "xfkzs01",
|
type: "xfkzs01",
|
||||||
mapIcon: pointIco5,
|
markIcon: pointIco5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防泵房",
|
label: "消防泵房",
|
||||||
check: false,
|
check: false,
|
||||||
type: "xfbf01",
|
type: "xfbf01",
|
||||||
mapIcon: pointIco6,
|
markIcon: pointIco6,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防水源",
|
label: "消防水源",
|
||||||
check: false,
|
check: false,
|
||||||
type: "xfsy01",
|
type: "xfsy01",
|
||||||
mapIcon: pointIco7,
|
markIcon: pointIco7,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防点位",
|
label: "消防点位",
|
||||||
check: false,
|
check: false,
|
||||||
type: "point",
|
type: "point",
|
||||||
mapIcon: pointIco8,
|
markIcon: pointIco8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "报警设备",
|
label: "报警设备",
|
||||||
check: false,
|
check: false,
|
||||||
type: "alarm",
|
type: "alarm",
|
||||||
mapIcon: pointIco32,
|
markIcon: pointIco32,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -188,13 +188,13 @@ export const branchOfficeUtilsList = [
|
||||||
label: "气象站",
|
label: "气象站",
|
||||||
type: "293187ddfd984c9ab3fd716aef58da0e",
|
type: "293187ddfd984c9ab3fd716aef58da0e",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco17,
|
markIcon: pointIco17,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "风速站",
|
label: "风速站",
|
||||||
type: "2da29f00852a4653ba3e760b9de57412",
|
type: "2da29f00852a4653ba3e760b9de57412",
|
||||||
check: false,
|
check: false,
|
||||||
mapIcon: pointIco19,
|
markIcon: pointIco19,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -206,13 +206,13 @@ export const branchOfficeUtilsList = [
|
||||||
label: "重点工程定位",
|
label: "重点工程定位",
|
||||||
check: false,
|
check: false,
|
||||||
type: "project",
|
type: "project",
|
||||||
mapIcon: pointIco30,
|
markIcon: pointIco30,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "视频定位",
|
label: "视频定位",
|
||||||
check: false,
|
check: false,
|
||||||
type: "video",
|
type: "video",
|
||||||
mapIcon: pointIco31,
|
markIcon: pointIco31,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -224,7 +224,7 @@ export const branchOfficeUtilsList = [
|
||||||
label: "摄像头",
|
label: "摄像头",
|
||||||
check: false,
|
check: false,
|
||||||
type: "platCamera",
|
type: "platCamera",
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico1,
|
img: ico1,
|
||||||
checkImg: ico1On,
|
checkImg: ico1On,
|
||||||
mapIcon: pointIco1,
|
markIcon: pointIco1,
|
||||||
type: "car",
|
type: "car",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -105,7 +105,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico2,
|
img: ico2,
|
||||||
checkImg: ico2On,
|
checkImg: ico2On,
|
||||||
mapIcon: pointIco33,
|
markIcon: pointIco33,
|
||||||
type: "person",
|
type: "person",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -113,7 +113,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico2,
|
img: ico2,
|
||||||
checkImg: ico2On,
|
checkImg: ico2On,
|
||||||
mapIcon: pointIco2,
|
markIcon: pointIco2,
|
||||||
type: "car",
|
type: "car",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -136,7 +136,7 @@ export const portUtilsList = [
|
||||||
type: "camera",
|
type: "camera",
|
||||||
img: ico3,
|
img: ico3,
|
||||||
checkImg: ico3On,
|
checkImg: ico3On,
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -151,7 +151,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico4,
|
img: ico4,
|
||||||
checkImg: ico4On,
|
checkImg: ico4On,
|
||||||
mapIcon: pointIco4,
|
markIcon: pointIco4,
|
||||||
type: "xfjyd01",
|
type: "xfjyd01",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +160,7 @@ export const portUtilsList = [
|
||||||
type: "xfkzs01",
|
type: "xfkzs01",
|
||||||
img: ico5,
|
img: ico5,
|
||||||
checkImg: ico5On,
|
checkImg: ico5On,
|
||||||
mapIcon: pointIco5,
|
markIcon: pointIco5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防泵房",
|
label: "消防泵房",
|
||||||
|
|
@ -168,7 +168,7 @@ export const portUtilsList = [
|
||||||
type: "xfbf01",
|
type: "xfbf01",
|
||||||
img: ico6,
|
img: ico6,
|
||||||
checkImg: ico6On,
|
checkImg: ico6On,
|
||||||
mapIcon: pointIco6,
|
markIcon: pointIco6,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防水源",
|
label: "消防水源",
|
||||||
|
|
@ -176,7 +176,7 @@ export const portUtilsList = [
|
||||||
type: "xfsy01",
|
type: "xfsy01",
|
||||||
img: ico7,
|
img: ico7,
|
||||||
checkImg: ico7On,
|
checkImg: ico7On,
|
||||||
mapIcon: pointIco7,
|
markIcon: pointIco7,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "消防点位",
|
label: "消防点位",
|
||||||
|
|
@ -184,7 +184,7 @@ export const portUtilsList = [
|
||||||
type: "point",
|
type: "point",
|
||||||
img: ico8,
|
img: ico8,
|
||||||
checkImg: ico8On,
|
checkImg: ico8On,
|
||||||
mapIcon: pointIco8,
|
markIcon: pointIco8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "报警设备",
|
label: "报警设备",
|
||||||
|
|
@ -192,7 +192,7 @@ export const portUtilsList = [
|
||||||
type: "alarm",
|
type: "alarm",
|
||||||
img: ico28,
|
img: ico28,
|
||||||
checkImg: ico28On,
|
checkImg: ico28On,
|
||||||
mapIcon: pointIco32,
|
markIcon: pointIco32,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -208,7 +208,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico9,
|
img: ico9,
|
||||||
checkImg: ico9On,
|
checkImg: ico9On,
|
||||||
mapIcon: pointIco9,
|
markIcon: pointIco9,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "受限空间作业",
|
label: "受限空间作业",
|
||||||
|
|
@ -216,7 +216,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico10,
|
img: ico10,
|
||||||
checkImg: ico10On,
|
checkImg: ico10On,
|
||||||
mapIcon: pointIco10,
|
markIcon: pointIco10,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "临时用电作业",
|
label: "临时用电作业",
|
||||||
|
|
@ -224,7 +224,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico11,
|
img: ico11,
|
||||||
checkImg: ico11On,
|
checkImg: ico11On,
|
||||||
mapIcon: pointIco11,
|
markIcon: pointIco11,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "高处作业",
|
label: "高处作业",
|
||||||
|
|
@ -232,7 +232,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico12,
|
img: ico12,
|
||||||
checkImg: ico12On,
|
checkImg: ico12On,
|
||||||
mapIcon: pointIco12,
|
markIcon: pointIco12,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "断路作业",
|
label: "断路作业",
|
||||||
|
|
@ -240,7 +240,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico13,
|
img: ico13,
|
||||||
checkImg: ico13On,
|
checkImg: ico13On,
|
||||||
mapIcon: pointIco13,
|
markIcon: pointIco13,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "动土作业",
|
label: "动土作业",
|
||||||
|
|
@ -248,7 +248,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico14,
|
img: ico14,
|
||||||
checkImg: ico14On,
|
checkImg: ico14On,
|
||||||
mapIcon: pointIco14,
|
markIcon: pointIco14,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "吊装作业",
|
label: "吊装作业",
|
||||||
|
|
@ -256,7 +256,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico15,
|
img: ico15,
|
||||||
checkImg: ico15On,
|
checkImg: ico15On,
|
||||||
mapIcon: pointIco15,
|
markIcon: pointIco15,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "盲板抽堵作业",
|
label: "盲板抽堵作业",
|
||||||
|
|
@ -264,7 +264,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico16,
|
img: ico16,
|
||||||
checkImg: ico16On,
|
checkImg: ico16On,
|
||||||
mapIcon: pointIco16,
|
markIcon: pointIco16,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "摄像头",
|
label: "摄像头",
|
||||||
|
|
@ -272,7 +272,7 @@ export const portUtilsList = [
|
||||||
type: "camera",
|
type: "camera",
|
||||||
img: ico3,
|
img: ico3,
|
||||||
checkImg: ico3On,
|
checkImg: ico3On,
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -288,7 +288,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico17,
|
img: ico17,
|
||||||
checkImg: ico17On,
|
checkImg: ico17On,
|
||||||
mapIcon: pointIco17,
|
markIcon: pointIco17,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "风速站",
|
label: "风速站",
|
||||||
|
|
@ -296,7 +296,7 @@ export const portUtilsList = [
|
||||||
check: false,
|
check: false,
|
||||||
img: ico19,
|
img: ico19,
|
||||||
checkImg: ico19On,
|
checkImg: ico19On,
|
||||||
mapIcon: pointIco19,
|
markIcon: pointIco19,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -334,7 +334,7 @@ export const portUtilsList = [
|
||||||
type: "platCamera",
|
type: "platCamera",
|
||||||
img: ico26,
|
img: ico26,
|
||||||
checkImg: ico26On,
|
checkImg: ico26On,
|
||||||
mapIcon: pointIco3,
|
markIcon: pointIco3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -350,7 +350,7 @@ export const portUtilsList = [
|
||||||
type: "project",
|
type: "project",
|
||||||
img: ico27,
|
img: ico27,
|
||||||
checkImg: ico27On,
|
checkImg: ico27On,
|
||||||
mapIcon: pointIco30,
|
markIcon: pointIco30,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "视频定位",
|
label: "视频定位",
|
||||||
|
|
@ -358,7 +358,7 @@ export const portUtilsList = [
|
||||||
type: "video",
|
type: "video",
|
||||||
img: ico26,
|
img: ico26,
|
||||||
checkImg: ico26On,
|
checkImg: ico26On,
|
||||||
mapIcon: pointIco31,
|
markIcon: pointIco31,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function Map(props) {
|
||||||
|
|
||||||
initMap();
|
initMap();
|
||||||
|
|
||||||
if (query.mapType === "港口") {
|
if (query.markType === "港口") {
|
||||||
const entered = externalEntryPort(query);
|
const entered = externalEntryPort(query);
|
||||||
if (!entered)
|
if (!entered)
|
||||||
message.warning("港口入口参数不完整,无法定位到对应港口");
|
message.warning("港口入口参数不完整,无法定位到对应港口");
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export default function useInitMap() {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
corpinfoId: data.corpinfoId,
|
corpinfoId: data.corpinfoId,
|
||||||
mapType: "港口",
|
markType: "港口",
|
||||||
isExternalEntry: "1",
|
isExternalEntry: "1",
|
||||||
position: { x: Number(longitude), y: Number(latitude) },
|
position: { x: Number(longitude), y: Number(latitude) },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@ export default function useMapMethods(viewerRef) {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
position: getPosition(item.position.x, item.position.y),
|
position: getPosition(item.position.x, item.position.y),
|
||||||
billboard: await getBillboard({ image: portEntityBillboardImage, name: item.name }),
|
billboard: await getBillboard({ image: portEntityBillboardImage, name: item.name }),
|
||||||
monitorItems: { data: { ...item, mapType: "港口" } },
|
monitorItems: { data: { ...item, markType: "港口" } },
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
getViewer().dataSources.add(entityCollection);
|
getViewer().dataSources.add(entityCollection);
|
||||||
|
|
@ -485,7 +485,7 @@ export default function useMapMethods(viewerRef) {
|
||||||
position: getPosition(item.longitude, item.latitude),
|
position: getPosition(item.longitude, item.latitude),
|
||||||
billboard: await getBillboard({ image: branchOfficeEntityBillboardImage, name: item.corpName }),
|
billboard: await getBillboard({ image: branchOfficeEntityBillboardImage, name: item.corpName }),
|
||||||
monitorItems: {
|
monitorItems: {
|
||||||
data: { ...item, id: item.corpinfoId, mapType: "分公司" },
|
data: { ...item, id: item.corpinfoId, markType: "分公司" },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -680,20 +680,20 @@ export default function useMapMethods(viewerRef) {
|
||||||
/**
|
/**
|
||||||
* desc: 添加点位
|
* desc: 添加点位
|
||||||
* @param {Array} pointList
|
* @param {Array} pointList
|
||||||
* @param options {Object: {mapIcon, type, subLabel}} 配置项
|
* @param options {Object: {markIcon, type, subLabel}} 配置项
|
||||||
* @param options.mapIcon {String} 扎点图标
|
* @param options.markIcon {String} 扎点图标
|
||||||
* @param options.mapType {String} 扎点类型
|
* @param options.markType {String} 扎点类型
|
||||||
* @param options.subLabel {String} 二级标题(用于弹窗标题)
|
* @param options.subLabel {String} 二级标题(用于弹窗标题)
|
||||||
*/
|
*/
|
||||||
const addMarkPoint = async (pointList, options) => {
|
const addMarkPoint = async (pointList, options) => {
|
||||||
if (!options.mapType)
|
if (!options.markType)
|
||||||
throw new Error("请传入mapType(扎点类型)");
|
throw new Error("请传入markType(扎点类型)");
|
||||||
if (!options.mapIcon)
|
if (!options.markIcon)
|
||||||
throw new Error("请传入mapIcon(扎点图标)");
|
throw new Error("请传入markIcon(扎点图标)");
|
||||||
mitt.emit(changeCoverMaskVisibleMittKey, true);
|
mitt.emit(changeCoverMaskVisibleMittKey, true);
|
||||||
await chunkedLoad(pointList, 10, async (item) => {
|
await chunkedLoad(pointList, 10, async (item) => {
|
||||||
const entityCollection = createEntityCollection(
|
const entityCollection = createEntityCollection(
|
||||||
`markEntityCollection_${options.mapType}`,
|
`markEntityCollection_${options.markType}`,
|
||||||
);
|
);
|
||||||
const name = item.MAP_POINT_NAME || item.AREA_NAME || "";
|
const name = item.MAP_POINT_NAME || item.AREA_NAME || "";
|
||||||
entityCollection.entities.add(
|
entityCollection.entities.add(
|
||||||
|
|
@ -701,9 +701,9 @@ export default function useMapMethods(viewerRef) {
|
||||||
id: createId(),
|
id: createId(),
|
||||||
name,
|
name,
|
||||||
position: getPosition(item.LONGITUDE, item.LATITUDE),
|
position: getPosition(item.LONGITUDE, item.LATITUDE),
|
||||||
billboard: await getBillboard({ image: options.mapIcon, name }),
|
billboard: await getBillboard({ image: options.markIcon, name }),
|
||||||
monitorItems: {
|
monitorItems: {
|
||||||
data: { ...item, mapType: `标记点_${options.mapType}`, title: options.subLabel },
|
data: { ...item, markType: `标记点_${options.markType}`, title: options.subLabel },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -712,15 +712,15 @@ export default function useMapMethods(viewerRef) {
|
||||||
const dataSource = await addMergedEntityCollection(
|
const dataSource = await addMergedEntityCollection(
|
||||||
getViewer(),
|
getViewer(),
|
||||||
"markEntityCollection",
|
"markEntityCollection",
|
||||||
options.mapType,
|
options.markType,
|
||||||
);
|
);
|
||||||
enabledClustering(dataSource);
|
enabledClustering(dataSource);
|
||||||
mitt.emit(changeCoverMaskVisibleMittKey, false);
|
mitt.emit(changeCoverMaskVisibleMittKey, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除点位
|
// 删除点位
|
||||||
const removeMarkPoint = (mapType) => {
|
const removeMarkPoint = (markType) => {
|
||||||
removeEntityCollection(getViewer(), `markEntityCollectionMerged${mapType ? `_${mapType}` : ""}`);
|
removeEntityCollection(getViewer(), `markEntityCollectionMerged${markType ? `_${markType}` : ""}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -111,15 +111,15 @@ export default function usePointClickEvent(viewerRef, mapMethods) {
|
||||||
const pointClickEvent = (pick) => {
|
const pointClickEvent = (pick) => {
|
||||||
const data = pick.monitorItems.data;
|
const data = pick.monitorItems.data;
|
||||||
closePopup();
|
closePopup();
|
||||||
if (data.isExternalEntry === "1" && data.mapType === "港口") {
|
if (data.isExternalEntry === "1" && data.markType === "港口") {
|
||||||
clickPortPointEnter(data);
|
clickPortPointEnter(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data.mapType === "港口")
|
if (data.markType === "港口")
|
||||||
clickPortPoint(data);
|
clickPortPoint(data);
|
||||||
if (data.mapType === "分公司")
|
if (data.markType === "分公司")
|
||||||
clickBranchOfficePoint(data);
|
clickBranchOfficePoint(data);
|
||||||
if (data.mapType.includes("标记点"))
|
if (data.markType.includes("标记点"))
|
||||||
clickMarkPoint(data);
|
clickMarkPoint(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue