Merge all changes from the naturaldocs sandbox. This brings all the work that

has been done in the NaturalDocs branch back to trunk. Thanks to everyone who
helped out in making this happen. (I could list people, but the list would
be long, and I'm already mentally on vacation.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-06-29 15:59:20 +00:00
parent f1c61fd0d6
commit 3948913bfc
107 changed files with 8658 additions and 4011 deletions

View File

@@ -2,10 +2,10 @@
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license. */
/**
/**
* @requires OpenLayers/Layer.js
*
* Class: OpenLayers.Layer.FixedZoomLevels
* Some Layers will already have established zoom levels (like google
* or ve). Instead of trying to determine them and populate a resolutions[]
* Array with those values, we will hijack the resolution functionality
@@ -37,15 +37,13 @@
* Whenever you implement a layer using OpenLayers.Layer.FixedZoomLevels,
* it is your responsibility to provide the following three functions:
*
* - getLonLatFromViewPortPx()
* - getViewPortPxFromLonLat()
* - getZoomForExtent()
* - getLonLatFromViewPortPx
* - getViewPortPxFromLonLat
* - getZoomForExtent
*
* ...those three functions should generally be provided by any reasonable
* API that you might be working from.
*
* @requires OpenLayers/Layer.js
* @class
*
*/
OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class.create();
OpenLayers.Layer.FixedZoomLevels.prototype = {
@@ -60,7 +58,8 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
/********************************************************/
/**
* @constructor
* Constructor: OpenLayers.Layer.FixedZoomLevels
* Create a new fixed zoom levels layer.
*/
initialize: function() {
//this class is only just to add the following functions...
@@ -71,7 +70,8 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
},
/**
*
* Method: initResolutions
* Populate the resolutions array
*/
initResolutions: function() {
@@ -112,9 +112,12 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
}
},
/**
* @returns Degrees per Pixel
* @type float
/**
* APIMethod: getResolution
* Get the current map resolution
*
* Return:
* {Float} Map units per Pixel
*/
getResolution: function() {
@@ -134,12 +137,14 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
}
},
/** Calculates using px-> lonlat translation functions on tl and br
* corners of viewport
/**
* APIMethod: getExtent
* Calculates using px-> lonlat translation functions on tl and br
* corners of viewport
*
* @returns A Bounds object which represents the lon/lat bounds of the
* current viewPort.
* @type OpenLayers.Bounds
* Return:
* {<OpenLayers.Bounds>} A Bounds object which represents the lon/lat
* bounds of the current viewPort.
*/
getExtent: function () {
var extent = null;
@@ -164,11 +169,15 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
},
/**
* @param {float} resolution
* Method: getZoomForResolution
* Get the zoom level for a given resolution
*
* @returns A suitable zoom level for the specified resolution.
* If no baselayer is set, returns null.
* @type int
* Parameters:
* resolution - {Float}
*
* Return:
* {Integer} A suitable zoom level for the specified resolution.
* If no baselayer is set, returns null.
*/
getZoomForResolution: function(resolution) {
@@ -185,26 +194,30 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
/********************************************************/
/* */
/* Translation Functions */
/* */
/* The following functions translate GMaps and OL */
/* formats for Pixel, LonLat, Bounds, and Zoom */
/* */
/********************************************************/
//
// TRANSLATION: MapObject Zoom <-> OpenLayers Zoom
//
/********************************************************/
/* */
/* Translation Functions */
/* */
/* The following functions translate GMaps and OL */
/* formats for Pixel, LonLat, Bounds, and Zoom */
/* */
/********************************************************/
//
// TRANSLATION: MapObject Zoom <-> OpenLayers Zoom
//
/**
* @param {int} gZoom
* Method: getOLZoomFromMapObjectZoom
* Get the OL zoom index from the map object zoom level
*
* Parameters:
* moZoom - {Integer}
*
* @returns An OpenLayers Zoom level, translated from the passed in gZoom
* Returns null if null value is passed in
* @type int
* Return:
* {Integer} An OpenLayers Zoom level, translated from the passed in zoom
* Returns null if null value is passed in
*/
getOLZoomFromMapObjectZoom: function(moZoom) {
var zoom = null;
@@ -215,11 +228,15 @@ OpenLayers.Layer.FixedZoomLevels.prototype = {
},
/**
* @param {int} olZoom
* Method: getMapObjectZoomFromOLZoom
* Get the map object zoom level from the OL zoom level
*
* Parameters:
* olZoom - {Integer}
*
* @returns A MapObject level, translated from the passed in olZoom
* Returns null if null value is passed in
* @type int
* Return:
* {Integer} A MapObject level, translated from the passed in olZoom
* Returns null if null value is passed in
*/
getMapObjectZoomFromOLZoom: function(olZoom) {
var zoom = null;