OSM Map OpenLayers 5 问题:地图不会显示

Problem with OSM Map OpenLayers 5 : the map won't show

Openlayers 5 将不再显示 OSM 地图 我尝试从 ol.source.OSM() 添加,但显示的是灰色地图。

  var map3 = new ol.Map({
      layers:  new ol.layer.Tile({
        source: new ol.source.OSM()
      }) ,
    target: 'map-id3',
    view: new ol.View({
      center:ol.proj.fromLonLat([10.74,34.77]),
      zoom:12
    }) 

  });

layers 必须是数组

  layers: [ new ol.layer.Tile({
    source: new ol.source.OSM()
  }) ],