PDA

View Full Version : How to get panel width for image from Google Maps Static API?



preyz
27 Apr 2011, 7:10 AM
How can I get a panel's width-value into a template?

Instead of the hardcoded value "size=320" in the URL for the Google API, I need the width of the panel. This is to get an image that spans over the entire screen, regardless of the user-device.



items: [
{
xtype: 'panel',
tpl: new Ext.XTemplate(
'<img src="http://maps.google.com/maps/api/staticmap?sensor=true&size=320x100&maptype=roadmap&center={lat},{lng}&zoom=16" />',
),
},
.....