0

現在地を地図上に表示するアプリを作成しました。問題は、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>

それを機能させることは可能ですか?

4

1 に答える 1

1

解決策を見つけました。

デバイスの設定に問題がありました。

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

私のデバイスではチェックされていませんでした。チェックを入れると動作します。

于 2012-07-26T11:40:07.773 に答える