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

Buffering the layer data to improve map navigation


Map navigation is an important factor to take into account for a good user experience. When we pan and zoom the map, you'll often notice blank areas during transitions (because the content is loading), and after a few moments, the tile images appear.

On gridded layers (the focus of this recipe) and WMS layers working in single image mode, we can improve this at the cost of increasing the number of requests or increasing the computation time at the server side.

The idea behind improving map navigation is simple; load the tiles beyond the map view so that they are loaded before the user pans the map view in this direction or changes resolution, thus improving the navigation experience for users.

For this recipe we will create two side by side maps with tiled layers, one with (the top map) and one without (the bottom map) tile buffering enabled. You'll be able to see the differences when navigating around the two maps. The source code for this...