Using a map for controls also.

This commit is contained in:
ahocevar
2012-06-21 19:33:33 +02:00
parent 9bd507e9b8
commit 188615391d
4 changed files with 12 additions and 15 deletions

View File

@@ -3,21 +3,16 @@ goog.provide('ol.control.Control');
/**
* @type {Object}
* @private
* @enum {Object}
*/
ol.control.registry_ = {};
ol.control.CONTROL_MAP = {};
/**
* @param {string} name
* @param {Function} Control
* @param {string} id
*/
ol.control.register = function(Control, id) {
ol.control.registry_[id] = Control;
};
ol.control.fromRegistry = function(id) {
return ol.control.registry_[id];
ol.control.addControl = function(name, Control) {
ol.control.CONTROL_MAP = Control;
};
/**