diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index a15318001c..abcb99b636 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -40,7 +40,7 @@ OpenLayers.Feature.prototype= { this.layer = layer; this.lonlat = lonlat; this.data = (data != null) ? data : new Object(); - this.id = (id ? id : 'f' + Math.random()); + this.id = (id != null) ? id : OpenLayers.Util.createUniqueID('f'); }, /** diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index b850d28d63..9b31a90cc1 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -768,7 +768,7 @@ OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position, //set generic properties if (!id) { - id = "OpenLayersDiv" + Math.round(Math.random() * 10000); + id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); } if (!position) { position = "absolute"; @@ -803,7 +803,7 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border) { //set generic properties if (!id) { - id = "OpenLayersDiv" + Math.round(Math.random() * 10000); + id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); } if (!position) { position = "relative";