Recently, I am modifying the open source stuff of Baidu Maps, and I want to separate out the code that is coupled together. After dismantling it, I found some annoying problems. When there is no logical problem, the effect that should appear does not appear. Then I thought there was something wrong with the code, so I kept looking for it. During debugging, I found that the corresponding event was executed twice. I immediately understood that the event must have been repeatedly bound somewhere. Sure enough, I was really stupid and bound two events.
When you usually write code, if you find that the bound event is triggered twice, you need to check whether the event is bound twice. Don't foolishly check where the code is, or suspect that there is a problem with someone else's API.
This article only records the problems I encountered during development. The recently modified Baidu Map open source stuff will be presented to everyone after the project is released. I'm a newbie and I'd like some advice.
In the future, please pay more attention during the development process.