Web mapping is the process of designing, implementing, generating, and delivering maps on the Web and its products. OpenLayers is a powerful, community-driven, open source, pure JavaScript web mapping library. With this, you can easily create your own web map mashup using a myriad of map backends. Interested in knowing more about OpenLayers?
This book is going to help you learn OpenLayers from scratch. OpenLayers 3 Beginner's Guide will walk you through the OpenLayers library in the easiest and most efficient way possible. The core components of OpenLayers are covered in detail, with examples, structured so that you can easily refer back to them later.
The book starts off by showing you how to create a simple map and introduces you to some basic JavaScript programming concepts and tools. You will also find useful resources to learn more about HTML and CSS. Through the course of this book, we will review each component needed to make a map in OpenLayers 3, and you will end with a full-fledged web map application.
You will learn some context to help you understand the key role of each OpenLayers 3 component in making a map. You will also learn important mapping principles such as projections and layers. Maps require sources of data as well; so, you will see how to create your own data files and connect to backend servers for mapping. A key part of this book will also be dedicated to building a mapping application for mobile devices and its specific components.
With OpenLayers 3 Beginner's Guide, you will learn how to create your own map applications independently, without being stuck at the first stage of learning. You will acquire the information you need to develop your skills and knowledge of the OpenLayers 3 library.
Chapter 1, Getting Started with OpenLayers will introduce you to OpenLayers 3 and will help you to learn some basic mapping principles. You will see how to get ready for development in OpenLayers and create your first map.
Chapter 2, Key Concepts in OpenLayers will introduce the main components of the OpenLayers library and illustrate how they are related. We will introduce some key concepts, including events and observable properties, and learn some basic debugging techniques.
Chapter 3, Charting the Map Class will describe two of the core components, the Map and View classes, in detail. We will learn about the properties, methods, and events of both classes and apply them in practical examples.
Chapter 4, Interacting with Raster Data Source will introduce the concept of layers and focus on raster layers. We will explain the difference between tiled and untiled layers and learn how to use OpenLayers to visualize any type of image, even non-geospatial ones.
Chapter 5, Using Vector Layers will introduce vector layers and the related source, format, feature, and geometry classes. We will learn the properties, methods, and events associated with each, and how to use them to load a variety of vector data into an OpenLayers map.
Chapter 6, Styling Vector Layers will expand on our knowledge of vector layers by learning how to apply both static and dynamic styles to them. Through hands-on examples, we'll learn how to modify styles interactively in response to user interaction.
Chapter 7, Wrapping Our Heads Around Projections will cover the basic concepts behind map projections and their characteristics. We will cover projection support within OpenLayers by introducing the Proj4js library and applying it to map, vector, and raster layers.
Chapter 8, Interacting with Your Map will dive into the concept of interactions and introduce the default interactions. After covering the available interactions in detail, we will finish with an example showing how to use interactions to draw a rectangle.
Chapter 9, Taking Control of Controls will demonstrate the use of controls and introduce the default controls provided by OpenLayers. We will also review each of the controls in more detail and learn how to make a custom control.
Chapter 10, OpenLayers Goes Mobile will teach us to take advantage of mobile-specific features such as Geolocation and Device Orientation. We will also learn how to debug mobile web applications and look at some mobile-specific browser features that can be useful for geospatial applications.
Chapter 11, Creating Web Map Apps will build a complete application from scratch and learn how to use the OpenLayers build system to create a production-ready application from our code.
Appendix A, Object-oriented Programming – Introduction and Concepts covers the main concepts of Object-oriented Programming (OOP). After, we will discover how to reuse them exploring the OpenLayers API documentation with OOP in mind.
Appendix B, More details on Closure Tools and Code Optimization Techniques will cover more details on Closure Tools and code optimization techniques. This appendix introduces Closure Tools, a set of tools that OpenLayers 3 library relies on. It provides an understanding on how to use the Closure Library and Closure Compiler with a focus on compressing OpenLayers code files. We will finish with a review of styles and syntax for good coding practices.
Appendix C, Squashing Bugs with Web Debuggers provides JavaScript beginners with an in-depth review of browser developer tools. We will review Chrome Developer Tools, additional extensions and finish with debugging tools in other browsers such as IE and Firefox.