Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
922 views
in Technique[技术] by (71.8m points)

ruby on rails - Gmaps4rails Maximum call stack size exceeded?

I've got the following setup, what I want to do is update the markers when a map is moved:

https://gist.github.com/277894809fe04cbc29c7

The json endpoint returns for example:

[{"_id":"4ecc19ca8de17b2f0f000001","latitude":47.413358,"location":[47.413358,9.744583],"longitude":9.744583,"name":"d2"},{"_id":"4ecc14e68de17b2924000001","latitude":47.413417,"location":[47.413417,9.744417],"longitude":9.744417,"name":"another"}]

but I get the following error when moving the map:

Uncaught RangeError: Maximum call stack size exceeded
I.get
a.(anonymous function)
tB.(anonymous function).zoomRange_changed
mf
I.set
(anonymous function)
tB.(anonymous function).zoomRange_changed
mf
I.set
......

No idea what causes this, I put together the sample from various sources, had to adapt a lot as it seems the methods etc changed a lot. Not sure if I missed something, I would be glad if someone could give me a pointer

Thanks a lot, Christoph

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In your json, you should replace: longitude with lng and latitude with lat.

But I should change the code to avoid this kind of weird surprises when arguments are malformed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...