1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    36
    Vote Rating
    0
    Answers
    2
    cooperka is on a distinguished road

      0  

    Default Answered: Google Map inside Ext.Sheet not displaying

    Answered: Google Map inside Ext.Sheet not displaying


    I modified this from the "overlays" example (http://dev.sencha.com/deploy/touch/e...ays/index.html) to include a Google map inside a Sheet rather than HTML inside a Panel. Apparently this is either not possible to do, or I am doing something wrong. If anyone could point me in the right direction I would appreciate it. My whole project file is also attached below.

    When you click the check-box it is supposed to display a Sheet with a Map inside it. Instead it displays a blank Sheet with nothing in it, just a big blue box. There are no errors in the console.

    Code:
    console.log("click");
    
    var position = new google.maps.LatLng(37.44885, -122.158592),  //Sencha HQ
    
    
        infowindow = new google.maps.InfoWindow({
            content: 'Sencha HQ'
        }),
        
        mapdemo = Ext.create('Ext.Map', {
            mapOptions : {
                center : new google.maps.LatLng(37.381592, -122.135672),  //nearby San Fran
                zoom : 12,
                mapTypeId : google.maps.MapTypeId.ROADMAP,
                navigationControl: true,
                navigationControlOptions: {
                    style: google.maps.NavigationControlStyle.DEFAULT
                }
            },
            
            listeners: {
                maprender: function(comp, map) {
                    var marker = new google.maps.Marker({
                        position: position,
                        title : 'Sencha HQ',
                        map: map
                    });
            
                    google.maps.event.addListener(marker, 'click', function() {
                        infowindow.open(map, marker);
                    });
            
                    setTimeout(function() {
                        map.panTo(position);
                    }, 1000);
                }
            }
        });
    
    
    overlay = Ext.Viewport.add({
        xtype: 'sheet',
        top: 50,
        height: '100%',
        width: '100%',
        hideOnMaskTap: true,
        items: [mapdemo]
    });
    
    
    console.log("created");
    Attached Files

  2. To get this to render, add a layout to your sheet. So adding that sheet to your viewport would look like:

    Code:
    overlay = Ext.Viewport.add({
        xtype: 'sheet',
        top: 50,
        layout: 'fit',
        height: '100%',
        width: '100%',
        hideOnMaskTap: true,
        items: [mapdemo]
    });
    Brice

  3. #2
    Sencha Premium Member bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    199
    Vote Rating
    27
    Answers
    18
    bricemason will become famous soon enough bricemason will become famous soon enough

      0  

    Default


    To get this to render, add a layout to your sheet. So adding that sheet to your viewport would look like:

    Code:
    overlay = Ext.Viewport.add({
        xtype: 'sheet',
        top: 50,
        layout: 'fit',
        height: '100%',
        width: '100%',
        hideOnMaskTap: true,
        items: [mapdemo]
    });
    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  4. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    36
    Vote Rating
    0
    Answers
    2
    cooperka is on a distinguished road

      0  

    Default


    That worked thank you!