[Mapbender-commits] r2098 - branches/2.5/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Feb 19 08:42:38 EST 2008


Author: christoph
Date: 2008-02-19 08:42:37 -0500 (Tue, 19 Feb 2008)
New Revision: 2098

Modified:
   branches/2.5/http/javascripts/point.js
Log:
jslinted

Modified: branches/2.5/http/javascripts/point.js
===================================================================
--- branches/2.5/http/javascripts/point.js	2008-02-19 13:40:10 UTC (rev 2097)
+++ branches/2.5/http/javascripts/point.js	2008-02-19 13:42:37 UTC (rev 2098)
@@ -39,7 +39,7 @@
  */
 Point.prototype.dist = function(p){
 	return Math.sqrt(Math.pow(this.y-p.y,2) + Math.pow(this.x-p.x,2)) ;
-}
+};
 /**
  * checks if the coordinates of this {@link Point} match the coordinates of a {@link Point} p
  *
@@ -49,7 +49,7 @@
 Point.prototype.equals = function(p){
 	if (this.x == p.x && this.y == p.y) {return true;}
 	return false;
-}
+};
 /**
  * subtracts a {@link Point} p from this {@link Point}
  *
@@ -58,7 +58,7 @@
  */
 Point.prototype.minus = function(p){
 	return new Point(this.x-p.x, this.y-p.y);
-}
+};
 /**
  * adds this {@link Point} to a {@link Point} p
  *
@@ -67,7 +67,7 @@
  */
 Point.prototype.plus = function(p){
 	return new Point(this.x+p.x, this.y+p.y);
-}
+};
 /**
  * divides this {@link Point} by a scalar c
  *
@@ -75,12 +75,12 @@
  * @return a new {@link Point} divided by c
  */
 Point.prototype.dividedBy = function(c){
-	if (c != 0) {
+	if (c !== 0) {
 		return new Point(this.x/c, this.y/c);
 	}
 	var e = new Mb_exception("Point.dividedBy: Division by zero");
 	return false;
-}
+};
 /**
  * multiplies this {@link Point} by a scalar c
  *
@@ -89,7 +89,7 @@
  */
 Point.prototype.times = function(c){
 	return new Point(this.x*c, this.y*c);
-}
+};
 /**
  * rounds the coordinates to numOfDigits digits
  *
@@ -99,7 +99,7 @@
  */
 Point.prototype.round = function(numOfDigits){
 	return new Point(roundToDigits(this.x, numOfDigits), roundToDigits(this.y, numOfDigits));
-}
+};
 /**
  * @returns a {String} representation of this Point
  * @type String
@@ -111,7 +111,7 @@
 	else {
 		return "[" + this.x + ", " + this.y + ", " + this.z + "]";
 	}
-}
+};
 
 
 //------------------------------------------------------------------------
@@ -119,11 +119,19 @@
 /**
  * @ignore
  */
-function mapToReal(frameName, aPoint) {
+function mapToReal(frameName, aPoint){
 	var v;
-	if (typeof(mb_mapObj) == 'object') v = makeClickPos2RealWorldPos(frameName, aPoint.x, aPoint.y);
-	else if (typeof(parent.mb_mapObj) == 'object') v = parent.makeClickPos2RealWorldPos(frameName, aPoint.x, aPoint.y);
-	else alert('where am i?');
+	if (typeof(mb_mapObj) == 'object') {
+		v = makeClickPos2RealWorldPos(frameName, aPoint.x, aPoint.y);
+	}
+	else {
+		if (typeof(parent.mb_mapObj) == 'object') {
+			v = parent.makeClickPos2RealWorldPos(frameName, aPoint.x, aPoint.y);
+		}
+		else {
+			alert('where am i?');
+		}
+	}
 	return new Point(v[0], v[1]);
 }
 /**
@@ -180,5 +188,5 @@
  * @ignore
  */
 function roundToDigits(aFloat, numberOfDigits) {
-	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits)))/Math.pow(10, parseInt(numberOfDigits));
+	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits, 10)))/Math.pow(10, parseInt(numberOfDigits, 10));
 }



More information about the Mapbender_commits mailing list