ALKMaps.Layer.XYZ

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

Inherits from

Summary
ALKMaps.Layer.XYZThe XYZ class is designed to make it easier for people who have tiles arranged by a standard XYZ grid.
Properties
isBaseLayerDefault is false, as this is designed to be a base tile source.
sphericalMecatorWhether 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
ALKMaps.Layer.XYZ
Functions
cloneCreate a clone of this layer
updateURLUser defined method for setting dynamic URL parameters.
getURL
getXYZCalculates x, y and z for the given bounds.
setMapWhen the layer is added to a map, then we can fetch our origin (if we don’t have one.)

Properties

isBaseLayer

Default is false, 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.

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 differ from the server.  This property serves two purposes.  (a) serverResolutions can include resolutions that the server supports and that you don’t want to provide with this layer; you can also look at zoomOffset, which is an alternative to serverResolutions for that specific purpose.  (b) The map can work with resolutions that aren’t supported by the server, i.e. that aren’t in serverResolutions.  When the map is displayed in such a resolution data for the closest server-supported resolution is loaded and the layer div is stretched as necessary.

Constructor

ALKMaps.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

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

updateURL

updateURL: function()

User defined method for setting dynamic URL parameters.

Returns

{String} The request URL containing the x, y, and z place holders in addition to any other parameters that need to be passed to the service.

getURL

getURL: function (bounds)

Parameters

bounds{ALKMaps.Bounds}

Returns

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters

getXYZ

getXYZ: function(bounds)

Calculates x, y and z for the given bounds.

Parameters

bounds{ALKMaps.Bounds}

Returns

{Object}an object with x, y and z properties.

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{ALKMaps.Map}
clone: function (obj)
Create a clone of this layer
updateURL: function()
User defined method for setting dynamic URL parameters.
getURL: function (bounds)
getXYZ: function(bounds)
Calculates x, y and z for the given bounds.
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 this class represent bounding boxes.
Instances of ALKMaps.Map are interactive maps embedded in a web page.
Close