Expose the getUid function
It is often useful in application code to have a way to uniquely identify and object. Exposing the OpenLayers mechanism allows for best performance and avoid unneccessary dirt.
This commit is contained in:
@@ -44,6 +44,7 @@ let uidCounter_ = 0;
|
||||
*
|
||||
* @param {Object} obj The object to get the unique ID for.
|
||||
* @return {number} The unique ID for the object.
|
||||
* @api
|
||||
*/
|
||||
export function getUid(obj) {
|
||||
return obj.ol_uid || (obj.ol_uid = ++uidCounter_);
|
||||
|
||||
Reference in New Issue
Block a user