Book Image

OpenLayers 2.10 Beginner's Guide

Book Image

OpenLayers 2.10 Beginner's Guide

Overview of this book

Table of Contents (18 chapters)
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Turning our example into an application


So far, we've accessed data from Flickr, saved it to a file, and added it to our map. This is pretty cool, but we really haven't done much else than just load in the data, from an OpenLayers point of view. It's useful, but we really haven't created a full featured 'web application' just yet. So, let's focus on how to build a more useful web-mapping application.

To do this, we'll basically need to do two general things:

  1. Add some interactivity to our map.

  2. Use 'live' data. We shouldn't have to manually download a KML file every time we want new data—our web application should do it automatically.

Let's focus on the first part, and then change the data source after we develop some interactivity.

Adding interactivity

In the previous example, each feature received an externalGraphic property because we used extractStyles (causing thumbnails to be displayed for each feature)—but it's hard to see where they are on the map, especially when zoomed out. We'll need...