Created
March 31, 2013 14:40
-
-
Save hpneo/5280821 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GMaps.MarkerCollection = function GMaps.MarkerCollection(markers, options) { | |
| this.markers = markers || []; | |
| var scopes = options.scopes; | |
| for (var i in scopes) { | |
| if (this[i] == undefined) { | |
| this[i] = function() { | |
| var new_collection = []; | |
| for (j = 0; j < this.markers.length; j++) { | |
| var marker = this.markers[j]; | |
| if (scopes[i].call(marker.detail) === true) { | |
| new_collection.push(marker); | |
| } | |
| } | |
| return new_collection; | |
| }; | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment