PDA

View Full Version : google map doesnt render completely on chrome and iPhone simulator



kulshreshtha.s
9 Aug 2011, 12:25 AM
Hi,

I'm developing an app using PhoneGap+ Sencha Touch. The google map screen doesn't completely render on chrome browser and xCode simulator. It shows gray area in more then 3/4th of the screen.

How can I fix this issue.



dealraiser.views.DealraiserMap = Ext.extend(Ext.Panel,{

fullscreen : true,
layout: 'fit',
id: 'mapNearby',

dockedItems: [{
xtype: 'toolbar',
title: 'Deals near you',
dock: 'top',
items: [{
xtype: 'button',
text: 'Home',
ui: 'Home',
handler: function(){
dealraiser.views.viewport.setActiveItem(dealraiser.views.dealraiserHome , 'slide');
}

}]
}],


store : dealraiser.stores.SDeals,
items: [{
xtype: 'map',
id: 'mapaNearby',

mapOptions : {
center : new google.maps.LatLng(35.489567, -80.856163),
//center : new google.maps.LatLng(lat, longt),
zoom : 15,
mapTypeId : google.maps.MapTypeId.ROADMAP,
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
}
},
listeners : {

delay: 1000,

'maprender' : function(comp, map){

var imageN = image;
var markersN = [];
var contentStrings = [];
infowindow = new google.maps.InfoWindow({
size: new google.maps.Size(150,50)

});
for(var i=0;i<mapNearbyPositions.length;i++){

var markerN = new google.maps.Marker({
position: mapNearbyPositions[i],
map: this.map,
icon : imageN,
id : mapNearbyID[i],
zIndex: Math.round(mapNearbyPositions[i][0]*-100000)<<5,
html : '<Div ><Span class=/"ginfowbox/">'+mapNearbyText[i]+'</Span><a onClick = "showNearbyDeal('+mapNearbyID[i]+','+i+')"><img src="images/arrow.png"></a></Div>'
});
markersN.push(markerN);
//get deal idmarkers[i].html+;
var thisDealID = markersN[i].id;
//google API for message
google.maps.event.addListener(markerN, 'click', function() {
infowindow.setContent(this.html);
infowindow.open(this.map, this);
});
}
}
}
}],


initComponent: function() {
dealraiser.views.DealraiserHome.superclass.initComponent.apply(this, arguments);
}
});

function showNearbyDeal(dealID, id){
//get deal object from store
dealNearbyInStore = id;
var oDealNearby= dealraiser.stores.SDealNearby.getAt(id);
dealraiser.views.dealDetail.updateWithRecord(oDealNearby);
var tpanel = dealraiser.views.dealDetail.getDockedItems();

//set Back button to search page
tpanel[0].items.item(0).setHandler( backNearbySearch);
dealraiser.views.viewport.setActiveItem(dealraiser.views.dealDetail , 'slide');
}


function backNearbySearch(){

dealraiser.views.viewport.setActiveItem(dealraiser.views.dealraiserMap , 'slide');
}

Thanks for the help in advance.