-
28 Feb 2011 5:25 PM #1
Ext.Map -- Not Changing Orientation When Hidden-Why?
Ext.Map -- Not Changing Orientation When Hidden-Why?
All,
My Question: How can I force the Ext.Map to redraw itself when the orientation is changed and the Ext.Map is not visible?
I have a sencha-touch app that consists of a viewport panel with a card layout that contains all of the panels of my application. One of the panels contains an Ext.Map component. The problem I have is that the map gets screwed up when the orientation of the phone is changed--it stays in profile mode when the orientation switches to landscape and vice versa. This problem goes away if I change the orientation while the Ext.Map is the active item of my viewport panel.
Thanks!
-
1 Mar 2011 6:42 AM #2
I've tried to workaround this by implementing the setProfile() method of the Ext.Map 's containing Panel, but it still isn't working. Here's my implementation:
The funny thing is that the this.mapPanel.isVisible() always returns true regardless of whether it is or isn't visible. That aside, if I always set the function call to execute regardless of the isVisible() call, it _still_ doesn't redraw the Ext.Map. The only thing that causes the Ext.Map to redraw is when the phone's orientation is changed _while_ the map is visible.Code:setProfile: function(profile) { log.debug("map visible? " + this.mapPanel.isVisible()); //<-- this.MapPanel is an Ext.Map instance if (! this.mapPanel.isVisible()) { log.debug("map not visible. setting do layout call when shown"); this.on('show', this.mapPanel.doComponentLayout, this.mapPanel, {single:true}); } },
Odd, indeed.
-
5 Aug 2011 10:41 AM #3
What I do is on the activate listener to the map panel I call:
google.maps.event.trigger(Map.map, 'resize');
The resize will handle any potential orientation changes that happened while you were not on the map display.
Casey
Similar Threads
-
changing scroll direction on orientation change
By Frances in forum Sencha Touch 1.x: DiscussionReplies: 0Last Post: 16 Feb 2011, 2:59 PM -
[OPEN-679] Incorrect TabBar rendering when changing active item in hidden TabPanel
By Yazla in forum Sencha Touch 1.x: BugsReplies: 2Last Post: 20 Dec 2010, 4:23 AM -
[FIXED-129][Ext 3.0.3] Form upload: hidden iframe not hidden in FF
By Stefan B in forum Ext 3.x: BugsReplies: 3Last Post: 9 Jan 2010, 7:33 AM -
How To Make Hidden Columns Permanently Hidden ??
By chalu in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 11 Sep 2008, 12:57 PM -
Changing the hidden property of the panel cause width problem
By emredagli in forum Ext 2.x: Help & DiscussionReplies: 10Last Post: 13 Jul 2008, 9:17 AM


Reply With Quote