开放图层-GeoJSON错误投影

时间:2020-05-07 14:32:07

标签: openlayers geojson projection

加载类似的GeoJSON时遇到问题:

new OlLayerVector({
    source: new OlSourceVector({
           url: layer.url,
           format: new ol.format.GeoJSON({defaultDataProjection: dataProjection, featureProjection})
    })
});

尽管指定了EPSG:32632投影,但是加载的特征位置严重错误且太大。

当我在本地加载json时,所有内容都会正确显示:

new OlLayerVector({
    source: new OlSourceVector({
           features: (new ol.format.GeoJSON()).readFeatures(geoJsonData, {dataProjection, featureProjection});
    })
});

Any ideas?

0 个答案:

没有答案