如何更新Openlayers.Layer中的特性



我有一个包含坐标的xml文件,我想在Openlayers Map上画一条线。我已经有一个Openlayers.Layer.Vector,我正在创建一个功能如下:

var points = [];
for (var i = 0; i < coords.length; i++)
{
    point = new OpenLayers.Geometry.Point(aPointsArray[i].lon, aPointsArray[i].lat);
    points.push(point);
}
var geometry = new OpenLayers.Geometry.LineString(points);
var feature = new OpenLayers.Feature.Vector(geometry, null,
{
    strokeColor: aColor,
    strokeOpacity: 0.7,
    strokeWidth: 3
});
aLayer.addFeatures([feature]);

这是预期的,我在我的地图上看到一条线。现在的问题是,我从.xml中得到的点被另一个程序动态地改变了,我想在我的地图上实时地绘制这些变化。我已经有一个方法,定期更新地图,但我如何更新特征/几何到新的点?

尝试aLayer.drawFeature(yourChangedFeature);

最新更新