huafu / ember-google-map

An Ember addon to include a google-map Ember friendly component in your apps.
http://huafu.github.io/#/ember?name=ember-google-map
MIT License
87 stars 34 forks source link

Show one infowindow at a time #55

Open thagul opened 9 years ago

thagul commented 9 years ago

If I add description to each markers, and then click on every markers, all infowindows stay open. I would like to show one infowindow at a time, as suggested in the Google Documentation regarding infowindow (https://developers.google.com/maps/documentation/javascript/infowindows#add)

Best practices: For the best user experience, only one info window should be open on the map at any one time. Multiple info windows make the map appear cluttered. If you only need one info window at a time, you can create just one InfoWindow object and open it at different locations or markers upon map events, such as user clicks. If you do need more than one info window, you can display multiple InfoWindow objects at the same time.

I can't find a way to do that. Any suggestion? Thanks

brandonparsons commented 9 years ago

@thagul Did you figure out a way to make this happen?

thagul commented 9 years ago

No, I didn't find a way to do that and unfortunately I've no much time to dig any further. I'm very busy on more urgent issues on my project and this is not one of them

huafu commented 9 years ago

Ok, that's something I'll be adding in 0.1. Basically (if someone wants to do a PR) it'd need a property on the google-map component to point to the currently shown info-window, and in the info-window view, use that value to close the old one before updating that property with the new opening one. I know it might be a bit more complex, just no time to work on this now :-/

oswaldoacauan commented 9 years ago

:+1: