谷歌地图第二次没有加载 - AngularJS [英] Google Maps doesn't load the 2nd time - AngularJS
问题描述
我正在使用 GoogleMap API('angular-google-maps' js 包)并且我有一个非常奇怪的行为.
I'm using the GoogleMap API ('angular-google-maps' js package) and I have a very weird behavior.
我第一次加载它时,我加载了完整的地图,如下所示:
The first time I load it, i get the full map loaded, like here:
然后我关闭对话框并重新打开它,我看到:
Then i close the dialog and reopen it, i see this:
请记住,地图显示为另一个对话框之上的对话框.
Keep in mind, that the map is displayed as a dialog on top of another dialog.
有什么想法吗?
推荐答案
如果您使用的是 Angular Google Map 模块,则必须将 refresh 属性添加到 googlemap 元素.
If you are using Angular Google Map module you must add the refresh attribute to the googlemap element.
正如模块文档中所写:
refresh = "expression" - 表达式,如果计算结果为真,将触发地图刷新.当地图最初隐藏时很有用.
refresh = "expression" - Expression which, if it evaluates to true, will trigger a map refresh. Useful when the map is initially hidden.
这篇关于谷歌地图第二次没有加载 - AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!