# OpenLayers.Layer.XYZ

The XYZ class is designed to make it easier for people who have tiles arranged by a standard XYZ grid.

#### Inherits from

- OpenLayers.Layer.Grid

Summary

OpenLayers.Layer.XYZ | The XYZ class is designed to make it easier for people who have tiles arranged by a standard XYZ grid.
Properties |
isBaseLayer | Default is true, as this is designed to be a base tile source.
sphericalMecator | Whether the tile extents should be set to the defaults for spherical mercator.
zoomOffset | {Number} If your cache has more zoom levels than you want to provide access to with this layer, supply a zoomOffset.
serverResolutions | {Array} A list of all resolutions available on the server.
Constructor |
OpenLayers.Layer.XYZ |
Functions |
clone | Create a clone of this layer
setMap | When the layer is added to a map, then we can fetch our origin (if we don’t have one.)
OpenLayers.Layer.OSM | A class to access OpenStreetMap tiles.

### Properties

### isBaseLayer

Default is true, as this is designed to be a base tile source.

### sphericalMecator

Whether the tile extents should be set to the defaults for spherical mercator. Useful for things like OpenStreetMap. Default is false, except for the OSM subclass.

### zoomOffset

{Number} If your cache has more zoom levels than you want to provide access to with this layer, supply a zoomOffset. This zoom offset is added to the current map zoom level to determine the level for a requested tile. For example, if you supply a zoomOffset of 3, when the map is at the zoom 0, tiles will be requested from level 3 of your cache. Default is 0 (assumes cache level and map zoom are equivalent). Using zoomOffset is an alternative to setting serverResolutions if you only want to expose a subset of the server resolutions.

### serverResolutions

{Array} A list of all resolutions available on the server. Only set this property if the map resolutions differs from the server.

### Constructor

### OpenLayers.Layer.XYZ

#### Parameters

name | {String}
url | {String}
options | {Object} Hashtable of extra options to tag onto the layer

### Functions

### clone

> clone: function ( | obj | )

Create a clone of this layer

#### Parameters

obj | {Object} Is this ever used?

#### Returns

{OpenLayers.Layer.XYZ} An exact clone of this OpenLayers.Layer.XYZ

### setMap

> setMap: function( | map | )

When the layer is added to a map, then we can fetch our origin (if we don’t have one.)

#### Parameters

map | {OpenLayers.Map}

## OpenLayers.Layer.OSM

A class to access OpenStreetMap tiles. By default, uses the OpenStreetMap hosted tile.openstreetmap.org ‘Mapnik’ tileset. If you wish to use tiles@home / osmarender layer instead, you can pass a layer like:

>     new OpenLayers.Layer.OSM("t@h",
>       "http://tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png");

This layer defaults to Spherical Mercator.

#### Inherits from

- OpenLayers.Layer.XYZ

> clone: function ( | obj | )

Create a clone of this layer

> setMap: function( | map | )

When the layer is added to a map, then we can fetch our origin (if we don’t have one.)
Base class for layers that use a lattice of tiles.
{Number} If your cache has more zoom levels than you want to provide access to with this layer, supply a zoomOffset.
{Array} A list of all resolutions available on the server.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
The XYZ class is designed to make it easier for people who have tiles arranged by a standard XYZ grid.
Close