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:
@@ -4,9 +4,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer/Grid.js
|
||||
*
|
||||
* Class: OpenLayers.Layer.WorldWind
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.Grid>
|
||||
*/
|
||||
OpenLayers.Layer.WorldWind = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.WorldWind.prototype =
|
||||
@@ -15,17 +18,36 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
DEFAULT_PARAMS: {
|
||||
},
|
||||
|
||||
/** WorldWind layer is always a base layer
|
||||
*
|
||||
* @type Boolean
|
||||
/**
|
||||
* APIProperty: isBaseLayer
|
||||
* WorldWind layer is a base layer by default.
|
||||
*/
|
||||
isBaseLayer: true,
|
||||
|
||||
// LevelZeroTileSizeDegrees
|
||||
|
||||
/**
|
||||
* APIProperty: lzd
|
||||
* LevelZeroTileSizeDegrees
|
||||
*/
|
||||
lzd: null,
|
||||
|
||||
/**
|
||||
* APIProperty: zoomLevels
|
||||
* Number of zoom levels.
|
||||
*/
|
||||
zoomLevels: null,
|
||||
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WorldWind
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String} Name of Layer
|
||||
* url - {String} Base URL
|
||||
* lzd - {Float} Level zero tile size degrees
|
||||
* zoomLevels - {Int} number of zoom levels
|
||||
* params - {Object} additional parameters
|
||||
* options - {Object} additional options
|
||||
*/
|
||||
initialize: function(name, url, lzd, zoomLevels, params, options) {
|
||||
this.lzd = lzd;
|
||||
this.zoomLevels = zoomLevels;
|
||||
@@ -40,6 +62,9 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Method: addTile
|
||||
*/
|
||||
addTile:function(bounds,position) {
|
||||
if (this.map.getResolution() <= (this.lzd/512)
|
||||
&& this.getZoom() <= this.zoomLevels) {
|
||||
@@ -53,6 +78,10 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getZoom
|
||||
* Convert map zoom to WW zoom.
|
||||
*/
|
||||
getZoom: function () {
|
||||
var zoom = this.map.getZoom();
|
||||
var extent = this.map.getMaxExtent();
|
||||
@@ -61,12 +90,15 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns A string with the layer's url and parameters and also the
|
||||
* Method: getURL
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
*
|
||||
* Returns:
|
||||
* {String} A string with the layer's url and parameters and also the
|
||||
* passed-in bounds and appropriate tile size specified as
|
||||
* parameters
|
||||
* @type String
|
||||
*/
|
||||
getURL: function (bounds) {
|
||||
bounds = this.adjustBounds(bounds);
|
||||
|
||||
Reference in New Issue
Block a user