dont reinvent the wheel. use Util.js's array enhancer remove() function

git-svn-id: http://svn.openlayers.org/trunk/openlayers@535 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-07 14:50:17 +00:00
parent c2832cf83a
commit 8b7a22bc1f

View File

@@ -45,15 +45,7 @@ OpenLayers.Layer.Markers.prototype =
* @param {OpenLayers.Marker} marker
*/
removeMarker: function(marker) {
var index = null;
for(var i=0; i < this.markers.length; i++) {
if (this.markers[i] == marker) {
index = i;
}
}
if (index != null) {
this.markers.splice(index, 1);
}
this.markers.remove(marker);
if ((marker.icon != null) && (marker.icon.imageDiv != null) &&
(marker.icon.imageDiv.parentNode == this.div) ) {
this.div.removeChild(marker.icon.imageDiv);