简体   繁体   English

自定义标记点击后,Google Maps JS API会间歇性地使进程崩溃

[英]Google Maps JS API intermittently crashes process on custom marker click

I'm afraid the product I'm working on is so inherently full of esoteric client-sensitive stuff that I can't meaningfully reduce the problem scenario to a reproductible example, so this is appealing to domain expertise and insight, based on the following code: 恐怕我正在开发的产品本来就充满了对客户敏感的东西,以至于我无法将问题场景有效地简化为可复制的示例,因此,基于以下内容,这吸引了领域的专业知识和见识码:

http://jsbin.com/barney/1/edit http://jsbin.com/barney/1/edit

(makes use of jQuery, Underscore, Mustache, a few plugins and of course Google Maps v3 JS API) (利用jQuery,Underscore,Mustache,一些插件,当然还有Google Maps v3 JS API)

I am using the Google Maps JS API to produce a relatively simple web app. 我正在使用Google Maps JS API生成相对简单的Web应用程序。 So far all it does is create a custom content InfoWindow , dynamically changing the content as and when users click on custom MarkerImage s. 到目前为止,它所做的只是创建一个自定义内容InfoWindow ,并在用户单击自定义MarkerImage时动态更改内容。 The map is desaturated by use of stylers. 通过使用样式器使地图饱和。

Intermittently (can't reliably reproduce) the process will completely freeze when I click one of these custom markers. 当我单击这些自定义标记之一时,该过程将间歇性地(无法可靠地复制)完全冻结。 I have a breakpoint on the first line of my code immediately within the event.addListener – the first time my code is hit in the usual stack of things – but the process never gets there: everything is frozen by the time I get there. 我在event.addListener内的代码的第一行上立即有一个断点–第一次在常规堆栈中命中我的代码–但是该过程从未到达那里:到到达那里时,一切都被冻结了。

4 marker clicks usually does the trick, but other times the application will run through the entire UX without a fuss. 通常,单击4次标记就可以解决问题,但有时应用程序将在整个UX中运行,而不必大惊小怪。

Additional info, off the top of my head: 其他信息,我的脑海:

  • I have a couple of jQuery click events delegated to the body (not that these are firing in the observable stack); 我有几个委托给主体的jQuery click事件(不是这些事件在可观察的堆栈中触发);
  • Left alone for 5 minutes or so, this app will freeze anyway, so I suspect I am unwittingly silently abusing the Maps API anyway. 单独放置5分钟左右,此应用将始终冻结,因此我怀疑我仍然无意间无意地滥用了Maps API。

Any advice on gotchas for this kind of scenario would be really appreciated. 对于这种情况下有关陷阱的任何建议,将不胜感激。

All of the above issues were resolved by removing CSS3 transitions from an ancestor element of the Google Maps DOM structure, which makes use of translate3d(0) as a hack to force GPU-accelerated animation. 通过从Google Maps DOM结构的祖先元素中删除CSS3过渡,解决了上述所有问题,该过渡利用了translate3d(0)作为一种黑客手段来强制GPU加速动画。 Bizarre but true. 奇怪但真实。 Tidbits of anecdotal evidence from apparently unrelated performance issues in Webkit reveal that applying transition s to translate3d 'd has all sorts of uncaught memory leak issues. 来自Webkit中似乎不相关的性能问题的轶事 证据表明,将transition应用于translate3d存在各种未解决的内存泄漏问题。 Odd, considering conventional wisdom has it that applying translate3d to transitions is a way of relieving CPU performance hogging! 奇怪的是,考虑到传统观点,将translate3d应用于过渡是减轻CPU性能负担的一种方式!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM