check length instead of undefined for DisplayRect nodes tagname ns fallback

This commit is contained in:
rlskoeser 2014-08-18 14:17:37 -04:00
parent df90308b0e
commit 0d92737ff2

View File

@ -262,7 +262,7 @@ function configureFromXML( tileSource, xmlDoc ){
} }
dispRectNodes = root.getElementsByTagName( "DisplayRect" ); dispRectNodes = root.getElementsByTagName( "DisplayRect" );
if (dispRectNodes === undefined) { if (dispRectNodes.length === 0) {
dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" )[ 0 ]; dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" )[ 0 ];
} }
for ( i = 0; i < dispRectNodes.length; i++ ) { for ( i = 0; i < dispRectNodes.length; i++ ) {