OpenLayers 3 文本文件层?

OpenLayers 3 textfile layer?

我想从 OpenLayers 2 迁移到 OpenLayers 3。 在 OpenLayers 2 中有一个文本层:

var pois = new OpenLayers.Layer.Text( "Points of Interest",
                { location:"./textfile.txt",
                  projection: map.displayProjection
                });

如何在 OpenLayers 3 中制作这个图层?是否可以不做任何更改就使用 textfile.txt?

不,在 OpenLayers 3 中没有 OpenLayers.Layer.Text 的等效项。但是例如,您可以改用 GeoJSON,请参阅此 example