These are the code samples for The Book of OpenLayer3. Feel free to download the source code and contribute to this repository:
Demonstrates how we can create a custom control to interact with the map's view.