uiwjs / react-amap

基于 React 封装的高德地图组件,帮助你轻松的接入地图到 React 项目中。
https://uiwjs.github.io/react-amap
MIT License
400 stars 64 forks source link

Marker flashed in the wrong position #369

Open martesi opened 4 days ago

martesi commented 4 days ago

Marker and Text are showed by useVisible before their positions are set to the correct ones by useSettingProperties.

In v7.0.2, this causes flashes.

Snipaste_2024-07-05_09-56-25

Snipaste_2024-07-05_09-57-07

martesi commented 4 days ago

370 was assuming problem is caused by the display timing. But the marker is created with same params, it should has the right position in the first place. I can force visible to false on create and set default value for visiable, so useVisiable can display the correct position marker. It's not solving the mystery of the initial wrong position though.

jaywcjlove commented 4 days ago

@martesi Can rolling back the code fix this issue? I always believed there was nothing wrong with the previous one.

martesi commented 4 days ago

You mean v7.0.1? I have pinned the version to v7.0.0 so far. v7.0.1 works fine without strict mode, but I personally like to keep it open, as the reason react recommended it. If that's decided, I can opt out strict mode and provide feedback based on that.