Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / examples / window / gmap.js
index 2e4aeac..0059afd 100644 (file)
@@ -1,61 +1,71 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-\r
-Ext.onReady(function(){\r
-\r
-    var mapwin;\r
-    var button = Ext.get('show-btn');\r
-\r
-    button.on('click', function(){\r
-        // create the window on the first click and reuse on subsequent clicks\r
-        if(!mapwin){\r
-\r
-            mapwin = new Ext.Window({\r
-                layout: 'fit',\r
-                title: 'GMap Window',\r
-                closeAction: 'hide',\r
-                width:400,\r
-                height:400,\r
-                x: 40,\r
-                y: 60,\r
-                items: {\r
-                    xtype: 'gmappanel',\r
-                    region: 'center',\r
-                    zoomLevel: 14,\r
-                    gmapType: 'map',\r
-                    mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],\r
-                    mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],\r
-                    setCenter: {\r
-                        geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',\r
-                        marker: {title: 'Fenway Park'}\r
-                    },\r
-                    markers: [{\r
-                        lat: 42.339641,\r
-                        lng: -71.094224,\r
-                        marker: {title: 'Boston Museum of Fine Arts'},\r
-                        listeners: {\r
-                            click: function(e){\r
-                                Ext.Msg.alert('Its fine', 'and its art.');\r
-                            }\r
-                        }\r
-                    },{\r
-                        lat: 42.339419,\r
-                        lng: -71.09077,\r
-                        marker: {title: 'Northeastern University'}\r
-                    }]\r
-                }\r
-            });\r
-            \r
-        }\r
-        \r
-        mapwin.show();\r
-        \r
-    });\r
-    \r
- });
\ No newline at end of file
+/*
+
+This file is part of Ext JS 4
+
+Copyright (c) 2011 Sencha Inc
+
+Contact:  http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
+
+*/
+Ext.Loader.setConfig({enabled: true});
+Ext.Loader.setPath('Ext.ux', '../ux');
+Ext.require([
+    'Ext.window.*',
+    'Ext.ux.GMapPanel'
+]);
+
+Ext.onReady(function(){
+    var mapwin;
+    
+    Ext.get('show-btn').on('click', function() {
+        // create the window on the first click and reuse on subsequent clicks
+        if(!mapwin){
+
+            mapwin = Ext.create('Ext.Window', {
+                layout: 'fit',
+                title: 'GMap Window',
+                closeAction: 'hide',
+                width:450,
+                height:450,
+                border: false,
+                x: 40,
+                y: 60,
+                items: {
+                    xtype: 'gmappanel',
+                    zoomLevel: 14,
+                    gmapType: 'map',
+                    mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
+                    mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
+                    setCenter: {
+                        geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',
+                        marker: {title: 'Fenway Park'}
+                    },
+                    markers: [{
+                        lat: 42.339641,
+                        lng: -71.094224,
+                        marker: {title: 'Boston Museum of Fine Arts'},
+                        listeners: {
+                            click: function(e){
+                                Ext.Msg.alert({title: 'Its fine', text: 'and its art.'});
+                            }
+                        }
+                    },{
+                        lat: 42.339419,
+                        lng: -71.09077,
+                        marker: {title: 'Northeastern University'}
+                    }]
+                }
+            });
+            
+        }
+        
+        mapwin.show();
+        
+    });
+    
+ });