Hi, Now it is working.
Thanks. On Jan 26, 11:40 am, STV <[email protected]> wrote: > Hi, > > I am creating a custom MapPanel and trying to add toolbar buttons in > this component. The parent class of my component is GMapPanel, which > extended from Ext.Panel. > And I am trying to call the method getTopToolbar() from my component. > But it is giving an error says "getTopToolbar() is not a function". > Following are the code. Please help me to solve this issue. > > Ext.namespace('Ext.ux'); > > Ext.ux.MapPanel = function(config) { > Ext.ux.MapPanel.superclass.constructor.call(this, config); > > }; > > // extend > Ext.extend(Ext.ux.MapPanel, Ext.ux.GMapPanel, { > > initComponent : function(){ > > var defConfig = { > gmapType: 'map' > ,zoomLevel: 7 > ,mapConfOpts: > > ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'] > ,mapControls: > ['GSmallMapControl','GMapTypeControl','NonExistantControl'] > ,setCenter: { > lng: -89.33, > lat: 43.13 > } > ,tbar: [{ > xtype: 'tbbutton' > ,text: 'Traffic' > ,handler: function(button, event){ > button.panel.addTraffic(); > } > }, > '-', > { > xtype: 'tbbutton' > ,text: 'Radar' > }, > '- > ] > }; > > tbar = Ext.ux.MapPanel.getTopToolbar(); > tbar[0].panel = Ext.ux.MapPanel; > tbar[2].panel = Ext.ux.MapPanel; > > this.addMapControls(); > > Ext.applyIf(this,defConfig); > > Ext.ux.MapPanel.superclass.initComponent.call(this); > > } > > }); > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
