Closed plarsson closed 8 years ago
Ok, yes I forgot that zoom is 2 way. I'm using the dragend and zoom event to trigger a search when the map is moved / zoomed. I can't use the boundschange event as that one is triggered in many other unwanted occasions. For example a info window popup could move the map. In a perfect world I would like to have a "manual bounds change event" . I think it make kinda sense to expose this zoom event so it can be implemented and used in a similar way to dragend etc. But its not a big deal.
My first logic was to remove any event where the name is xxx_changed, where xxx is a props. (because I'm already using this event to trigger changes in the data object).
If you think there is a need for zoom_changed
then that means we need to change this policy and therefore do it for every component/props to make it consistent. Consistency is key. It helps users to "guess" how to use this plugin just by reading the Google maps API reference.
Ok, yes I fully agree. I just figured out it's not working very well anyway. When I receive the zoom_changed
events it's not guaranteed in any way that the bounds props has been updated. So I need another solution. I would prefer to just have a simple watch on the bounds or center property and not rely on any raw events. However thats not going to work as they're changing on many other things than a "manual move" which I'm looking for. Any idea how to solve my problem?
What do you mean by "manual move". (Maybe you can explain your problem in a new issue, I'll do my best to help you)
Yes sure, I can do a full example later but quick.. with manual move I meant a user drag or a user initiated zoom.
I see, and why does bounds_changed
does not fit your needs ?
The bounds_changed
event is triggered also for example when an info window popup doesn't fit fully on the map. This means that the map scrolls and the bounds_changed
event is triggered. This is one case where I don't want to take action such as executing a new search request.
This PR does not add any feature. zoom is already a 2 way bounded. You just have to "$watch" it.
If you think there is a use case for events please explain and I will reopen