Tile layer is generally used as a webgis in the bottom of the map, the usual use of OSM (OpenStreetMap) (most convenient), other maps such as Baidu Map, the gold map can also be loaded as a data source. You can also make tile layers on your own to publish and then call.
var map = new ol. Map ({
layers: [New Ol.layer.Tile ({
source:new Ol.source.OSM ()
}), Vector],
target: ' map ',
view: New OL. View ({
Center: [ -73.99710639567148, 40.742270050255556],
maxzoom:19,
zoom:14,
projection: ' EPSG : 4326 '
})
});
The above code is the layer that loads the OSM as the base graph, and the target property value is the ID of a div in HTML that determines the location of the map in the HTML page. View is a visual field that defines the zoom level, initial position, and coordinate system of the map. epsg:4326 is a wps84 coordinate system, and another common coordinate system is a Webgis coordinate system (more commonly used) for Epsg:3857,google release.