[OpenLayers-Commits] r12131 - trunk/openlayers/lib/OpenLayers/Layer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Jun 29 18:56:59 EDT 2011
Author: tschaub
Date: 2011-06-29 15:56:58 -0700 (Wed, 29 Jun 2011)
New Revision: 12131
Modified:
trunk/openlayers/lib/OpenLayers/Layer/TMS.js
Log:
Updating the TMS API docs.
Modified: trunk/openlayers/lib/OpenLayers/Layer/TMS.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/TMS.js 2011-06-29 19:23:43 UTC (rev 12130)
+++ trunk/openlayers/lib/OpenLayers/Layer/TMS.js 2011-06-29 22:56:58 UTC (rev 12131)
@@ -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:
* - <OpenLayers.Layer.Grid>
@@ -19,13 +31,33 @@
/**
* 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 <TileMap> as advertised by the service.
+ * For example, if the service advertises a <TileMap> with
+ * 'href="http://tms.osgeo.org/1.0.0/vmap0"', the <layername> 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 <TileFormat> element as the
+ * "extension" attribute. For example, if the service advertises a
+ * <TileMap> with <TileFormat width="256" height="256" mime-type="image/jpeg" extension="jpg" />,
+ * the <type> 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 @@
* with this location (no tiles shall overlap this location). If
* not provided, the grid of tiles will be aligned with the map's
* <maxExtent>. 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 @@
* 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 <OpenLayers.Control.LayerSwitcher>
+ * 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
+ * <layername> and <type> properties must be set here.
*/
initialize: function(name, url, options) {
var newArguments = [];
@@ -85,9 +133,11 @@
/**
* 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:
* {<OpenLayers.Layer.TMS>} An exact clone of this <OpenLayers.Layer.TMS>
@@ -136,7 +186,7 @@
},
/**
- * APIMethod: setMap
+ * Method: setMap
* When the layer is added to a map, then we can fetch our origin
* (if we don't have one.)
*
More information about the Commits
mailing list