From dbf9048d8f55366b03ccdd417b34e9985797a191 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Fri, 3 Aug 2018 16:07:30 +0200 Subject: [PATCH] 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. --- src/ol/util.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/util.js b/src/ol/util.js index beecbdc9fa..2eee713b3d 100644 --- a/src/ol/util.js +++ b/src/ol/util.js @@ -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_);