Within the past few years, the popularity of interactive web maps has exploded. In the past, creating interactive maps was reserved for large companies or experts with lots of money. But now, with the advent of free services such as Google and Bing Maps, online mapping is easily accessible to everyone. Today, with the right tools, anyone can easily create a web map with little or even no knowledge of geography, cartography, or programming.
Web maps are expected to be fast, accurate, and easy to use. Since they are online, they are expected to be accessible from anywhere on nearly any platform. There are only a few tools that fulfill all these expectations. OpenLayers is one such tool. It's free, open source, and very powerful. Providing both novice developers and seasoned GIS professionals with a robust library, OpenLayers makes it easy to create modern, fast, and interactive web-mapping applications for desktop and mobile.
In this chapter, we will:
OpenLayers is an open source, client-side JavaScript library for making interactive web maps, viewable in nearly any web browser. Since it is a client-side library, it requires no special server-side software or settings—you can use it without even downloading anything! Originally developed by MetaCarta as a response, in part, to Google Maps, the 2.x series of the library has grown into a mature, popular framework with many passionate developers and a very helpful community. At the time of writing, this version is still actively used and maintained, but this book will focus on the latest version, which is 3.0. For people wishing to switch to OpenLayers 3, particularly people already using the OpenLayers 2 series, the main reasons to change are:
You can also add the fact that the library is already used in production, that demonstrates good performance at the Swiss federal geoportal, http://map.geo.admin.ch (see screenshot for reference ) and the OpenGeo Suite, a commercial open source based solution which already bundles the library:
