错误TypeError:a.addEventListener不是一个函数,openlayers 3

时间:2017-07-04 00:13:10

标签: typescript openlayers-3

我正在尝试缓冲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

0 个答案:

没有答案