<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><A
href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.removeLayer">http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.removeLayer</A><A
href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Layer/Markers-js.html#OpenLayers.Layer.Markers.removeMarker"></A></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <B>On Behalf Of </B>wrap
map<BR><B>Sent:</B> Wednesday, March 18, 2009 10:05 AM<BR><B>To:</B>
users@openlayers.org<BR><B>Subject:</B> [OpenLayers-Users] how to remove
selected marker<BR></FONT><BR></DIV>
<DIV></DIV>hey all,<BR><BR>function CreateNewMarker() {<BR>
markerName = document.getElementById("markerName").value;<BR>
if (document.getElementById("markerName").value.length == 0)
<BR> alert("You cannot leave markername
empty");<BR> else
{<BR> markers = new
OpenLayers.Layer.Markers(markerName);<BR>
map.addLayer(markers);<BR>
add();<BR><BR> }<BR>}<BR><BR>now i want to remove marker that
i added as the definite layer, i tried to make layer delete but that is not
working for me.<BR><BR>i tired as:<BR><BR>markerName.removeLayer()<BR><BR>or how
can i remove selected layer which i can get the name from text box and delete
them<BR><BR><BR></BODY></HTML>