I understand OSM can initially only work with EPSG: 3857, but the data in geojson is stored in EPSG: 4326.
var geojsonObject = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "LineString", "coordinates": [[40, 52.70], [116.20, 70]] } } ] }; var vectorSource = new ol.source.Vector({ features: (new ol.format.GeoJSON()).readFeatures(geojsonObject) }); var vectorLayer = new ol.layer.Vector({ source: vectorSource }); var rasterLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); var map = new ol.Map({ layers: [rasterLayer, vectorLayer], target: document.getElementById('map'), view: new ol.View({ projection: 'EPSG:3857', center: [37.61, 55.75], zoom: 4 }) }); In this case, the map is displayed normally, but the line is drawn in the coordinates [0, 0] 
If you change the projection on the EPSG: 4326
var map = new ol.Map({ layers: [rasterLayer, vectorLayer], target: document.getElementById('map'), view: new ol.View({ projection: 'EPSG:4326', center: [37.61, 55.75], zoom: 4 }) }); the map starts to lag terribly, load for a long time and the upper part is stretched, but the line is drawn correctly 
Tell me how to work with geojson in 4326
PS I saw a lot of posts about using ol.source.GeoJSON , but I get the error ol.source.GeoJSON is not a constructor