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