有没有办法在openlayers中读取geojson并转换为WKT格式,我的问题是当我添加多个geojson作为矢量图层时,它们不会显示为一层,请告诉我如何显示多个geojson作为一部分一个向量层,我的代码是
for (var i = 0; i < content.GeoJsonFiles.length; i++) {
//color = content.Settings.BreakStyles[totalcolor].Color;
//totalcolor++;
var id = content.GeoJsonFiles[i];
// alert(content.GeoJsonFiles[i]);
var geojson_layer = new OpenLayers.Layer.Vector("GeoJSON", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url:'i.geojson' ,
format: new OpenLayers.Format.GeoJSON({})
}), renderers: ["Canvas", "SVG", "VML"]
});
map.addLayer(geojson_layer);
}