From 59c038f6b0b37b385675892785bba95720bd516a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 3 Jul 2007 17:15:37 +0000 Subject: [PATCH] #794 - adding resolutions as a property of OpenLayers.Map - adding additional comments for ND as well - we need to revisit APIProperties on Layer and Map git-svn-id: http://svn.openlayers.org/trunk/openlayers@3568 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer.js | 37 +++++++++++++++++++++---------------- lib/OpenLayers/Map.js | 29 +++++++++++++++++++---------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 5ca50bdeb3..b6b7ee07b4 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -100,12 +100,14 @@ OpenLayers.Layer.prototype = { /** * Property: options - * {Object} + * {Object} An optional object whose properties will be set on the layer. + * Any of the layer properties can be set as a property of the options + * object and sent to the constructor when the layer is created. */ options: null, /** - * Property: gutter + * APIProperty: gutter * {Integer} Determines the width (in pixels) of the gutter around image * tiles to ignore. By setting this property to a non-zero * value, images will be requested that are wider and taller @@ -118,7 +120,7 @@ OpenLayers.Layer.prototype = { gutter: 0, /** - * Property: projection + * APIProperty: projection * {String} Set in the layer options to override the default projection * string this layer - also set maxExtent, maxResolution, and * units if appropriate. @@ -126,38 +128,41 @@ OpenLayers.Layer.prototype = { projection: null, /** - * Property: units + * APIProperty: units * {String} The layer map units. Defaults to 'degrees'. Possible values * are 'degrees' (or 'dd'), 'm', 'ft', 'km', 'mi', 'inches'. */ units: null, /** - * Property: scales + * APIProperty: scales * {Array} */ scales: null, /** - * Property: resolutions - * {Array} + * APIProperty: resolutions + * {Array} A list of map resolutions (map units per pixel) in descending + * order. If this is not set in the layer constructor, it will be set + * based on other resolution related properties (maxExtent, maxResolution, + * maxScale, etc.). */ resolutions: null, /** - * Property: maxExtent + * APIProperty: maxExtent * {} */ maxExtent: null, /** - * Property: minExtent + * APIProperty: minExtent * {} */ minExtent: null, /** - * Property: maxResolution + * APIProperty: maxResolution * {Float} Default max is 360 deg / 256 px, which corresponds to * zoom level 0 on gmaps. Specify a different value in the layer * options if you are not using a geographic projection and @@ -166,38 +171,38 @@ OpenLayers.Layer.prototype = { maxResolution: null, /** - * Property: minResolution + * APIProperty: minResolution * {Float} */ minResolution: null, /** - * Property: numZoomLevels + * APIProperty: numZoomLevels * {Integer} */ numZoomLevels: null, /** - * Property: minScale + * APIProperty: minScale * {Float} */ minScale: null, /** - * Property: maxScale + * APIProperty: maxScale * {Float} */ maxScale: null, /** - * Property: displayOutsideMaxExtent + * APIProperty: displayOutsideMaxExtent * {Boolean} Request map tiles that are completely outside of the max extent * for this layer. Defaults to false */ displayOutsideMaxExtent: false, /** - * Property: wrapDateLine + * APIProperty: wrapDateLine * {Boolean} #487 for more info. */ wrapDateLine: false, diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 7a58d0f594..5befd0d1b4 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -136,7 +136,7 @@ OpenLayers.Map.prototype = { */ viewRequestID: 0, - // Options + // Options /** * APIProperty: tileSize @@ -146,7 +146,7 @@ OpenLayers.Map.prototype = { tileSize: null, /** - * Property: projection + * APIProperty: projection * {String} Set in the map options to override the default projection * string this map - also set maxExtent, maxResolution, and * units if appropriate. @@ -154,14 +154,23 @@ OpenLayers.Map.prototype = { projection: "EPSG:4326", /** - * Property: units + * APIProperty: units * {String} The map units. Defaults to 'degrees'. Possible values are * 'degrees' (or 'dd'), 'm', 'ft', 'km', 'mi', 'inches'. */ units: 'degrees', /** - * Property: maxResolution + * APIProperty: resolutions + * {Array} A list of map resolutions (map units per pixel) in descending + * order. If this is not set in the layer constructor, it will be set + * based on other resolution related properties (maxExtent, maxResolution, + * maxScale, etc.). + */ + resolutions: null, + + /** + * APIProperty: maxResolution * {Float} Default max is 360 deg / 256 px, which corresponds to * zoom level 0 on gmaps. Specify a different value in the map * options if you are not using a geographic projection and @@ -170,25 +179,25 @@ OpenLayers.Map.prototype = { maxResolution: 1.40625, /** - * Property: minResolution + * APIProperty: minResolution * {Float} */ minResolution: null, /** - * Property: maxScale + * APIProperty: maxScale * {Float} */ maxScale: null, /** - * Property: minScale + * APIProperty: minScale * {Float} */ minScale: null, /** - * Property: maxExtent + * APIProperty: maxExtent * {} The maximum extent for the map. Defaults to the * whole world in decimal degrees * (-180, -90, 180, 90). Specify a different @@ -199,13 +208,13 @@ OpenLayers.Map.prototype = { maxExtent: null, /** - * Property: minExtent + * APIProperty: minExtent * {} */ minExtent: null, /** - * Property: numZoomLevels + * APIProperty: numZoomLevels * {Integer} Number of zoom levels for the map. Defaults to 16. Set a * different value in the map options if needed. */