-
24 Sep 2012 6:33 AM #1
Unanswered: Add a Map in a Tab Panel
Unanswered: Add a Map in a Tab Panel
Hi,
how can I add a Map in a Tab Panel?
Here is my code:
I need to insert a Map with markers in the second tab of my Panel.Code:Ext.create("Ext.tab.Panel", { fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'Home', iconCls: 'home', cls: 'home', scrollable: true, html: [ '<center><br>Welcome!</center>' ].join("") }, { title: 'Map', iconCls: 'maps', scrollable: true, html: [ '<center><br>Map here...<br></center>' ].join("") }, { xtype: 'nestedlist', title: 'Steps', iconCls: 'star', displayField: 'title', store: { type: 'tree', fields: [ 'title', 'content', {name: 'leaf', defaultValue: true} ], root: { leaf: false }, proxy: { type: 'ajax', url: 'steps.json', reader: { type: 'json', rootProperty: 'steps' } } }, detailCard: { xtype: 'panel', scrollable: true, styleHtmlContent: true }, listeners: { itemtap: function(nestedList, list, index, element, post) { this.getDetailCard().setHtml(post.get('content')); } } } ] });
Thanks in advance!
-
24 Sep 2012 8:23 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
- Answers
- 83
use the map component there. There is an example showing you how to do it.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
24 Sep 2012 1:23 PM #3
Thanks, but... where can I find the example?
I have found just this one: http://docs.sencha.com/touch/2-0/#!/example/maps
-
25 Sep 2012 12:21 AM #4
If I do this:
I receive this error from the console:Code:Ext.create("Ext.tab.Panel", { //layout: 'card', fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'Home', iconCls: 'home', cls: 'home', scrollable: true, html: [ '<center><br>Welcome<br></center>' ].join("") }, { xtype: 'map', useCurrentLocation: true } ] });
Uncaught Error: [ERROR][Ext.Container#doAdd] Adding a card to a tab container without specifying any tab configuration
Edit:
adding "title" and "iconCls" I have no errors, but I have a blank area instead of the map...
Here my code:
Code:Ext.create("Ext.tab.Panel", { layout: 'card', fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'Home', iconCls: 'home', cls: 'home', scrollable: true, html: [ '<center><br>Welcome<br></center>' ].join("") }, { title: 'Map', iconCls: 'maps', xtype: 'map', useCurrentLocation: true } ] });


Reply With Quote