diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 00994da..f48e375 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -222,35 +222,35 @@ }) // 添加支路折线文本 // 创建纯文本标记 - const textArr = path.map(item => ( - item.map((child) => { - return ([[(Number(child.flng) + Number(child.tlng)) / 2, (Number(child.flat) + Number(child.tlat)) / 2], child.flowRate]) - }) - )) - textArr.forEach((item) => { - // console.log(item, 'item') - item.forEach((child) => { - const icon = new AMap.Icon({ - size: new AMap.Size(36, 36), // 图标尺寸 - // image: '', // Icon的图像 - imageSize: new AMap.Size(24, 30), // 根据所设置的大小拉伸或压缩图片 - imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等 - }) - // const content = '
111
' - const marker = new AMap.Marker({ - position: child[0], // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] - map: map.value, - content: '', - offset: new AMap.Pixel(-20, -20), - }) - marker.setLabel({ - offset: new AMap.Pixel(-10, -2), // 设置文本标注偏移量 - content: `
${`${child[1]}kgCO2/h`}
`, // 设置文本标注内容 - direction: 'right', // 设置文本标注方位 - }) - map.value.add([marker]) - }) - }) + // const textArr = path.map(item => ( + // item.map((child) => { + // return ([[(Number(child.flng) + Number(child.tlng)) / 2, (Number(child.flat) + Number(child.tlat)) / 2], child.flowRate]) + // }) + // )) + // textArr.forEach((item) => { + // // console.log(item, 'item') + // item.forEach((child) => { + // const icon = new AMap.Icon({ + // size: new AMap.Size(36, 36), // 图标尺寸 + // // image: '', // Icon的图像 + // imageSize: new AMap.Size(24, 30), // 根据所设置的大小拉伸或压缩图片 + // imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等 + // }) + // // const content = '
111
' + // const marker = new AMap.Marker({ + // position: child[0], // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] + // map: map.value, + // content: '', + // offset: new AMap.Pixel(-20, -20), + // }) + // marker.setLabel({ + // offset: new AMap.Pixel(-10, -2), // 设置文本标注偏移量 + // content: `
${`${child[1]}kgCO2/h`}
`, // 设置文本标注内容 + // direction: 'right', // 设置文本标注方位 + // }) + // map.value.add([marker]) + // }) + // }) } }) .catch((e) => { diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 00994da..f48e375 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -222,35 +222,35 @@ }) // 添加支路折线文本 // 创建纯文本标记 - const textArr = path.map(item => ( - item.map((child) => { - return ([[(Number(child.flng) + Number(child.tlng)) / 2, (Number(child.flat) + Number(child.tlat)) / 2], child.flowRate]) - }) - )) - textArr.forEach((item) => { - // console.log(item, 'item') - item.forEach((child) => { - const icon = new AMap.Icon({ - size: new AMap.Size(36, 36), // 图标尺寸 - // image: '', // Icon的图像 - imageSize: new AMap.Size(24, 30), // 根据所设置的大小拉伸或压缩图片 - imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等 - }) - // const content = '
111
' - const marker = new AMap.Marker({ - position: child[0], // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] - map: map.value, - content: '', - offset: new AMap.Pixel(-20, -20), - }) - marker.setLabel({ - offset: new AMap.Pixel(-10, -2), // 设置文本标注偏移量 - content: `
${`${child[1]}kgCO2/h`}
`, // 设置文本标注内容 - direction: 'right', // 设置文本标注方位 - }) - map.value.add([marker]) - }) - }) + // const textArr = path.map(item => ( + // item.map((child) => { + // return ([[(Number(child.flng) + Number(child.tlng)) / 2, (Number(child.flat) + Number(child.tlat)) / 2], child.flowRate]) + // }) + // )) + // textArr.forEach((item) => { + // // console.log(item, 'item') + // item.forEach((child) => { + // const icon = new AMap.Icon({ + // size: new AMap.Size(36, 36), // 图标尺寸 + // // image: '', // Icon的图像 + // imageSize: new AMap.Size(24, 30), // 根据所设置的大小拉伸或压缩图片 + // imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等 + // }) + // // const content = '
111
' + // const marker = new AMap.Marker({ + // position: child[0], // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] + // map: map.value, + // content: '', + // offset: new AMap.Pixel(-20, -20), + // }) + // marker.setLabel({ + // offset: new AMap.Pixel(-10, -2), // 设置文本标注偏移量 + // content: `
${`${child[1]}kgCO2/h`}
`, // 设置文本标注内容 + // direction: 'right', // 设置文本标注方位 + // }) + // map.value.add([marker]) + // }) + // }) } }) .catch((e) => { diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue index fa5ccb8..535fa65 100644 --- a/src/views/data/electricity/components/busbarAdd.vue +++ b/src/views/data/electricity/components/busbarAdd.vue @@ -6,9 +6,14 @@