0
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', '../ux');
Ext.require([
    'Ext.window.*',
    'Ext.ux.GMapPanel'
]);

Ext.onReady(function() {
    var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
        myMask.show();

        var layout = Ext.create('Ext.panel.Panel', {
            //renderTo: 'layout',
            width: window.innerWidth,
            height: window.innerHeight,
            //title: 'Border Layout', //no title will be blank
            layout: 'border',
            items: [{
                title: 'Message List',
                region: 'south',     // position for region
                xtype: 'panel',
                height: 100,
                split: true,         // enable resizing
                collapsible: true,
                margins: '0 5 5 5',
                collapsed: true
            },{
                //title: 'Map',
                region: 'center',    
                xtype: 'gmappanel',
                center: {geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',marker: {title: 'Fenway Park'}}
            }],
            renderTo: Ext.getBody() //get the body and display Layout at there
        }); 
        myMask.hide();
});

问题

  1. 为什么无法加载 gmappanel?

  2. 我试图显示加载掩码,当页面完成加载时只删除加载掩码?怎么做?

4

1 回答 1

0
region: 'center',     // center region is required, no width/height specified
                xtype: 'gmappanel',
                id : 'mygooglemap',
                mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
                mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],   
                zoomLevel: 2,
                gmapType: 'map',
                center: {geoCodeAddr: 'Malaysia'}

试试这个代码是否适用于你。

于 2013-02-19T08:22:26.720 回答