Google地图不会首次初始化 [英] Google maps does not initialize first time

查看:136
本文介绍了Google地图不会首次初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我给谷歌地图
的链接页面,当我点击地图链接它打开页面,但不初始化谷歌地图。但当我刷新页面时,初始化页面
您可以点击页脚中的地图链接



它会打开该页面,但不初始化Google地图,但如果刷新页面,它将初始化
我应该怎么做才能发现问题?我不是很熟悉jquery-mobile,但我想当一个页面通过AJAX加载(并且页面将会在这种情况下,当你点击按钮时,通过AJAX加载),只有< data-role =page的div内容才会加载到页面中。 / p>

您的脚本(尤其是初始化映射的脚本)目前不在此div内,因此它们不会被加载或执行。


i gave link page with google maps when i clicked map link it opens page but does not initialize google maps.But when i refresh page it initialize page you can click map link in the footer

it will open that page but without initialize google maps but if you refresh page it will initialize what should i do to find problem?

解决方案

I'm not very familiar with jquery-mobile, but I guess that when a page is loaded via AJAX(and the page will be loaded via AJAX in this case, when you click the button), only the content of the div with data-role="page" will be loaded into the page.

Your scripts(especially the one that initializes the map) currently are not located inside this div, therefore they will not be loaded or executed.

这篇关于Google地图不会首次初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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