将GeoJSON图层添加到OpenLayers 3
我有一个名为mygeojson.json的GeoJSON文件,我想将其添加为openstreetmap图层顶部的OpenLayers 3中的图层。到目前为止,我可以显示openstreetmap世界,包括缩放等。但是由于某种原因,我无法在其上获取mygeojson.json。 geojson包含许多多边形,如下所示: { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "DN": 2 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 13.559093915055664, 52.545214330050563 ], [ 13.559633429050496, 52.545205649772548 ], [ 13.559633415380715, 52.545214636296755 ], [ 13.559093915055664, 52.545214330050563 ] ] …