2016-12-28 59 views
1

我热堆与GeoJSON的
我有重投影GeoJSON的从服务器
对象通过AJAX加载了CRS设置为EPSG对象:2180

我想在它覆盖OpenStreet地图有CRS EPSG:3857
的OpenLayers GeoJSON的重投影

var buildingsFeatures = (new ol.format.GeoJSON()).readFeatures($buildings, { 
     dataProjection: 'EPSG:2180', 
     featureProjection: 'EPSG:3857' 
    }); 

$建筑以GeoJSON的FeatureCollection对象,上面的代码是按的OpenLayers文档,但坐标没有改变。

我撞墙吧:(

回答

0

可以做的事,使之工作:

proj4.defs('EPSG:2180', '+ proj = tmerc + lat_0 = 0 + lon_0 = 19 + k = 0.9993 + x_0 = 500000 + y_0 = -5300000 + ellps = GRS80 +单位= m + no_defs' ] ]);

就是这样。

相关问题