Прослушиватель событий для centerchange
был лучшим решением, которое я нашел. И поскольку моя карта вообще не взаимодействует, мне кажется, это работает.
Вот код:
Ext.setup({
fullscreen: true,
tabletStartupScreen: 'splash.png',
phoneStartupScreen: 'splash.png',
icon: 'icon.png',
glossOnIcon: true,
onReady: function() {
var refreshMap = function(themap){
// It should clear all markers first, but that is not important right now since the map has all interaction disabled
var marker = new google.maps.Marker({
position: themap.center,
title : 'testing',
map: themap
});
}
var TopBar, Tabs, MapHome, Viewport, Homecard;
/*
* HOME
*/
MapHome = new Ext.Map({
title: 'Map',
useCurrentLocation: true,
listeners: {
centerchange : function(comp, map){
refreshMap(map);
}
},
mapOptions : {
mapTypeControl : false,
navigationControl : false,
streetViewControl : false,
backgroundColor: 'transparent',
disableDoubleClickZoom: true,
zoom: 17,
draggable: false,
keyboardShortcuts: false,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.HYBRID
}
});
Homecard = new Ext.Panel({
title: "home",
iconCls: "home",
items: [MapHome]
});
/*
* MAIN
*/
TopBar = new Ext.Toolbar({
dock: 'top',
xtype: "toolbar",
title: "<img class='titleLogo' src='css/images/logo.png' />",
items: [
{ xtype: 'spacer' },
{
iconCls: 'settings9',
iconMask: true,
text: 'options'
}
]
});
Tabs = new Ext.TabPanel({
id: 'tabs',
//fullscreen:true,
dock: 'bottom',
flex: 1,
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
items: [ Homecard, Nearbycard, Waypointscard, Shopcard, Searchcard]
});
Viewport = new Ext.Panel({
fullscreen:true,
layout:{type:'vbox',align: 'stretch'},
useLoadMask:true,
ui:'dark',
items: [TopBar,Tabs],
});
}
});