O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Google Maps and other layers

Getting other layers to play nicely with these third party layers involve three things, two of which we've already done:

  1. Set up the correct map projection properties.
  2. Make sure sphericalMercator is set to true on the third party map layer.
  3. Ensure all raster layers (any non-Vector or Image layer), such as WMS, are in the map's projection. In this case, we'll need to make sure we ask our WMS server for map tiles in the EPSG:900913 projection.

Using what we learned so far, let's make a mashup. We'll use a Google Maps layer as the base layer, and WMS and Vector layers as overlay layers.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required