Hi, On Mon, 2008-02-11 at 09:17 -0500, Christopher Schmidt wrote: > On Thu, Feb 07, 2008 at 03:18:55PM -0000, OpenLayers wrote: > > #1324: OpenLayers.Feature.Vector.clone() must clone the fid property. > > Anyone have thoughts on this? I'm not sure if we should be cloning this, > since it feels to me like a clone is a different object, and fids should > be unique...
If the requirement is that an object must always have a unique fid, then not cloning the fid is also insufficient. You'd have to create a new unique fid. The simplest way would be copying the original fid and adding a random number, like: newObject.fid = oldObject.fid + "_" + Math.round(Math.random() * 1000)); (OK, it's not guaranteed it is unique) If somebody for some reason wants to keep the old fid, he./she can simply copy the old fid to the new object after cloning. 2 my cents. Roald -- Roald de Wit Software Engineer [EMAIL PROTECTED] Commercial Support for Open Source GIS Software http://lisasoft.com/LISAsoft/SupportedProducts/ _______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
