-
6 Mar 2013 3:13 PM #1
Unanswered: Google Map API fails to render
Unanswered: Google Map API fails to render
Hi i have been trying to render a map that includes a marker with the below code but all I am getting is a shaded screen. Any help would be appreciated
Code:Ext.define('FirstApp.view.Map',{ extend:'Ext.Panel', xtype: 'maps', config: { useCurrentLocation: true, layout:'fit', listeners: { maprender : function(comp, map){ new google.maps.Marker({ position: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude()), map: map }); } } } })
-
8 Mar 2013 6:22 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,661
- Vote Rating
- 435
- Answers
- 3109
You're not telling it to render a map. You are showing a panel. Extend Ext.Map instead of Ext.Panel and remove the layout : 'fit'
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.
-
11 Mar 2013 1:24 PM #3
Hi Mitchell i have tried this with no success, below is the exact code i am using:
Code:Ext.define('FirstApp.view.Map',{ extend:'Ext.Map', xtype: 'maps', config: { useCurrentLocation: true, listeners: { maprender : function(comp, map){ new google.maps.Marker({ position: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude()), map: map }); } } } }) Ext.define('FirstApp.view.MapContainer',{ extend:'Ext.NavigationView', xtype:'mapcontainer', config:{ title:'Map', iconCls:'map', items:[ { xtype:'maps' } ] } })


Reply With Quote