angular-ui / ui-map

Google Maps
http://angular-ui.github.io/ui-map
MIT License
288 stars 93 forks source link

fix: Removed map- prefix from event names #9

Open ProLoser opened 11 years ago

ProLoser commented 11 years ago

I didn't see a reason to keep the prefix as the original DOM elements are not used for anything else

This is a Pull Request because it's a destructive change. If anyone disagrees please make your voice known.

glebm commented 11 years ago

I use original DOM events, because I need to to do a hack outside of $apply. Will this change break them?

ProLoser commented 11 years ago

I'm a little confused, can you paste a snippet?

What this does is before, things like clickclose events (from Google Maps API) would actually be routed to ui-event as map-clickclose to avoid accidentally triggering normal events on the relevant DOM element.

I'm essentially dropping the prefix because I don't think the relevant DOM elements are used for anything other than giving you a handle to the map objects, and it only serves to make usage more complicated/confusing.

glebm commented 11 years ago

Will I still be able to bind directly like in the snippet below?

google.maps.event.addListener(scope.googleMap, 'bounds_changed', onBoundsChanged) # onBoundsChanged called outside $apply
# and trigger
google.maps.event.trigger(scope.googleMap, 'resize')
ProLoser commented 11 years ago

Yes that will be completely unaffected. This only effects people who bind using ui-event On May 19, 2013 7:20 AM, "Gleb Mazovetskiy" notifications@github.com wrote:

Will I still be able to bind directly like in the snippet below?

google.maps.event.addListener(scope.googleMap, 'bounds_changed', onBoundsChanged)

and

google.maps.event.trigger(s.googleMap, 'resize')

— Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ui-map/pull/9#issuecomment-18118379 .

glebm commented 11 years ago

OK, great! Thanks, sorry for not getting it :)