I try to add GeoJSON layer to my openlayers 3 by the following code.
new ol.layer.Vector({
title: 'added Layer',
source: new ol.source.GeoJSON({
projection : 'EPSG:3857',
url: 'poly1.json'
})
})
Getting the following error,
Uncaught TypeError: ol.source.GeoJSON is not a constructor
Best Answer
to load a geojson file in OL3 use :
for the source then set it to a vector layer