Gmaps4rails超出最大调用堆栈大小? [英] Gmaps4rails Maximum call stack size exceeded?

查看:72
本文介绍了Gmaps4rails超出最大调用堆栈大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置,我想要做的是在地图移动时更新标记: $ b https://gist.github.com/277894809fe04cbc29c7



json端点例如返回:

  [{_ id:4ecc19ca8de17b2f0f000001,latitude:47.413358,location:[47.413358,9.744583] , 经度:9.744583, 姓名: D2},{ _ ID: 4ecc14e68de17b2924000001, 纬度:47.413417, 位置:[47.413417,9.744417], 经度:9.744417, 姓名 :another}] 

但移动地图时出现以下错误:

 未捕获的RangeError:超过最大调用堆栈大小
I.get
a。(匿名函数)
tB 。(匿名函数).zoomRange_changed
mf
I.set
(匿名函数)
tB。(匿名函数).zoomRange_changed
mf
I.设置
......

不知道是什么原因造成的,我把各种来源的样本放在一起,必须适应很多,因为看起来方法等变了很多。
不知道是否我错过了一些东西,如果有人能给我一个指针,我会很高兴



非常感谢,
Christoph

解决方案在你的json中,你应该用替换 longitude lng 纬度 lat



但是,如果参数格式错误,我应该更改代码以避免这种奇怪的意外。

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

解决方案

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.

这篇关于Gmaps4rails超出最大调用堆栈大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆