我正在尝试缓冲openlayers 3中的矢量要素,但是我收到以下错误:
ERROR TypeError: a.addEventListener is not a function
这是我的代码:
var radius = 5,
format = new ol.format.WKT()
var reader = new jsts.io.WKTReader()
var geom = reader.read(format.writeGeometry(this.Feature.getGeometry()))
var buffered = geom.buffer(radius)
var writer = new jsts.io.GeoJSONWriter()
buffered = writer.write(buffered)
var nfeature = {
type: 'Feature',
geometry: buffered,
properties: {}
}
this.VectorOverlay.getSource().addFeature(nfeature) <= error