Check to see if values are NaN in *.equals().

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1178 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-08-09 23:38:48 +00:00
parent c7e43b67f3
commit 0b41ad2cef

View File

@@ -64,7 +64,8 @@ OpenLayers.Pixel.prototype = {
equals:function(px) {
var equals = false;
if (px != null) {
equals = ((this.x == px.x) && (this.y == px.y));
equals = ((this.x == px.x && this.y == px.y) ||
(isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y));
}
return equals;
},
@@ -159,7 +160,8 @@ OpenLayers.Size.prototype = {
equals:function(sz) {
var equals = false;
if (sz != null) {
equals = ((this.w == sz.w) && (this.h == sz.h));
equals = ((this.w == sz.w && this.h == sz.h) ||
(isNaN(this.w) && isNaN(this.h) && isNaN(px.w) && isNaN(px.h));
}
return equals;
},
@@ -251,6 +253,7 @@ OpenLayers.LonLat.prototype = {
var equals = false;
if (ll != null) {
equals = ((this.lon == ll.lon) && (this.lat == ll.lat));
(isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat));
}
return equals;
},