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