PDA

View Full Version : Ext.Map shown is not completed



NitrOuS
29 Nov 2010, 4:34 AM
I have a panel in a tabPanel in order to show a map. The first time the tabPanel is shown it's OK. When I go back to my previous screen and then to tabPanel again it's is shown partially. In order to show the new Map I clear the Panel in order to place the new map and after some time of application inactivity no map is shown at all and the map appears after some time (I didn't count how much time). Moreover, while testing my app to my iPhone, I figured out that when I change the orientation of the screen while the map is shown I can then see the full map. The Here is the code I use:


MyNameSpace.cinemasDetailsPanel = new Ext.TabPanel({
id: 'CinemasDetails',
dockedItems: cinemaDetailsToolbar,
ui: 'dark',
sortable: true,

items: [MyNameSpace.mapInfo],
listeners: {
show: function ()
{
DemoEthniki.cinemasDetailsPanel.setActiveItem(0);
DemoEthniki.cinemasDetailsPanel.doComponentLayout();
},
beforeshow: load
},
tabBar: {
dock: 'bottom',
ui: 'dark',
layout: {
pack: 'center'
}
}
});

function load()
{
if (typeof (Ext.getCmp('cinemaMap')) != 'undefined')
{
MyNameSpace.mapInfo.removeAll(true);
}

Ext.getCmp('CinemasDetails').update('');
MyNameSpace.mapInfo.doComponentLayout();
MyNameSpace.cinemasDetailsPanel.doComponentLayout();

if (MyNameSpace.Main.cinemaId === 1)
{
var CinemaPosition1 = new google.maps.LatLng(38.044644, 23.791366);

var cinemaMap1 = new Ext.Map({
id: 'cinemaMap',
iconCls: 'locate',
mapOptions: {
zoom: 15,
center: CinemaPosition1
}
});

MyNameSpace.mapInfo.add(cinemaMap1);
MyNameSpace.mapInfo.doComponentLayout();
MyNameSpace.cinemasDetailsPanel.doComponentLayout();
}
else
{
var CinemaPosition2 = new google.maps.LatLng(37.98616, 23.761282);

var cinemaMap2 = new Ext.Map({
id: 'cinemaMap',
iconCls: 'locate',
mapOptions: {
zoom: 15,
center: CinemaPosition2
}
});
MyNameSpace.mapInfo.add(cinemaMap2);
MyNameSpace.mapInfo.doComponentLayout();
MyNameSpace.cinemasDetailsPanel.doComponentLayout();
}
}


Instead of
MyNameSpace.mapInfo.removeAll(true); I have also used
MyNameSpace.mapInfo.remove(Ext.getCmp('cinemaMap'), true); with the same result. What should I use instead of these? Any ideas?

Then I have another problem. The markers I put in my map (not with code shown exactly but with some additions). When I try to run the app in my pc I get the warning: "Resource interpreted as image but transferred with MIME type text/html."
Thanks for your time.....

Thanks for time.

xnakxx
29 Dec 2010, 11:10 AM
I too am having this problem. have you had any luck?

NitrOuS
29 Dec 2010, 12:07 PM
I don't have the code in front of me right now but try to play with the fullscreen:true property of map. I think that setting this will get it to work.

chandramuralis
7 Mar 2011, 1:43 PM
I agree with NitrOuS, I did the same thing by setting fullscreen:true and it worked after that.