Include a reference to the Microsoft Mapping API in your
<head>
section, before the OpenLayers inclusion script:<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
Let's set up some layer objects now. We specify the
type
property like in the previous examples. For this layer, the type is prefixed byVEMapStyle.
, which stands for 'Virtual Earth Map Style'. Let's create a 'shaded' layer, which in this case is the street/road layer with shaded elevation:var ve_shaded = new OpenLayers.Layer.VirtualEarth( "Shaded", {type: VEMapStyle.Shaded} );
We'll add an aerial (satellite imagery) layer now:
var ve_aerial = new OpenLayers.Layer.VirtualEarth( "Aerial", {type: VEMapStyle.Aerial} );
Now, let's create a default layer. If we don't pass in a
type
, theVEMapStyle.Road
layer will be used. It is similar to the shaded layer, but without the shading. We'll also use another property...
OpenLayers 2.10 Beginner's Guide
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
Free Chapter
Getting Started with OpenLayers
Squashing Bugs With Firebug
The 'Layers' in OpenLayers
Wrapping Our Heads Around Projections
Interacting with Third Party APIs
Taking Control of Controls
Styling Controls
Charting the Map Class
Using Vector Layers
Vector Layer Style Guide
Making Web Map Apps
Index
Customer Reviews