ermancanitatli / 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

Closed GoogleCodeExporter closed 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

GoogleCodeExporter commented 9 years ago
Ok. I saw that function X ends while the map is still loading.

I add google.maps.event.addListenerOnce(UyMap, 'idle', function(){...}) to the 
script solving my problem.

Do I have to close the issue?

Thank you very much.

Mateo Laiño

Original comment by mateo.la...@gmail.com on 18 Mar 2015 at 2:01

GoogleCodeExporter commented 9 years ago

Original comment by geocodezip on 19 Mar 2015 at 2:35