add prefix for id

This commit is contained in:
mourner 2010-09-07 14:01:11 +03:00
parent 16097461f5
commit f65df4972f

View File

@ -24,9 +24,9 @@ L.Util.bind = function(/*Function*/ fn, /*Object*/ obj) /*-> Object*/ {
};
L.Util.stamp = (function() {
var lastId = 0;
var lastId = 0, key = '_leaflet_id';
return function(/*Object*/ obj) {
obj.id = obj.id || ++lastId;
return obj.id;
obj[key] = obj[key] || ++lastId;
return obj[key];
};
})();