OpenLayers Cookbook

The best method to learn the many ways OpenLayers can be used to render data on maps is to dive straight into these recipes. With a mix of basic and advanced techniques, it’s ideal for JavaScript novices and experts alike.

OpenLayers Cookbook

Cookbook
Antonio Santiago Perez

The best method to learn the many ways OpenLayers can be used to render data on maps is to dive straight into these recipes. With a mix of basic and advanced techniques, it’s ideal for JavaScript novices and experts alike.
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781849517843
Paperback300 pages

About This Book

  • Understand the main concepts about maps, layers, controls, protocols, events etc
  • Learn about the important tile providers and WMS servers
  • Packed with code examples and screenshots for practical, easy learning

Who This Book Is For

If you are a GIS-related professional with some basic knowledge of web technologies and want to start or gain in-depth knowledge of creating web mapping applications, this book is written for you

The recipes are appropriately mixed to suit JavaScript newbies or experts and cover basic to advanced topics on OpenLayers.

Table of Contents

Chapter 1: Web Mapping Basics
Introduction
Creating a simple full screen map
Different ways to include OpenLayers
Understanding base and non-base layers
Avoiding the need of a base layer
Playing with the map's options
Managing map's stack layers
Managing map's controls
Moving around the map view
Restricting the map extent
Chapter 2: Adding Raster Layers
Introduction
Using Google Maps imagery
Using Bing imagery
Adding WMS layer
Wrapping the date line options
Changing the zoom effect
Changing the layer opacity
Using WMS with single tile mode
Buffering the layer data to improve the map navigation
Creating an image layer
Setting the tile size in WMS layers
Chapter 3: Working with Vector Layers
Introduction
Adding a GML layer
Adding a KML layer
Creating features programmatically
Reading and creating features from a WKT
Adding markers to the map
Using point features as markers
Working with popups
Adding features from a WFS server
Using the cluster strategy
Filtering features in WFS requests
Reading features directly using Protocols
Chapter 4: Working with Events
Introduction
Creating a side-by-side map comparator
Implementing a work in progress indicator for map layers
Listening for vector layer features' events
Listening for non-OpenLayers events
Chapter 5: Adding Controls
Introduction
Adding and removing controls
Adding a navigation history control
Working with geolocation
Placing controls outside the map
Editing features on multiple vector layers
Modifying features
Measuring distances and areas
Getting feature information from data source
Getting information from the WMS server
Chapter 6: Theming
Introduction
Understanding how themes work using the img folder
Understanding how themes work using the theme folder
Delimiting tiles in a raster layer
Creating a new OpenLayers theme
Starting actions outside the controls
Chapter 7: Styling Features
Introduction
Styling features using symbolizers
Improving style using StyleMap and the replacement of feature's attributes
Playing with StyleMap and the render intents
Working with unique value rules
Defining custom rules to style features
Styling clustered features
Chapter 8: Beyond the Basics
Introduction
Working with projections
Retrieving remote data with OpenLayers.Request
Creating a custom control
Creating a custom renderer
Selecting features intersecting with a line
Making an animation with image layers

What You Will Learn

  • Create maps, understand projection and other important properties
  • Add raster and vector layers
  • Work with important tile providers
  • Work with OGCs WMS and WFS compliant servers
  • Read/write features from/to different data sources
  • Style features to improve their visualization
  • Understand events and work with the main controls

In Detail

Data visualization and analysis has become an important task for many companies. Understanding the basic concepts of GIS and knowing how to visualize data on a map is a required ability for many professionals today. OpenLayers is a JavaScript library to load, display, and render maps from multiple sources on web pages.

"OpenLayers Cookbook" teaches how to work with OpenLayers, one of the most important and complete open source JavaScript libraries.
Through an extensive set of recipes, this book shows how to work with the main concepts required to build a GIS web application– maps, raster and vector layers, styling, theming, and so on.

"OpenLayers Cookbook" includes problem solving and how-to recipes for the most common and important tasks. A wide range of topics are covered.

The range of recipes includes: creating basic maps, working with raster and vector layers, understanding events and working with main controls, reading features from different data sources, styling features, and understanding the underlying architecture.

"OpenLayers Cookbook" describes solutions and optimizations to problems commonly found.

Authors

Table of Contents

Chapter 1: Web Mapping Basics
Introduction
Creating a simple full screen map
Different ways to include OpenLayers
Understanding base and non-base layers
Avoiding the need of a base layer
Playing with the map's options
Managing map's stack layers
Managing map's controls
Moving around the map view
Restricting the map extent
Chapter 2: Adding Raster Layers
Introduction
Using Google Maps imagery
Using Bing imagery
Adding WMS layer
Wrapping the date line options
Changing the zoom effect
Changing the layer opacity
Using WMS with single tile mode
Buffering the layer data to improve the map navigation
Creating an image layer
Setting the tile size in WMS layers
Chapter 3: Working with Vector Layers
Introduction
Adding a GML layer
Adding a KML layer
Creating features programmatically
Reading and creating features from a WKT
Adding markers to the map
Using point features as markers
Working with popups
Adding features from a WFS server
Using the cluster strategy
Filtering features in WFS requests
Reading features directly using Protocols
Chapter 4: Working with Events
Introduction
Creating a side-by-side map comparator
Implementing a work in progress indicator for map layers
Listening for vector layer features' events
Listening for non-OpenLayers events
Chapter 5: Adding Controls
Introduction
Adding and removing controls
Adding a navigation history control
Working with geolocation
Placing controls outside the map
Editing features on multiple vector layers
Modifying features
Measuring distances and areas
Getting feature information from data source
Getting information from the WMS server
Chapter 6: Theming
Introduction
Understanding how themes work using the img folder
Understanding how themes work using the theme folder
Delimiting tiles in a raster layer
Creating a new OpenLayers theme
Starting actions outside the controls
Chapter 7: Styling Features
Introduction
Styling features using symbolizers
Improving style using StyleMap and the replacement of feature's attributes
Playing with StyleMap and the render intents
Working with unique value rules
Defining custom rules to style features
Styling clustered features
Chapter 8: Beyond the Basics
Introduction
Working with projections
Retrieving remote data with OpenLayers.Request
Creating a custom control
Creating a custom renderer
Selecting features intersecting with a line
Making an animation with image layers

Book Details

ISBN 139781849517843
Paperback300 pages
Read More

Recommended for You

Instant OpenLayers Starter
$ 10.00
GeoServer Beginner’s Guide
$ 10.00