我想在OpenLayers的Google地图图层上叠加一些投影为WGS-84的数据。但是我只是不能把它们放在正确的位置。我做了如下:
map = new OpenLayers.Map('map', {
numZoomLevels: 20,
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG: 4326")
});
googlelayer = new OpenLayers.Layer.Google("Google street", {sphericalMercator: true});
map.addLayer(googlelayer);
veclayer = new OpenLayers.Layer.Vector("vector", {
projection: map.displayProjection
};
var geojson_format = new OpenLayers.Format.GeoJSON();
veclayer.addFeatures(geojson_format.read(jsonData));
尽管我已经分配veclayer
了4326投影,但是尽管我将displayProjection设置为4326,但它仍被解释为900913,并且显示协调系统也为900913。我会犯什么错误?
preFeatureInsert
含义,无论如何,我在官方API文档中找不到它