Skip to content

Instantly share code, notes, and snippets.

@loiane
Created December 2, 2013 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loiane/7753833 to your computer and use it in GitHub Desktop.
Save loiane/7753833 to your computer and use it in GitHub Desktop.
Ext.define('MyApp.view.WorldMap', {
extend: 'Ext.draw.Component',
alias: 'widget.worldmap',
gradients :[{
id: 'gradientId',
angle: 45,
stops: {
0: {
color: '#fdf0be'
},
1: {
color: '#f9da5c'
}
}
}],
initComponent: function() {
var me = this;
var items = [];
for (var country in worldmap.shapes) {
Ext.Array.push(items,{
type: 'path',
stroke: '#fef7de',
fill: 'url(#gradientId)',
'stroke-opacity': 0.25,
path: worldmap.shapes[country],
itemId: country
});
}
Ext.apply(me,{
items:items
});
me.callParent(arguments);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment