
OpenLayers 2.10 Beginner's Guide

Let's set up a map using Spherical Mercator with a Yahoo! Maps Layer. When using the Google Maps Layer (V3), the sphericalMercator
property is set to true
automatically, so you do not need to do anything extra. However, explicitly specifying it is a good idea when working with other layers that are not in the Spherical Mercator projection.
Since we'll use the Virtual Earth layer type, we need to make sure to include the Microsoft Mapping API:
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
The first step is to specify the maxExtent
, maxResolution
, units
, and projection
properties when creating our map object. If you'll remember from the previous chapter, these are the properties we must set when we specify a map projection other than the default EPSG:4326
projection. We'll also set the displayProjection
property to an EPSG:4326
projection object. This displayProjection
property specifies...
Change the font size
Change margin width
Change background colour