nicowesse / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

docs.indexes not loaded until function calling geo.parse finish #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

initialize(){
...
geo.parse([G, U, L]);
...
}

function X(N){

if ( (N=="G" || N=="U" || N=="L") && (geo.docs.length < 5) ) { geo.parse([Gc, 
Uc, Lc]); }
for (var i=0; i < geo.docs.length; i++) { geo.hideDocument(geo.docs[i]); }

var aux;
switch(N){
    case "G":         
            geo.showDocument(geo.docs[0]);
        break;
    case "U":
        geo.showDocument(geo.docs[1]);
        break;
    case "L":
        geo.showDocument(geo.docs[2]);
        break;
        case "Gc":
            aux=geo.docs.length;
                window.alert(aux);          
            geo.showDocument(geo.docs[0]);
        break;
    case "Uc":
                aux=geo.docs.length;
                window.alert(aux);
        geo.showDocument(geo.docs[1]);
        break;
    case "Lc":
                aux=geo.docs.length;
                window.alert(aux);
        geo.showDocument(geo.docs[2]);
        break;
        default:
                break; 
}
} 

What is the expected output? What do you see instead?

The expected output is out = 6.

At the first run of function X I see out = 3.
Chrome console saids: "Uncaught TypeError: Cannot read property 'url' of 
undefined.
(It not found index 3,4 or 5 of geo.docs)
Firefox console saids: "token sin cerrar" (Unclosed token).

After the first run it works right and out = 6.

What version of the product are you using? On what operating system?

polys branch r123 - Ubuntu 14.04

Original issue reported on code.google.com by mateo.la...@gmail.com on 13 Mar 2015 at 5:19