【问题标题】:Sencha Touch 2 app doesn't show google map on Samsung Galaxy AceSencha Touch 2 应用程序在三星 Galaxy Ace 上不显示谷歌地图
【发布时间】:2012-07-25 14:20:48
【问题描述】:

我编写了一个在地图上显示当前位置的应用程序。 问题是它适用于 Galaxy Tab 10.1、HTC Desire、Desire Z、Galaxy S 但是,当我使用 Samsung Galaxy Ace 或带有 Android 2.3.3 的模拟器时,它不起作用 - 只显示灰屏。

代码:

Ext.define('MyApp.view.WhereAmI', {
extend: 'Ext.Container',
xtype: 'whereAmI',

config: {
    layout: 'fit',
    scrollable: true,
    styleHtmlContent: true,
    style: 'text-align: center; background-color:white;',

    items: 
    [
        {
            xtype: 'toolbar',
            docked: 'top',
            title: 'Where am I?',
            items: [
                {
                    ui: 'back',
                    xtype: 'button',
                    id: 'back',
                    text: 'Back'
                }
            ]       
        },
        {
            xtype: 'mapview'
        }
    ]
}
});

地图视图:

Ext.define("MyApp.view.MapView", {
    extend: "Ext.Map",
    xtype: 'mapview',
    config: {
        useCurrentLocation: true,
        mapOptions:{
            zoom: 14,
        },
        listeners: {
            maprender : function(comp, map){
                new google.maps.Marker({
                    position: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude()),
                    map: map
                });                 
            },
        }
    },
})

当然还有 index.html:

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

有可能让它工作吗?

【问题讨论】:

    标签: google-maps google-maps-api-3 extjs sencha-touch-2 google-maps-markers


    【解决方案1】:

    我找到了解决办法。

    问题出在设备设置中。

    Settings -> Location and security -> My location -> Use wireless networks 
    

    在我的设备上未选中。勾选后即可使用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多