找不到导致该错误的原因,以及如何找到解决方案...
在 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/
类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc
我试图在一个项目中使用rake,如果我把所有东西都放到Rakefile中,它会很大并且很难读取/找到东西,所以我试着将每个命名空间放在lib/rake中它自己的文件中,我添加了这个到我的rake文件的顶部:Dir['#{File.dirname(__FILE__)}/lib/rake/*.rake'].map{|f|requiref}它加载文件没问题,但没有任务。我现在只有一个.rake文件作为测试,名为“servers.rake”,它看起来像这样:namespace:serverdotask:testdoputs"test"endend所以当我运行rakeserver:testid时
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
我有一个模型:classItem项目有一个属性“商店”基于存储的值,我希望Item对象对特定方法具有不同的行为。Rails中是否有针对此的通用设计模式?如果方法中没有大的if-else语句,这是如何干净利落地完成的? 最佳答案 通常通过Single-TableInheritance. 关于ruby-on-rails-Rails-子类化模型的设计模式是什么?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.co
大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje
我正在寻找执行以下操作的正确语法(在Perl、Shell或Ruby中):#variabletoaccessthedatalinesappendedasafileEND_OF_SCRIPT_MARKERrawdatastartshereanditcontinues. 最佳答案 Perl用__DATA__做这个:#!/usr/bin/perlusestrict;usewarnings;while(){print;}__DATA__Texttoprintgoeshere 关于ruby-如何将脚
我正在使用的第三方API的文档状态:"[O]urAPIonlyacceptspaddedBase64encodedstrings."什么是“填充的Base64编码字符串”以及如何在Ruby中生成它们。下面的代码是我第一次尝试创建转换为Base64的JSON格式数据。xa=Base64.encode64(a.to_json) 最佳答案 他们说的padding其实就是Base64本身的一部分。它是末尾的“=”和“==”。Base64将3个字节的数据包编码为4个编码字符。所以如果你的输入数据有长度n和n%3=1=>"=="末尾用于填充n%
我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i
为什么4.1%2返回0.0999999999999996?但是4.2%2==0.2。 最佳答案 参见此处:WhatEveryProgrammerShouldKnowAboutFloating-PointArithmetic实数是无限的。计算机使用的位数有限(今天是32位、64位)。因此计算机进行的浮点运算不能代表所有的实数。0.1是这些数字之一。请注意,这不是与Ruby相关的问题,而是与所有编程语言相关的问题,因为它来自计算机表示实数的方式。 关于ruby-为什么4.1%2使用Ruby返