魏熙美 5 years ago
parent
commit
558e7a6a88
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      src/pages/building/list/add/components/amap.jsx

+ 4
- 4
src/pages/building/list/add/components/amap.jsx View File

91
     if (this.props.value !== prevProps.value) {
91
     if (this.props.value !== prevProps.value) {
92
       if (value) {
92
       if (value) {
93
         const temp = value.split(',')
93
         const temp = value.split(',')
94
-        this.setState({ markerPosition: { longitude: temp[1], latitude: temp[0] } })
95
-
96
-        // 需要在设置坐标成功后,重新设置 缩放级别
97
-        this.mapInstance.setZoom(15)
94
+        this.setState({ markerPosition: { longitude: temp[1], latitude: temp[0] } }, () => {
95
+          // 需要在设置坐标成功后,重新设置 缩放级别
96
+          this.mapInstance.setZoom(15)
97
+        })
98
       }
98
       }
99
     }
99
     }
100
   }
100
   }