PDA

View Full Version : Google Maps API not showing



maecy
26 Jan 2014, 9:16 PM
I am trying to display a map in my system. I tried the examples and I also referred to other sample from other users but still no luck. Could anyone please help?

here's my code for view:


Ext.ns('dlti.view.widget');//Order Window View
Ext.define('dlti.view.widget.UserHome' ,{
extend: 'Ext.panel.Panel',
id: 'dlti-user-home',
alias: 'widget.UserHome',
layout: {
type: 'hbox',
region: 'center'
},


items:[{
xtype: 'gmappanel',
region: 'center',
id: 'mygooglemap',
zoomLevel: 3,
gmapType: 'map',
mapConfOpts:['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
setCenter: {
'lat': 37.4419,
'lng': 122.1419,
marker:{ title: 'Palo Alto'}
}
}

]



});




and here's my html code:


<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="js/lib/ext-all-debug.js"></script> <script type="text/javascript" src="js/util/dlti.util.js"></script> <script type="text/javascript" src="js/model/dlti.models.js"></script> <script type="text/javascript" src="js/store/dlti.stores.js"></script>
<script type="text/javascript" src="js/view/dlti.home.js"></script>
<script type="text/javascript" src="js/view/dlti.views.js"></script>

slemmon
28 Jan 2014, 3:39 PM
What if you set the panel holding the map panel's layout (do you necessarily need a panel to hold the map panel or could the map panel stand alone) to 'fit'?

And just to make sure you can first get it working before introducing additional map configs you might emulate the following Fiddle:

32b

maecy
28 Jan 2014, 7:02 PM
I tried the code above. But it's giving me the error of cannot read property 'Geocoder' of undefined. My html code for google maps is :


<sctipt id="google" type="text/javascript" src="maps.google.com/maps/api/js?sensor=false"></script>