Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member cnelissen's Avatar
    Join Date
    Sep 2007
    Location
    California
    Posts
    224
    Vote Rating
    7
    cnelissen is on a distinguished road

      0  

    Default [FIXED-207] Ext.Map: wrapped map unavailable in afterRender

    [FIXED-207] Ext.Map: wrapped map unavailable in afterRender


    There are currently some deficiencies with the Map component, specifically there is no way to know when/if the map (the wrapped map) is currently rendered and available. For instance, if you execute the following code, you will see that the map is still unavailable in the afterRender event. It should seem that afterRender would be the last stop for the component and everything should be rendered and available.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Map Test</title>
    
    <link rel="stylesheet" type="text/css" href="../../resources/css/ext-touch-debug.css" />
    <script type="text/javascript" src="../../ext-touch-debug.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript">
    Ext.setup({
    	onReady: function() {
            new Ext.Map({
    			listeners: {
    				'afterRender': function() {
    					//console.log(this);
    					console.log(this.map);
    				}
    			}
            }).show();
    	}
    });
    </script>
    </head>
    
    <body>
    </body>
    </html>
    This causes problems with things such as adding markers to a map if the component is not rendered at runtime. I think either the map needs to be made available sooner, such as in the 'render' method, or we need a separate event such as 'mapRendered' to start adding markers and such.

    Thoughts?
    - Clint Nelissen

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,017
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    In 0.94 there is a new maprender event that fires when the map is ready for use.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Similar Threads

  1. ad getLocation to map causes the map not to load
    By ice70 in forum Sencha Touch 1.x: Discussion
    Replies: 5
    Last Post: 23 Aug 2010, 8:13 AM
  2. [FIXED-41] 0.82 Map example --- very jittery
    By jay@moduscreate.com in forum Sencha Touch 1.x: Bugs
    Replies: 5
    Last Post: 10 Jun 2010, 12:08 PM
  3. Replies: 22
    Last Post: 10 Jul 2009, 2:08 PM
  4. Ext Road Map
    By brian.moeskau in forum Community Discussion
    Replies: 63
    Last Post: 12 Mar 2009, 1:09 PM
  5. [FIXED] [gxt 1.1] BaseModel map equals() doesn't work anymore
    By AlexPdro in forum Ext GWT: Bugs (1.x)
    Replies: 2
    Last Post: 28 Aug 2008, 8:49 AM

Thread Participants: 2