在sencha touch中使用谷歌地图

时间:2012-11-20 06:57:03

标签: map sencha-touch-2

您好我在sencha touch 2中遇到Google地图的问题。以下是代码..

                    new Ext.application({
                    name:'Touch Start',
                launch:function(){
            var map = new Ext.Panel({
         fulscreen:true,
         items:[
         {
        xtype:'map',
        useCurrentLocation:true,

        }
 ]

         });
    this.viewport = map;
     }
  });

请帮助任何人都知道这个

1 个答案:

答案 0 :(得分:2)

首先,在您的问题关闭之前,您并没有完全告诉我们您的代码存在什么问题。所以,我想你可能会遇到两个不同的问题

需要使用Google Maps API

请务必添加加载Google Maps API的脚本标记。 You can find infos here

无布局

您的主面板不包含任何布局,因此它不知道如何显示其项目

尝试将其添加到配置中:

layout: 'fit'

以下是一个工作示例,其中异步加载Google Maps API:

http://www.senchafiddle.com/#MhAME

希望这有帮助

相关问题