Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: maprender event's 2nd argument is undefined

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-4269 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    148

    Default maprender event's 2nd argument is undefined

    Just downloaded to test ST 2.2.0-rc.

    Using Ext.Map, the maprender(comp, gmap) event has two arguments, the first being the map component, and the second being the google map.

    Code:
    maprender: function(comp, gmap) {
      console.log(gmap);
    }
    The console log says: undefined. Using it with ST 2.1.1 it prints the google map object.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Ext JS Premium Member christocracy's Avatar
    Join Date
    Oct 2006
    Location
    Montreal
    Posts
    381

    Default NOT fixed

    This one slipped through the cracks of your RC -- Still broken.

    Ext.Map
    Code:
           // @private
    	onTilesLoaded: function() {
    		this.fireEvent('maprender', this, this.map);  //< --- use getter this.getMap() or this._map
    	},
    /**
    * @author Chris Scott
    * @business www.transistorsoft.com
    * @rate $150USD / hr; training $500USD / day / developer (5 dev min)
    *
    * @SenchaDevs http://senchadevs.com/developers/transistor-software
    * @twitter http://twitter.com/#!/christocracy
    * @github https://github.com/christocracy
    */

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    148

    Default

    I reported it for 2.2.0-RC. The download is still the same, so no new RC provided since. The "Fixed" might be an indication that it will be included in the release following 2.2.0-RC.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    10

    Default

    map doesn't load in final release when
    useCurrentLocation = true is added. Is there some kind of temporary workaround for it?

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    10

    Default

    My Mistake. I needed to do a reboot of my device (Galaxy S3). Everything working now

  7. #7
    Sencha User
    Join Date
    Dec 2012
    Posts
    77

    Default

    This was still an issue for me on both iOS and Android after upgrading to Sencha Touch 2.2. The Google map component was undefined. Here's the patch that I applied to fix it. I simply assigned the map via the getter to the gMapComponent. This worked for both iOS and Android.

    Code:
    listeners: {
                        maprender: function(extMapComponent, googleMapComp) {
                            googleMapComp = extMapComponent.getMap();
                            var theView = Ext.ComponentQuery.query('retailerMap')[0];
                            var lat = theView.config.data.retailer_latitude;
                            var lng = theView.config.data.retailer_longitude;
                            extMapComponent.setMapCenter({latitude: lat, longitude: lng});
                            var marker = new google.maps.Marker({
                                position: position = new google.maps.LatLng (lat,lng),
                                map: googleMapComp,
                            });
                        }
                    }

  8. #8
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    150

    Default

    Not fixed in 2.2.1 either.
    -David

  9. #9
    Sencha User
    Join Date
    May 2010
    Posts
    151

    Default

    Quote Originally Posted by azamatoak View Post
    This was still an issue for me on both iOS and Android after upgrading to Sencha Touch 2.2. The Google map component was undefined. Here's the patch that I applied to fix it. I simply assigned the map via the getter to the gMapComponent. This worked for both iOS and Android.

    Code:
    listeners: {
                        maprender: function(extMapComponent, googleMapComp) {
                            googleMapComp = extMapComponent.getMap();
                            var theView = Ext.ComponentQuery.query('retailerMap')[0];
                            var lat = theView.config.data.retailer_latitude;
                            var lng = theView.config.data.retailer_longitude;
                            extMapComponent.setMapCenter({latitude: lat, longitude: lng});
                            var marker = new google.maps.Marker({
                                position: position = new google.maps.LatLng (lat,lng),
                                map: googleMapComp,
                            });
                        }
                    }
    Thank you!

  10. #10
    Sencha User
    Join Date
    Mar 2013
    Posts
    32

    Default

    Any sign of this fix being in the next release? I did a quick search for 'Touch-4269' in the Release Notes but couldn't see it mentioned.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •