簡體   English   中英

Sencha Touch 2應用程序未在三星Galaxy Ace上顯示Google地圖

[英]Sencha Touch 2 app doesn't show google map on Samsung Galaxy Ace

我編寫了一個在地圖上顯示當前位置的應用程序。 問題是,當我在Android 2.3.3上使用Samsung Galaxy Ace或模擬器時,它可以在Galaxy Tab 10.1,HTC Desire,Desire Z,Galaxy S BUT上使用,但它不起作用-t僅顯示灰屏。

碼:

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>

有可能使其工作嗎?

我找到了解決方案。

問題出在設備設置中。

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

在我的設備上未選中。 選中后即可使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM