Mayank Tailor
Mayank Tailor

Reputation: 344

bounds_changed event of google map not fire multiple time on map drag in mobile device, it works on desktop

I have Google map with markers.
I have shown a custom popup on marker click.Popup adjust its position as map is dragged, So to adjust its position i have used bound_changed event of Google maps.

Issue is:- bounds_changed event fire continuously as map dragged so i adjust popup position which is perfect for Desktop browser.But in mobile device this bounds_changes event fire only after drag is completed ,same as 'idle' event of Google maps. Here is link :- link

Upvotes: 0

Views: 617

Answers (1)

mindparse
mindparse

Reputation: 7255

I faced this same problem a while back and had to use the center_changed event instead as I needed to restrict the users visible bounds if they tried to drag the map out of a certain visible area.

I am actually switching between using the bounds_changed and center_changed event depending on whether the user is on a desktop or mobile device. Are you able to do this in whatever framework you are using?

Upvotes: 1

Related Questions