<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=010234315-10092008>Fixed
:)</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=010234315-10092008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=010234315-10092008>if
(lineFeature){<BR>
lineFeature.layer.renderer.clear();<BR>
lineFeature.layer.destroyFeatures();</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=010234315-10092008> }<BR>
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=010234315-10092008>was
the solution</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=010234315-10092008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=010234315-10092008>Kenny</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <B>On
Behalf Of </B>Kenny France<BR><B>Sent:</B> 10 September 2008
16:15<BR><B>To:</B> Users@openlayers.org<BR><B>Subject:</B> [OpenLayers-Users]
Clear Line<BR><BR></FONT></DIV>
<DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>Hi
All,</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>I have a app where i load
markers with polylines from a xml file</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>when i click a link i load a
new xml with the following function</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2> function
loadXml(url){<BR> //Clear
markers<BR>
markers.clearMarkers();<BR> //Clear
PolyPoints<BR> pointList = [];<BR>
<BR>
OpenLayers.loadURL(url, null, null, loadSuccess,
loadFailure);<BR>
<BR> //add the marker
layer<BR>
map.addLayer(polys);<BR>
map.addLayer(markers);<BR> <BR>
}</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>the problem i am having is it
is clearing the old markers from the map but it is not clearing the
polyline</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>here is the code for the
poly</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>var polys = new
OpenLayers.Layer.Vector("polys");</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>if (addpoly ==
1){<BR>
newPoint = new
OpenLayers.Geometry.Point(lng,lat);<BR>
pointList.push(newPoint);<BR> var lineFeature =
new
OpenLayers.Feature.Vector(<BR>
new
OpenLayers.Geometry.LineString(pointList),null,poly_style);<BR>
polys.addFeatures([lineFeature]);<BR>
<BR>
} //end Polys</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial size=2>is there a way i can somehow
destroy / remove the old line?</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2>Thanks</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2>Kenny</FONT></SPAN></SPAN></DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN></SPAN> </DIV>
<DIV align=left><SPAN class=813051814-09072002><SPAN
class=495391014-10092008><FONT face=Arial
size=2></FONT></SPAN> </DIV></DIV></SPAN>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>