-
16 Apr 2012 4:17 AM #1
Answered: Map inside of NavigationView isn't centered correctly
Answered: Map inside of NavigationView isn't centered correctly
Hello,
i am trying to put a Ext.Map as item into a NavigationView. My Problem is that neither the zoom-option nor the map.center are set correctly
Code:Ext.define('myapp.view.Map', { extend: 'Ext.navigation.View', xtype: 'mappanel', config: { title: 'A Map', iconCls: 'map', items: { title: 'The Map', xtype: 'map', id: 'gmap', config: { mapOptions: { center: new google.maps.LatLng(52.3934598, 13.1298635), zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP }, }, } }, });
-
Best Answer Posted by mitchellsimoens
You don't need to use the config object in the map. Try this (haven't tested)
Code:Ext.define('myapp.view.Map', { extend: 'Ext.navigation.View', xtype: 'mappanel', config: { title: 'A Map', iconCls: 'map', items: { title: 'The Map', xtype: 'map', mapOptions: { center: new google.maps.LatLng(52.3934598, 13.1298635), zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP } } } });
-
16 Apr 2012 6:08 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
You don't need to use the config object in the map. Try this (haven't tested)
Code:Ext.define('myapp.view.Map', { extend: 'Ext.navigation.View', xtype: 'mappanel', config: { title: 'A Map', iconCls: 'map', items: { title: 'The Map', xtype: 'map', mapOptions: { center: new google.maps.LatLng(52.3934598, 13.1298635), zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP } } } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Apr 2012 7:11 AM #3
Thank you, that really solved the Problem.


Reply With Quote