|
@@ -179,6 +179,7 @@ function A1home() {
|
|
|
// 计算提示框位置(城市下方)
|
|
// 计算提示框位置(城市下方)
|
|
|
rect.setAttribute('x', (cityCX - 50).toString()) // 100宽度居中
|
|
rect.setAttribute('x', (cityCX - 50).toString()) // 100宽度居中
|
|
|
rect.setAttribute('y', (cityCY + 20).toString()) // 下移20px
|
|
rect.setAttribute('y', (cityCY + 20).toString()) // 下移20px
|
|
|
|
|
+ // console.log(city, '现在城市')
|
|
|
text.setAttribute('x', cityCX.toString())
|
|
text.setAttribute('x', cityCX.toString())
|
|
|
text.setAttribute('y', (cityCY + 30).toString()) // 文字在矩形内居中
|
|
text.setAttribute('y', (cityCY + 30).toString()) // 文字在矩形内居中
|
|
|
countText.setAttribute('x', (cityCX + 14).toString()) // 矩形中心
|
|
countText.setAttribute('x', (cityCX + 14).toString()) // 矩形中心
|
|
@@ -238,6 +239,7 @@ function A1home() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
Object.keys(martyrListByCity).forEach(item => {
|
|
Object.keys(martyrListByCity).forEach(item => {
|
|
|
|
|
+ console.log(martyrListByCity, '所有城市')
|
|
|
console.log(martyrListByCity[item][0].cityId)
|
|
console.log(martyrListByCity[item][0].cityId)
|
|
|
martyrListByCity[item][0].cityId &&
|
|
martyrListByCity[item][0].cityId &&
|
|
|
addTooltip(
|
|
addTooltip(
|
|
@@ -274,7 +276,6 @@ function A1home() {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
const target = e.target as SVGElement
|
|
const target = e.target as SVGElement
|
|
|
- console.log(target.id)
|
|
|
|
|
focusOnCity(`tap-${target.id}`)
|
|
focusOnCity(`tap-${target.id}`)
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
if (martyrListByCity[cityIdToName[`tap-${target.id}`]]) {
|
|
if (martyrListByCity[cityIdToName[`tap-${target.id}`]]) {
|
|
@@ -390,6 +391,7 @@ function A1home() {
|
|
|
svgRef.current.style.height = '100%'
|
|
svgRef.current.style.height = '100%'
|
|
|
panZoomInstance.current = svgPanZoom(svgRef.current, {
|
|
panZoomInstance.current = svgPanZoom(svgRef.current, {
|
|
|
zoomEnabled: true,
|
|
zoomEnabled: true,
|
|
|
|
|
+ dblClickZoomEnabled: false,
|
|
|
panEnabled: true,
|
|
panEnabled: true,
|
|
|
controlIconsEnabled: false,
|
|
controlIconsEnabled: false,
|
|
|
fit: true,
|
|
fit: true,
|
|
@@ -470,6 +472,14 @@ function A1home() {
|
|
|
|
|
|
|
|
// 在useEffect中添加箭头标记定义
|
|
// 在useEffect中添加箭头标记定义
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
|
+ // window.addEventListener(
|
|
|
|
|
+ // 'dblclick',
|
|
|
|
|
+ // function (event) {
|
|
|
|
|
+ // event.preventDefault()
|
|
|
|
|
+ // event.stopPropagation()
|
|
|
|
|
+ // },
|
|
|
|
|
+ // true
|
|
|
|
|
+ // )
|
|
|
if (svgRef.current) {
|
|
if (svgRef.current) {
|
|
|
addDefs(svgRef)
|
|
addDefs(svgRef)
|
|
|
}
|
|
}
|