直接上代码: var vector = new ol.layer.Vector({ source: new ol.source.Vector({ url: './data/geojson/countries.geojson', format: new ol.format.GeoJSON() }) }); map.addLayer(vector);