Skip to main content
2 of 2
Reindent same content
ThomasG77
  • 31.2k
  • 1
  • 55
  • 95

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