title: Openlayers, javascript
body: <p>I have created a linestring using openlayers below:-</p>
  
  <pre><code>$.each(coords, function(a){
                      console.log("entered coords:"+coords[a][0]+"//"+coords[a][1]);
                      webcentre.lat = coords[a][0];
                      webcentre.lon = coords[a][1];
                      mapref.panTo(webcentre);
                      var c = new openlayer.LonLat(coords[a][1], coords[a][0]),
                      e = new openlayer.Size(40, 70),
                      f = new openlayer.Pixel(-(e.w / 2), -e.h + e.h / 4),
                      g = new openlayer.Marker(c, new openlayer.Icon(l_wb1(coords[a][2]), e, f));
                      var startPt=new openlayer.Geometry.Point( coords[a][1], coords[a][0]);
  
                      if(a&lt;(coords.length-1)){
                      //alert("a is less than coords length:::" +a);
                      endPt=new openlayer.Geometry.Point(coords[a+1][1],coords[a+1][0]);
                      }else {
                      //alert("a is greater than coords length");
                      endPt=new openlayer.Geometry.Point(coords[a][1],coords[a][0]);
                      }
  
                      console.log("startPt:"+startPt+"endPt:"+endPt);
                      line=new openlayer.Geometry.LineString([startPt, endPt]);
                      style={strokeColor : "red",
                fillColor : "black",
                pointRadius : 15,
                fillOpacity : 0.5,
                strokeWidth: 2,
                lineSymbol:"farrow",
                  lineSymbolRadius:7,
                  lineSymbolReverse:0,
                  lineSymbolRepeat:0,
                  lineSymbolOffset:0,
                  lineSymbolStrokeWidth:2,
                  lineSymbolStrokeColor:"green",
                  lineSymbolFillColor:"green"};
                  fea=new openlayer.Feature.Vector(line, {}, style);
                  w = new openlayer.Layer.Vector(
                  "Trace Layer",  {
                          styleMap: F
                  }); 
                  w.addFeatures([fea]);
                  mapref.addLayer(w);
                      var dd1=[];
                      dd1.push(coords[a][1]);
                      dd1.push(coords[a][0]);
                      dd.push(dd1);
                      return s.addMarker(g), g
  
  
                  });
  </code></pre>
  
  <p>Now when i remove the features on click of clear button, markers are removed but not the linestring.</p>
  
  <pre><code>$.publish("clearHighlight", [l_maprefname]), s1 &amp;&amp; (mapref.removeLayer(s1), s1 = void 0)
              w &amp;&amp; w.removeAllFeatures();
  </code></pre>
  
  <p>I have tried using removeFeatures(), destroy(), removeLayer(). But nothing works.</p>
  
  <p>Please help.</p>