eschwartz / backbone.googlemaps

A Backbone JS extension for interacting with the Google Maps API (v3.10)
MIT License
139 stars 55 forks source link

Selecting a LocationModel in a LocationCollection Deselects All Other LocationModels in All Other Location Collections #16

Closed mcordingley closed 10 years ago

mcordingley commented 10 years ago

I can't help but notice that the issue from #14 still affects all LocationCollections that you have defined whenever any LocationModel gets selected. I couldn't tell if this was desired behavior or not, as I can see that you may only want one location in a map to be selected. This does leave the edge case of there being multiple maps on the page, each with a maximum of one selectable location.

If you want to only have one be selected for a given collection and have it be limited to that, I can easily send a pull request for that attached to this issue. If the intent is to limit it per map... I'm still trying to think of ways to handle that.

Sorry for all of the pull requests and issues, but I like this library and intend to use it as soon as I can. :D

eschwartz commented 10 years ago

You're right -- that's really sloppy logic. There's no reason that the we should be throwing model change events in a global event hub. Our collection should be able to listen to it's own model change events.

Check out b00012bf2b7839ce81989a5604a9af460e010082.

I'm glad you like the library, and I really appreciate the contributions. I'm been busy working on what's turning out to be a scaled-up version of this lib, so I haven't had much opportunity to maintain this repo. But I'm trying to keep up with pull requests when I see them...