Replace goog.getUid with ol.getUid
This commit is contained in:
@@ -265,6 +265,28 @@ ol.inherits = function(childCtor, parentCtor) {
|
||||
ol.nullFunction = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Gets a unique ID for an object. This mutates the object so that further calls
|
||||
* with the same object as a parameter returns the same value. Adapted from
|
||||
* goog.getUid.
|
||||
*
|
||||
* @param {Object} obj The object to get the unique ID for.
|
||||
* @return {number} The unique ID for the object.
|
||||
*/
|
||||
ol.getUid = function(obj) {
|
||||
return obj.ol_uid ||
|
||||
(obj.ol_uid = ++ol.uidCounter_);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Counter for getUid.
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
ol.uidCounter_ = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @see https://github.com/tc39/proposal-global
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user