Google 地图未在使用 Jquery Mobile 加载后续页面时呈现(在 Rails 中)
我正在创建我的网站的移动版本,用 ruby on Rails 编码。我使用 Cartographer 插件生成谷歌地图,并且使用 JQuery mobile。在我的网站的第一页上,有一个正确显示的谷歌地图。 当我浏览网站并返回主页时,地图不显示。我做了一些研究,我认为这是因为渲染地图的 javascript 事件没有触发。我发现这篇文章说“页面更改事件是 pageshow”,但我不知道如何修改我的代码以反映这一点。 根据此页面,我正在页面标题中加载谷歌地图js。 帮助?
I'm creating a mobile version of my site, coded in ruby on rails. I use the Cartographer plugin to generate google maps, and I'm using JQuery mobile. On the first page of my site, there is a google map which shows properly.
When I navigate through the site and back to the home page, the map does not show. I've done some research and I think it's because the javascript event that renders the map isn't firing. I found this post that says "The page change event is pageshow" but I have no idea how to modify my code to reflect that.
As per this page, I am loading the google maps js in the page header.
Help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是一个迟到的响应,但它与页面之间导航时的页面转换有关。以下文章可能会更详细地说明如何解决该问题:http: //comdynamics.net/blog/468/jquery-mobile-with-google-maps/
I know this is a late response but it is to do with page transitions when navigating between pages. The following article may shed more light on how to solve the problem: http://comdynamics.net/blog/468/jquery-mobile-with-google-maps/