]> git.proxmox.com Git - extjs.git/blob - extjs/build/examples/classic/window/gmap.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / classic / window / gmap.js
1 Ext.require([
2 'Ext.window.*',
3 'Ext.ux.GMapPanel'
4 ]);
5
6 Ext.onReady(function(){
7 var mapwin;
8 Ext.get('show-btn').on('click', function() {
9 // create the window on the first click and reuse on subsequent clicks
10 if(mapwin) {
11 mapwin.show();
12 } else {
13 mapwin = Ext.create('Ext.window.Window', {
14 autoShow: true,
15 layout: 'fit',
16 title: 'GMap Window',
17 closeAction: 'hide',
18 width:450,
19 height:450,
20 border: false,
21 x: 40,
22 y: 60,
23 items: {
24 xtype: 'gmappanel',
25 center: {
26 geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',
27 marker: {title: 'Fenway Park'}
28 },
29 markers: [{
30 lat: 42.339641,
31 lng: -71.094224,
32 title: 'Boston Museum of Fine Arts',
33 listeners: {
34 click: function(e){
35 Ext.Msg.alert('It\'s fine', 'and it\'s art.');
36 }
37 }
38 },{
39 lat: 42.339419,
40 lng: -71.09077,
41 title: 'Northeastern University'
42 }]
43 }
44 });
45
46 }
47 });
48 });