Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3994 in a recent build.
  1. #1
    Sencha User Ola GP's Avatar
    Join Date
    Jan 2013
    Location
    Sweden
    Posts
    28
    Vote Rating
    2
    Ola GP is on a distinguished road

      0  

    Default Sencha Touch 2.1.1 - problem with maprender event

    Sencha Touch 2.1.1 - problem with maprender event


    After updating to Sencha Touch 2.1.1 from 2.1.0 I'm experiencing some problems with Ext.Map.

    The problem:
    When the map is rendered I want to center the map to a specific location (based on user input). Problem is, the setMapCenter function does nothing when placed within the maprender event. Code example:
    Code:
    maprender: function(me, map) {                                            
          me.setMapCenter({ latitude: myNewLatitude, longitude: myNewLongitude });
    }
    Workaround:
    To get around this, I have to place the setMapCenter function inside a setTimeout (10ms).

    Code:
    maprender: function(me, map) {                    
       setTimeout(function(){                            
          me.setMapCenter({ latitude: myNewLatitude, longitude: myNewLongitude });
       }, 10);
    }

    It seems that the maprender event is fired before the map actually is ready. I don't recall this problem in Sencha Touch 2.1.0. I wonder if this has something to do with this bug fix I see in the release notes for 2.1.1?

    "Fixed Map creation being attempted prior to paint event. The resize event was then fired and causing an odd offset from google"

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

Thread Participants: 1

Tags for this Thread