title: Sencha Touch - how to re-initialize a map view from a controller
body: <p>I would like to re-initialize my map view after a certain action performed in the controller.</p>
  
  <p>This is my mapview:</p>
  
  <pre><code>Ext.define("App.view.MapView", {
  extend: 'Ext.Container',
  requires: [
      'Ext.device.Geolocation',
      'Ext.MessageBox'
  ],
  xtype: 'mapview',
  
  constructor: function () {
      this.callParent(arguments);
      this.element.setVisibilityMode(Ext.Element.OFFSETS);
      this.on('painted', this.renderMap, this);
  },
  
  renderMap: function(){
          var me = this,
              lat = localStorage.getItem('latitude'),
              lng = localStorage.getItem('longitude'), 
              geo = [lat, lng];
  
          var map = L.map('map', {
              center: geo, 
              zoom: 13
          });
  
          var layer = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
              attribution: '&amp;copy; &lt;a href="http://osm.org/copyright"&gt;OpenStreetMap&lt;/a&gt; contributors'
          }).addTo(map);    
  
          var marker = L.marker(geo, {
              draggable: true,
              title: 'Your position'
          }).addTo(map);
  }
  });
  </code></pre>
  
  <p>How do I get and reset(re-initialize) my map view? I tried to make a reference to the mapview in the controller:</p>
  
  <pre><code>config: {
      refs: {
          mapCmp: 'mapview',
      },
  </code></pre>
  
  <p>And then called it like this:</p>
  
  <pre><code>this.getApplication().getMapCmp.reset();
  </code></pre>
  
  <p>But it didn't work - I got 'function is undefined'. Basically I need it to initialize again like when the app starts up.</p>
  
  <p>Please advise.</p>