View Full Version : [FIXED] LIsten map events inside a controller

5 Nov 2011, 6:03 AM
Hello, I can't be able to listen for the maprender event using the control() method inside a controller. It works for other events but not for the maprender. On the other side, if I listen for the event in the map object itself it works.

This is the code that doesn't work:

Ext.define('Test.controller.MainController', {
extend: 'Ext.app.Controller',

init: function() {
console.log('init controller');

'map': {
maprender: function() {
console.log('the map render');

name: 'Test',
controllers: ['MainController'],

launch: function() {

Ext.create('Ext.Container', {
layout: 'card',
fullscreen: true,
items: [{
xtype: 'map',

Im using chrome to testing with Sencha Touch 2.0.0 Preview Release 1

Anybody have the same issue?


5 Nov 2011, 8:47 PM
This is a bug with the Map component. The maprender event gets called when the component is constructed, which is incorrect. This also means that it gets called immediately, which is too late for the .control method in your controller.

6 Nov 2011, 5:03 AM
Ok, by now I can get it working using the activate event instead.

Jamie Avins
29 Nov 2011, 12:00 PM
This issue has been resolved for the next release.