Ticket #1855 (new feature)
introduce OpenLayers.Array.getBy
| Reported by: | bartvde | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.13 Release |
| Component: | Util | Version: | 2.7 |
| Keywords: | Cc: | ||
| State: | Needs More Work |
Description
> On a side note, should the getBy function of Map.js not be a Util one?
In that case it'd look like:
function(obj, array, property, match) {
var test = (typeof match.test == "function");
var found = OpenLayers.Array.filter(obj[array], function(item) {
return item[property] == match || (test && match.test(item[property]));
});
return found;
}
Given that Map.getBy is an API method it should remain. However it
could rely on the getBy function defined in Util.js:
getBy: function(array, property, match) {
return OpenLayers.Util.getBy(this, array, property, match)
},
I'm +1 on adding a getStrategyByClass method to the Layer.Vector
class and on adding a GetBy function to Util.js.
Thanks Bart,
--
Eric
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

