I have a vector layer with a GeoJSON source layer. OpenLayers isn't showing the layer when I try to add features using the addFeatures
method:
myGeoJSONObject = { /* some GeoJSON */ };
editLayer = new ol.layer.Vector({
source : new ol.source.GeoJSON({
style: styleFunction,
defaultProjection: 'EPSG:4326',
projection: "EPSG:3857"
})
});
editLayer.getSource().addFeatures(myGeoJSONObject);
map.addLayer(editLayer);