These are the code samples for The Book of OpenLayer3. Feel free to download the source code and contribute to this repository:
This sample shows how to create a very basic map with only one raster layer from the OpenStreetMap project.