Sencha Touch 2谷歌地图什么都不做

时间:2012-04-18 01:37:17

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

我有一个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
            }

我仍然一无所获。

有什么想法吗?

1 个答案:

答案 0 :(得分:3)

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

此外,没有必要(或可能导致错误)设置fullscreen: falselayout: 'auto',只需将其从地图配置中移除即可。

希望它有所帮助。

相关问题