You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
772 B
37 lines
772 B
/**
|
|
* @module ol/util
|
|
*/
|
|
|
|
/**
|
|
* @return {never} Any return.
|
|
*/
|
|
export function abstract() {
|
|
throw new Error('Unimplemented abstract method.');
|
|
}
|
|
|
|
/**
|
|
* Counter for getUid.
|
|
* @type {number}
|
|
* @private
|
|
*/
|
|
let uidCounter_ = 0;
|
|
|
|
/**
|
|
* 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. Unique IDs are generated
|
|
* as a strictly increasing sequence. Adapted from goog.getUid.
|
|
*
|
|
* @param {Object} obj The object to get the unique ID for.
|
|
* @return {string} The unique ID for the object.
|
|
* @api
|
|
*/
|
|
export function getUid(obj) {
|
|
return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));
|
|
}
|
|
|
|
/**
|
|
* OpenLayers version.
|
|
* @type {string}
|
|
*/
|
|
export const VERSION = '7.1.0';
|