diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index ac1d896b07..b3026b5670 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -191,18 +191,32 @@ OpenLayers.Layer = OpenLayers.Class({ /** * APIProperty: projection - * {} or {} Set in the layer options to - * override the default projection string this layer - also set maxExtent, - * maxResolution, and units if appropriate. Can be either a string or - * an object when created -- will be converted - * to an object when setMap is called if a string is passed. + * {} or {} Specifies the projection of the layer. + * Can be set in the layer options. If not specified in the layer options, + * it is set to the default projection specified in the map, + * when the layer is added to the map. + * Projection along with default maxExtent and resolutions + * are set automatically with commercial baselayers in EPSG:3857, + * such as Google, Bing and OpenStreetMap, and do not need to be specified. + * Otherwise, if specifying projection, also set maxExtent, + * maxResolution or resolutions as appropriate. + * When using vector layers with strategies, layer projection should be set + * to the projection of the source data if that is different from the map default. + * + * Can be either a string or an object; + * if a string is passed, will be converted to an object when + * the layer is added to the map. + * */ projection: null, /** * APIProperty: units - * {String} The layer map units. Defaults to 'degrees'. Possible values + * {String} The layer map units. Defaults to null. Possible values * are 'degrees' (or 'dd'), 'm', 'ft', 'km', 'mi', 'inches'. + * Normally taken from the projection. + * Only required if both map and layers do not define a projection, + * or if they define a projection which does not define units. */ units: null, diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index e11dc71efc..11594923ae 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -256,18 +256,21 @@ OpenLayers.Map = OpenLayers.Class({ /** * APIProperty: projection - * {String} Set in the map options to override the default projection - * string this map. When using a projection other than EPSG:4326 + * {String} Set in the map options to specify the default projection + * for layers added to this map. When using a projection other than EPSG:4326 * (CRS:84, Geographic) or EPSG:3857 (EPSG:900913, Web Mercator), - * also set maxExtent and maxResolution. Default is "EPSG:4326". + * also set maxExtent, maxResolution or resolutions. Default is "EPSG:4326". + * Note that the projection of the map is usually determined + * by that of the current baseLayer (see and ). */ projection: "EPSG:4326", /** * APIProperty: units * {String} The map units. Possible values are 'degrees' (or 'dd'), 'm', - * 'ft', 'km', 'mi', 'inches'. Only required if the projection default - * should be overridden. + * 'ft', 'km', 'mi', 'inches'. Normally taken from the projection. + * Only required if both map and layers do not define a projection, + * or if they define a projection which does not define units */ units: null, diff --git a/lib/OpenLayers/Projection.js b/lib/OpenLayers/Projection.js index 47b1dcabaa..9f0cbbd77a 100644 --- a/lib/OpenLayers/Projection.js +++ b/lib/OpenLayers/Projection.js @@ -54,7 +54,7 @@ OpenLayers.Projection = OpenLayers.Class({ * projCode - {String} A string identifying the Well Known Identifier for * the projection. * options - {Object} An optional object to set additional properties - * on the layer. + * on the projection. * * Returns: * {} A projection object.