PacktLib: OpenLayers Cookbook

OpenLayers Cookbook


About the Author

About the Reviewers


Web Mapping Basics


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

Adding Raster Layers


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

Working with Vector Layers


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

Working with Events


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

Adding Controls


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



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

Styling Features


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

Beyond the Basics


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