Fixed :) if (lineFeature){ lineFeature.layer.renderer.clear(); lineFeature.layer.destroyFeatures(); } was the solution Kenny
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenny France Sent: 10 September 2008 16:15 To: Users@openlayers.org Subject: [OpenLayers-Users] Clear Line Hi All, I have a app where i load markers with polylines from a xml file when i click a link i load a new xml with the following function function loadXml(url){ //Clear markers markers.clearMarkers(); //Clear PolyPoints pointList = []; OpenLayers.loadURL(url, null, null, loadSuccess, loadFailure); //add the marker layer map.addLayer(polys); map.addLayer(markers); } the problem i am having is it is clearing the old markers from the map but it is not clearing the polyline here is the code for the poly var polys = new OpenLayers.Layer.Vector("polys"); if (addpoly == 1){ newPoint = new OpenLayers.Geometry.Point(lng,lat); pointList.push(newPoint); var lineFeature = new OpenLayers.Feature.Vector( new OpenLayers.Geometry.LineString(pointList),null,poly_style); polys.addFeatures([lineFeature]); } //end Polys is there a way i can somehow destroy / remove the old line? Thanks Kenny
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users