-
13 Feb 2013 5:07 AM #1
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:
Workaround:Code:maprender: function(me, map) { me.setMapCenter({ latitude: myNewLatitude, longitude: myNewLongitude }); }
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"
-
13 Feb 2013 6:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
Thanks for the report! I have opened a bug in our bug tracker.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3994
in
Sprint 31.


Reply With Quote