Google Map API v3 - 超出最大调用堆栈大小 [英] Google Map API v3 - Maximum call stack size exceeded

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

问题描述

在过去的5到6周里,我一直在开发一个 JS小部件。这个想法是,它可以通过简单地将href添加到远程.js文件以及具有给定ID的DIV容器来包含widget的内容来添加到任何站点。



小部件广泛使用Google Map API,我正在如下引用它:

.googleapis.com / maps / api / js?v = 3.exp& libraries = geometry,places& callback = initializeGoogleMaps

加载小部件时,它会要求用户检查其位置,然后执行其他操作,只需对该位置进行地理编码,以便可以在地图上绘制标记。



一切都一直很完美,我必须在开发过程中测试超过2000个搜索。



我昨天部署了这个小部件,成功将其嵌入到主机网站中 - 一切工作都像以往一样完美。然而,今天早上,我的小工具正在使用 Chrome的控制台报告:

 未捕获的RangeError:Maximum调用堆栈大小超过{main,geometry,places} .js:27(匿名函数)VM530:33 cVM530:33 TT。(匿名函数).fitBounds {main,geometry,places} .js:48 ,geometry,places} .js:26 Uf {main,geometry,places} .js:48 O.fitBoundsWRAPPostcodeLocator.js:1541 setupPageWRAPPostcodeLocator.js:964 jQuery.ajax.successjquery.js?time = 95944:3 jjquery.js? time = 95944:3 k.fireWithjquery.js?time = 95944:12 xjquery.js?time = 95944:12 b.onload.b.onreadystatechange 

由于小部件上次工作,没有对我的代码或主机进行更改,所以我怀疑Google API出了问题。



嵌入到虚拟主机中的小部件示例可以在以下位置看到:

  http://pcl.solsticecloud .co.uk 

花了几个小时试图克服等到底部时,我仍然不聪明。



任何帮助或建议都会被赞赏。



预先感谢您,

Matt

解决方案

感谢Matt Alexander,这正是问题和解决方案,但Google似乎再次改变了位置属性的名称,而不再是 .k .D ,现在它的 .A .F !,看看下面的控制台日志:


I have been developing a JS widget for the last 5 or 6 weeks. The idea is that it can be added to any site by simply adding a href to the remote .js file and also a DIV container with a given ID to contain the contents of the widget.

The widget makes extensive use of Google Map API and I am referencing it as follows:

https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,places&callback=initializeGoogleMaps

When the widget is loaded, it will ask the user permission to check their location and then perform, amongst other operations, a simply geocoding for the location so that a marker can be plotted on the map.

Everything has been working perfectly and I must've tested the searching over 2,000 during development.

I deployed the widget yesterday and successfully embedded it into a host website - everything worked as perfectly as it always has done. This morning, however, my widget is falling over with Chrome's console reporting:

Uncaught RangeError: Maximum call stack size exceeded{main,geometry,places}.js:27 (anonymous function)VM530:33 cVM530:33 TT.(anonymous function).fitBounds{main,geometry,places}.js:48 (anonymous function){main,geometry,places}.js:26 Uf{main,geometry,places}.js:48 O.fitBoundsWRAPPostcodeLocator.js:1541 setupPageWRAPPostcodeLocator.js:964 jQuery.ajax.successjquery.js?time=95944:3 jjquery.js?time=95944:3 k.fireWithjquery.js?time=95944:12 xjquery.js?time=95944:12 b.onload.b.onreadystatechange

Since the widget last worked, no changes have been made to my code or the host, so I suspect something wrong with the Google API.

An example of my widget embedded into a dummy host can be seen at:

http://pcl.solsticecloud.co.uk

Having spent several hours trying to get to the bottom of this, I'm still non the wiser.

Any help or advice would be so much appreciated.

Thank you in advance,

Matt

解决方案

Thanks Matt Alexander this was exactly the problem and the solution, however it seems that Google changed the names of the Location properties AGAIN, not .k and .D anymore, now its .A and .F!, take a look at the following console log:

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

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