Book Image

OpenLayers 3.x Cookbook - Second Edition

By : Peter J. Langley, Antonio Santiago Perez
Book Image

OpenLayers 3.x Cookbook - Second Edition

By: Peter J. Langley, Antonio Santiago Perez

Overview of this book

OpenLayers 3 is one of the most important and complete open source JavaScript mapping libraries today. Throughout this book, you will go through recipes that expose various features of OpenLayers 3, allowing you to gain an insight into building complex GIS web applications. You will get to grips with the basics of creating a map with common functionality and quickly advance to more complicated solutions that address modern challenges. You will explore into maps, raster and vector layers, and styling in depth. This book also includes problem solving and how-to recipes for the most common and important tasks.
Table of Contents (14 chapters)
OpenLayers 3.x Cookbook Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Using Bing imagery


Bing Maps is the mapping service provided by Microsoft. OpenLayers makes integration with this tile service very easy with the class ol.source.BingMaps. We'll explore the variety of imagery Bing Maps offers.

We're going to create a map with a panel containing a list of layers you can switch between. The source code can be found in ch02/ch02-bing-maps/. We will end up with something similar to the following screenshot:

Getting ready

Bing Maps requires you to register as a consumer user in order to access their REST tile service. Once registered, you'll be able to view your personal API key which is needed to initialize the OpenLayers Bing Maps source layer. Your API key is used to authenticate you against the Bing Maps service.

Note

You can find out how to register for an API key at https://www.bingmapsportal.com.

In addition to this, you can learn about the imagery that Bing Maps offers at https://msdn.microsoft.com/en-us/library/ff701716.aspx.

From this point on, it is assumed...