small changes found during 5am test-writing spree

git-svn-id: http://svn.openlayers.org/trunk/openlayers@121 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-18 04:21:29 +00:00
parent 89f3b83a4e
commit ac03c894dd
+9 -5
View File
@@ -71,7 +71,7 @@ OpenLayers.Pixel.prototype = {
* @return whether or not the point passed in as parameter is equal to this * @return whether or not the point passed in as parameter is equal to this
* @type bool * @type bool
*/ */
equal:function(px) { equals:function(px) {
var d = this.diff(px); var d = this.diff(px);
return ((d.x == 0) && (d.y == 0)); return ((d.x == 0) && (d.y == 0));
}, },
@@ -181,7 +181,7 @@ OpenLayers.LonLat.prototype = {
/** /**
* @return Shortened String representation of OpenLayers.LonLat object. * @return Shortened String representation of OpenLayers.LonLat object.
* (ex. <i>"5,42"</i>) * (ex. <i>"5, 42"</i>)
* @type String * @type String
*/ */
toShortString:function() { toShortString:function() {
@@ -234,7 +234,8 @@ OpenLayers.LonLat.prototype = {
*/ */
OpenLayers.LonLat.fromString = function(str) { OpenLayers.LonLat.fromString = function(str) {
var pair = str.split(","); var pair = str.split(",");
return new OpenLayers.LonLat(pair[0], pair[1]); return new OpenLayers.LonLat(parseFloat(pair[0]),
parseFloat(pair[1]));
}; };
@@ -308,7 +309,7 @@ OpenLayers.Bounds.prototype = {
* (ex. <i>"5,42,10,45"</i>) * (ex. <i>"5,42,10,45"</i>)
* @type String * @type String
*/ */
toBBOX:function(){ toBBOX:function() {
return (this.minlon + "," + this.minlat + "," + return (this.minlon + "," + this.minlat + "," +
this.maxlon + "," + this.maxlat); this.maxlon + "," + this.maxlat);
}, },
@@ -340,7 +341,10 @@ OpenLayers.Bounds.prototype = {
*/ */
OpenLayers.Bounds.fromString = function(str) { OpenLayers.Bounds.fromString = function(str) {
var bounds = str.split(","); var bounds = str.split(",");
return new OpenLayers.Bounds(bounds[0],bounds[1],bounds[2],bounds[3]); return new OpenLayers.Bounds(parseFloat(bounds[0]),
parseFloat(bounds[1]),
parseFloat(bounds[2]),
parseFloat(bounds[3]));
}; };
OpenLayers.Box = Class.create(); OpenLayers.Box = Class.create();