diff --git a/src/ol/object.js b/src/ol/object.js index a786c8205b..8894e75241 100644 --- a/src/ol/object.js +++ b/src/ol/object.js @@ -48,6 +48,12 @@ ol.ObjectEventType = { ol.ObjectEvent = function(type, key) { goog.base(this, type); + // Call goog.getUid to ensure that the order of objects' ids is the same as + // the order in which they were created. This also helps to ensure that + // object properties are always added in the same order, which helps many + // JavaScript engines generate faster code. + goog.getUid(this); + /** * The name of the property whose value is changing. * @type {string}