how to add a feature to a exist layer on map , openlayers-7 this is my code : I defined a vector Layer named myJson and i want to add a Point to this layer in code how can i achieve that ?
const myJson = new VectorLayer({
source: new VectorSource({
format: new GeoJSON(),
url: 'geo.json'
})
})
map.addLayer(myJson);
const P1= new Feature (new Point(coordinate));
myJson.addFeature(P1);