Skip to main content
1 of 2
Hicham Zouarhi
  • 3.3k
  • 2
  • 20
  • 32

to load a geojson file in OL3 use :

var yourVectorSource=new ol.source.Vector({
    projection : 'EPSG:3857',
    url: 'yourFile.geojson',
            format: new ol.format.GeoJSON()
    });

for the source then set it to a vector layer

Hicham Zouarhi
  • 3.3k
  • 2
  • 20
  • 32