Google Maps API - too much recursion / Maximum call stack size exceeded

9,550 views
Skip to first unread message

conualfy

unread,
Feb 3, 2012, 10:00:42 AM2/3/12
to google-map...@googlegroups.com
Hello!

I'm trying to, create a PolyLine in Google Maps API v3.

I have a set of data that works, and one that it doesn't.
This one works:
data2 = '[{"lat":"45.74917000000001","lng":" 21.199520000000003"},{"lat":"45.74965","lng":" 21.20257"}]';
//it works, I get the polyline
var routePointsObject = jQuery.parseJSON(data2);//F: facem un test cu o linie aiurea

This one does not. I have no idea what is the real difference and why it does not work.
data2 = '[{"lat":"45,74521","lng":" 21,20206"},{"lat":"45,74609","lng":" 21,20504"}]';
//Too much recursion (Firebug) / Uncaught RangeError: Maximum call stack size exceeded (Chrome)
var routePointsObject = jQuery.parseJSON(data2);


Is there some rule for picking the coordinates? I just chose 2 points in Google Maps, in the same area with the ones that work.

Thank you,
F.

geoco...@gmail.com

unread,
Feb 3, 2012, 2:35:12 PM2/3/12
to Google Maps JavaScript API v3
On Feb 3, 7:00 am, conualfy <florin.arj...@gmail.com> wrote:
> Hello!
>
> I'm trying to, create a PolyLine in Google Maps API v3.
>
> I have a set of data that works, and one that it doesn't.
> This one works:
>
> > data2 = '[{"lat":"45.74917000000001","lng":"
> > 21.199520000000003"},{"lat":"45.74965","lng":" 21.20257"}]';
> > //it works, I get the polyline
> > var routePointsObject = jQuery.parseJSON(data2);//F: facem un test cu o
> > linie aiurea
>
> This one does not. I have no idea what is the real difference and why it
> does not work.
>
> > data2 = '[{"lat":"45,74521","lng":" 21,20206"},{"lat":"45,74609","lng":"
> > 21,20504"}]';

Notice the different format of the data ("," vs ".")

-- Larry

conualfy

unread,
Feb 3, 2012, 5:03:28 PM2/3/12
to google-map...@googlegroups.com
You are so right, sorry for spending your time with my lack of attention. :D

Thanks, it works.
Reply all
Reply to author
Forward
0 new messages