Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...