coding standards (long lines) and fixing nd comments to be tschaub stylie (statements vs questions, universal four space indent)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3664 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-07-10 16:17:25 +00:00
parent 728ba09060
commit a32a2eefec

View File

@@ -8,11 +8,11 @@
*
* Class: OpenLayers.Tile
* This is a class designed to designate a single tile, however
* it is explicitly designed to do relatively little. Tiles store information
* about themselves -- such as the URL that they are related to, and their
* size - but do not add themselves to the layer div automatically, for
* example. Create a new tile with the <OpenLayers.Tile> constructor, or
* a subclass.
* it is explicitly designed to do relatively little. Tiles store
* information about themselves -- such as the URL that they are related
* to, and their size - but do not add themselves to the layer div
* automatically, for example. Create a new tile with the
* <OpenLayers.Tile> constructor, or a subclass.
*
* TBD 3.0 - remove reference to url in above paragraph
*
@@ -34,7 +34,7 @@ OpenLayers.Tile.prototype = {
/**
* Property: url
* {String} url of the request
* {String} url of the request.
*
* TBD 3.0
* Deprecated. The base tile class does not need an url. This should be
@@ -92,7 +92,7 @@ OpenLayers.Tile.prototype = {
/**
* APIMethod: destroy
* nullify references to prevent circular references and memory leaks
* Nullify references to prevent circular references and memory leaks.
*/
destroy:function() {
this.layer = null;
@@ -104,13 +104,13 @@ OpenLayers.Tile.prototype = {
/**
* Method: draw
* Clear whatever is currently in the tile, then return whether or not
* it should actually be re-drawn.
* it should actually be re-drawn.
*
* Return:
* {Boolean} Whether or not the tile should actually be drawn. Note that
* this is not really the best way of doing things, but such is
* the way the code has been developed. Subclasses call this and
* depend on the return to know if they should draw or not.
* this is not really the best way of doing things, but such is
* the way the code has been developed. Subclasses call this and
* depend on the return to know if they should draw or not.
*/
draw: function() {
@@ -144,7 +144,8 @@ OpenLayers.Tile.prototype = {
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
* redraw - {Boolean} Call draw method on tile after moving? Default is true
* redraw - {Boolean} Call draw method on tile after moving.
* Default is true
*/
moveTo: function (bounds, position, redraw) {
if (redraw == null) {
@@ -162,7 +163,7 @@ OpenLayers.Tile.prototype = {
/**
* Method: clear
* Clear the tile of any bounds/position-related data so that it can
* be reused in a new location.
* be reused in a new location.
*/
clear: function() {
this.drawn = false;
@@ -170,9 +171,9 @@ OpenLayers.Tile.prototype = {
/**
* Method: getBoundsFromBaseLayer
* Take the pixel locations of the corner of the tile, and pass them to the base layer
* and ask for the location of those pixels, so that displaying tiles over Google
* works fine.
* Take the pixel locations of the corner of the tile, and pass them to
* the base layer and ask for the location of those pixels, so that
* displaying tiles over Google works fine.
*
* Parameters:
* position - {<OpenLayers.Pixel>}
@@ -187,7 +188,8 @@ OpenLayers.Tile.prototype = {
bottomRightPx.y += this.size.h;
var bottomRight = this.layer.map.getLonLatFromLayerPx(bottomRightPx);
// Handle the case where the base layer wraps around the date line.
// Google does this, and it breaks WMS servers to request bounds in that fashion.
// Google does this, and it breaks WMS servers to request bounds in
// that fashion.
if (topLeft.lon > bottomRight.lon) {
if (topLeft.lon < 0) {
topLeft.lon = -180 - (topLeft.lon+180);
@@ -195,7 +197,10 @@ OpenLayers.Tile.prototype = {
bottomRight.lon = 180+bottomRight.lon+180;
}
}
bounds = new OpenLayers.Bounds(topLeft.lon, bottomRight.lat, bottomRight.lon, topLeft.lat);
bounds = new OpenLayers.Bounds(topLeft.lon,
bottomRight.lat,
bottomRight.lon,
topLeft.lat);
return bounds;
},