S
S
sinneren2017-06-14 09:26:18
JavaScript
sinneren, 2017-06-14 09:26:18

How to detect a map shift or stop the boundschagne event so that objects don't close?

Hello.
I have built a map with custom labels and balloons that are loaded via ajax. As the labels themselves, so separately and infa. The problem is that if I click on a label or a cluster, it will open, if it is located at the edge of the map, then it will move, respectively, the label loading event will work, and the balloon will collapse. For balloons, I decided cardinally - balloonAutoPan: false. For clusters, this didn't work, even if clusterAutoPan or clusterBalloonAutoPan were nothing. In general, this is a bad way, but at least. I tried to make a crutch that I found on the Internet, the point was that when the balloon is opened and before the shift, we delete the boundschange event, after the shift we turn it on. But it didn't.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2017-06-14
@sinneren

Wrestled with this for a long time. The only solution that worked for balloons was to look for the label by hand and remove all others from the objectManager. Also a crutch, but it works. With clusters, IMHO, nothing can be done in this implementation, tk. they are recalculated when new ones are added, and in the general case, a cluster after recalculation may no longer exist.
There is a fairly obvious option - do not call loading in boundschange if the balloon is currently open. The solution is also a crutch, and also not the best.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question