Skip to main content
Reindent same content
Source Link
ThomasG77
  • 31.2k
  • 1
  • 55
  • 95

to load a geojson file in OL3 use :

var yourVectorSource=newyourVectorSource = 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

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

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

Source Link
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