【问题标题】:Sencha Touch 2 Google Map does nothingSencha Touch 2 谷歌地图什么都不做
【发布时间】:2012-04-18 01:37:16
【问题描述】:

我有一个 sencha touch 1 应用程序,我刚刚升级到 sencha touch 2,除了谷歌地图之外,我什么都可以使用。

在 ST1 中,我在 index.html 中添加了这一行:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

然后我将其添加到面板中:

            {
                xtype: 'map',
                useCurrentLocation: false,
                fullscreen: false,
                layout: 'auto',
                id: 'jobmap',
                height: 400,
                mapOptions: {
                    zoom: 12,
                    navigationControl: true,
                    navigationControlOptions: 
                    {
                        style: google.maps.NavigationControlStyle.DEFAULT
                    }
                }                    
            }

在 ST2 中,文档说仍然添加对 index.html 的引用,尽管他们的论坛似乎也说使用 app.json。我已经尝试使用上面的代码并且面板上没有任何内容。它之前和之后的控件彼此相邻。

我什至刚刚尝试过:

         {
                xtype: 'map',
                useCurrentLocation: true
            }

我仍然一无所获。

有什么想法吗?

【问题讨论】:

标签: google-maps sencha-touch sencha-touch-2


【解决方案1】:

包含您的地图的面板应设置为layout: 'card'。

另外,没有必要(或可能导致错误)设置fullscreen: false 或layout: 'auto',只需将它们从您的地图配置中删除即可。

希望对你有帮助。

【讨论】:

  • 谢谢! ST很棒,但也有很多小问题:)
  • 这是很棒的信息,在 Sencha 的文档中应该非常明显。可惜不是。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多