[ka-Map-dev] [Bug 1571] kaMap.js removeObject not working for all
objects
bugzilla-daemon at bugzilla.maptools.org
bugzilla-daemon at bugzilla.maptools.org
Wed Aug 30 10:58:15 EDT 2006
http://bugzilla.maptools.org/show_bug.cgi?id=1571
pspencer at dmsolutions.ca changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
------- Additional Comments From pspencer at dmsolutions.ca 2006-08-30 10:58 -------
doh, did that without really thinking about it. How about:
kaMap.prototype.removeObject = function( obj ) {
if (obj == null) {
for (var i=0; i<this.aObjects.length; i++) {
obj = this.aObjects[i];
if (obj.canvas) {
obj.canvas.removeChild(obj);
}
}
this.aObjects = [];
return true;
} else {
for (var i=0; i<this.aObjects.length; i++) {
if (this.aObjects[i] == obj || obj == null) {
if (!obj) {
obj = this.aObjects[i];
}
if (obj.canvas) {
obj.canvas.removeChild( obj );
obj.canvas = null;
}
this.aObjects.splice(i,1);
return true;
}
}
return false;
}
};
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Please do NOT reply to this email, use the link above instead to
login to bugzilla and submit your comment. Any email reply to this
address will be lost.
More information about the ka-Map-dev
mailing list