I'm getting a very weird and hard problem to debug when I create about
3000~4000 polylines.

I'm only parsing my data (that comes from an ajax post) and creating a
new GPolyine, not showing them on the map.

In Chrome the javascript error is:
Uncaught TypeError: Cannot read property 'x' of undefined


Basically I have 1 html with the map and 1 button that does an ajax
post, gets javascript data, resets the polylines array, creates the
3000~4000 polylines and adds them to the array,

The error doesn't appear always! Just sometimes when I click the
button. It seems to never occur on the first click, only after the 3
or 4th...


This error causes my remainder javascript to not be executed which
causes a lot of problems.

The code to parse my jscript data and create the GPolylines:

lines = new Array();
for (var i = 0; i < circuitsDb.length; i++) {
            var circuit = circuitsDb[i];

var newCircuit = new GPolyline([new
GLatLng(parseFloat(circuit.startY), parseFloat(circuit.startX)),
                new GLatLng(parseFloat(circuit.endY),
parseFloat(circuit.endX))], circuit.lineColor,
                    parseFloat(circuit.lineWeight),
                    parseFloat(circuit.lineOpacity));

lines.push(newCircuit);
}


I also analysed my data and it seems everything is OK.


Anyone has any idea how to solve this or how to do a better debugging?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to