diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index a596f5b957..a28490f563 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -11,6 +11,18 @@ /** * Class: OpenLayers.Layer.TMS + * Create a layer for accessing tiles from services that conform with the + * Tile Map Service Specification + * (http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification). + * + * Example: + * (code) + * var layer = OpenLayers.Layer.TMS( + * "My Layer", // name for display in LayerSwitcher + * "http://tilecache.osgeo.org/wms-c/Basic.py/", // service endpoint + * {layername: "basic", type: "png"} // required properties + * ); + * (end) * * Inherits from: * - @@ -19,13 +31,33 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { /** * APIProperty: serviceVersion - * {String} + * {String} Service version for tile requests. Default is "1.0.0". */ serviceVersion: "1.0.0", + /** + * APIProperty: layername + * {String} The identifier for the as advertised by the service. + * For example, if the service advertises a with + * 'href="http://tms.osgeo.org/1.0.0/vmap0"', the property + * would be set to "vmap0". + */ + layername: null, + + /** + * APIProperty: type + * {String} The format extension corresponding to the requested tile image + * type. This is advertised in a element as the + * "extension" attribute. For example, if the service advertises a + * with , + * the property would be set to "jpg". + */ + type: null, + /** * APIProperty: isBaseLayer - * {Boolean} + * {Boolean} Make this layer a base layer. Default is true. Set false to + * use the layer as an overlay. */ isBaseLayer: true, @@ -36,6 +68,20 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * with this location (no tiles shall overlap this location). If * not provided, the grid of tiles will be aligned with the map's * . Default is ``null``. + * + * Example: + * (code) + * var layer = OpenLayers.Layer.TMS( + * "My Layer", + * "http://tilecache.osgeo.org/wms-c/Basic.py/", + * { + * layername: "basic", + * type: "png", + * // set if different than the bottom left of map.maxExtent + * tileOrigin: new OpenLayers.LonLat(-180, -90) + * } + * ); + * (end) */ tileOrigin: null, @@ -64,9 +110,11 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * Constructor: OpenLayers.Layer.TMS * * Parameters: - * name - {String} - * url - {String} - * options - {Object} Hashtable of extra options to tag onto the layer + * name - {String} Title to be displayed in a + * url - {String} Service endpoint (without the version number). E.g. + * "http://tms.osgeo.org/". + * options - {Object} Additional properties to be set on the layer. The + * and properties must be set here. */ initialize: function(name, url, options) { var newArguments = []; @@ -85,9 +133,11 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { /** * APIMethod: clone - * + * Create a complete copy of this layer. + * * Parameters: - * obj - {Object} + * obj - {Object} Should only be provided by subclasses that call this + * method. * * Returns: * {} An exact clone of this @@ -136,7 +186,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { }, /** - * APIMethod: setMap + * Method: setMap * When the layer is added to a map, then we can fetch our origin * (if we don't have one.) *