找不到导致该错误的原因,以及如何找到解决方案...
在 project 下工作:
http://atlas.sitegist.net/business/atlas/?l=en&h=6dff16b6f593384662cb24d66142047a
在项目中,我用整数值显示不同的数据,所有这些数据也显示在 map 上。 当我添加新数据集的另一个可视化时,发生错误。
测试信息:
大多数情况下我必须在 UI 中做一些事件,当然还要做一些下面列出的混合:
- 必须单击“项目”按钮,然后在我的项目的工具栏部分选中/取消选中复选框
- 必须单击左侧边栏面板上的事件(无需展开折叠,对于给定的数据集,对象的选择是通过选择父项进行的)
有时会在 5 分钟内发生错误。有时在第一个镜头中,但主要是在 3-4 个 UI 请求中。
the link above reproduce an error from start, or by 2-3 event triggers.
错误:从控制台复制粘贴
我在 Chrome 控制台中遇到这样的错误:
Uncaught RangeError: Maximum call stack size exceeded
H.get
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
...
H.set
(anonymous function)
Mu.(anonymous function).zoomRange_changed
yf
还有一个:
<error>
(anonymous function)
$
nm
Du
H.bf
H.mapType_changed
yf
H.set
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
H.aa
...
H.aa
Tg.(anonymous function).J
(anonymous function)
Q.trigger
解决方案下的解决方案没有帮助我,因为缺少有关 I.set 的信息,而且我不使用“Gmaps4rails”:
最佳答案
解决!!!
我发现我的 bounds 变量有问题。
当我从服务器接收 JSON 并解析它时,代码从 map 上的每个位置进行绑定(bind)。
// renew map bounds each time when new query comes
bounds = new google.maps.LatLngBounds ();
...
for (var key in data.locations ) {
...
// For fitting in Bounds, we push the positions of each location
atlas.Map.vars.bounds.extend ( new google.maps.LatLng(
data.locations [key].lat,
data.locations [key].lng
) );
...
}
...
GoogleMap.fitBounds (bounds);
不知何故,对于新的数据类型,它使浏览器堆栈溢出。
(非常奇怪的是,因为对于更大的结果它工作正常!(600< map 上的元素))。
为快速结果做了一个暴力代码:
bounds = new google.maps.LatLngBounds ();
if( KMLLayer.poly.docs[0].bounds != undefined ) {
bounds.extend( KMLLayer.poly.docs[0].bounds.getNorthEast() );
bounds.extend( KMLLayer.poly.docs[0].bounds.getSouthWest() );
}
if( KMLLayer.marks.docs[0].bounds != undefined ) {
bounds.extend( KMLLayer.marks.docs[0].bounds.getNorthEast() );
bounds.extend( KMLLayer.marks.docs[0].bounds.getSouthWest() );
}
GoogleMap.fitBounds (bounds);
我有两个 KML 图层,所以我从 GeoXML3 图层中检索了边界(如果有的话)。
妈的,我花了 6 小时 38 分钟!!!
也许我这条线错了,是什么严重清除了全局变量:
bounds = new google.maps.LatLngBounds ();
original name of variables are litle longer :) bounds === atlas.Map.vars.bounds;
关于javascript - 是什么导致 "Uncaught RangeError: Maximum call stack size exceeded"错误? (Chrome,在其他浏览器中其他消息),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12426208/