add getLayer() function to Map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@979 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -233,6 +233,24 @@ OpenLayers.Map.prototype = {
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @param {String} name
|
||||
*
|
||||
* @returns The Layer with the corresponding id from the map's
|
||||
* layer collection, or null if not found.
|
||||
* @type OpenLayers.Layer
|
||||
*/
|
||||
getLayer: function(id) {
|
||||
var foundLayer = null;
|
||||
for (var i = 0; i < this.layers.length; i++) {
|
||||
var layer = this.layers[i];
|
||||
if (layer.id == id) {
|
||||
foundLayer = layer;
|
||||
}
|
||||
}
|
||||
return foundLayer;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Layer} layer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user