X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/ux/GMapPanel.js diff --git a/examples/ux/GMapPanel.js b/examples/ux/GMapPanel.js index 3291186a..8a732a90 100644 --- a/examples/ux/GMapPanel.js +++ b/examples/ux/GMapPanel.js @@ -1,15 +1,15 @@ -/*! - * Ext JS Library 3.2.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license - */ /** * @class Ext.ux.GMapPanel * @extends Ext.Panel * @author Shea Frederick */ -Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { +Ext.define('Ext.ux.GMapPanel', { + extend: 'Ext.Panel', + + alias: 'widget.gmappanel', + + requires: ['Ext.window.MessageBox'], + initComponent : function(){ var defConfig = { @@ -24,15 +24,17 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { Ext.applyIf(this,defConfig); - Ext.ux.GMapPanel.superclass.initComponent.call(this); - + this.callParent(); }, + afterRender : function(){ - var wh = this.ownerCt.getSize(); + var wh = this.ownerCt.getSize(), + point; + Ext.applyIf(this, wh); - Ext.ux.GMapPanel.superclass.afterRender.call(this); + this.callParent(); if (this.gmapType === 'map'){ this.gmap = new GMap2(this.body.dom); @@ -51,7 +53,7 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { this.geoCodeLookup(this.setCenter.geoCodeAddr); }else{ if (this.gmapType === 'map'){ - var point = new GLatLng(this.setCenter.lat,this.setCenter.lng); + point = new GLatLng(this.setCenter.lat,this.setCenter.lng); this.gmap.setCenter(point, this.zoomLevel); } if (typeof this.setCenter.marker === 'object' && typeof point === 'object'){ @@ -73,13 +75,13 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { this.addMapControls(); this.addOptions(); }, - onResize : function(w, h){ + afterComponentLayout : function(w, h){ if (typeof this.getMap() == 'object') { this.gmap.checkResize(); } - Ext.ux.GMapPanel.superclass.onResize.call(this, w, h); + this.callParent(arguments); }, setSize : function(width, height, animate){ @@ -88,7 +90,7 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { this.gmap.checkResize(); } - Ext.ux.GMapPanel.superclass.setSize.call(this, width, height, animate); + this.callParent(arguments); }, getMap : function(){ @@ -118,7 +120,7 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { }, addMarker : function(point, marker, clear, center, listeners){ - + var evt; Ext.applyIf(marker,G_DEFAULT_ICON); if (clear === true){ @@ -131,6 +133,9 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { var mark = new GMarker(point,marker); if (typeof listeners === 'object'){ for (evt in listeners) { + if (!listeners.hasOwnProperty(evt)) { + continue; + } GEvent.bind(mark, evt, this, listeners[evt]); } } @@ -141,7 +146,7 @@ Ext.ux.GMapPanel = Ext.extend(Ext.Panel, { if (this.gmapType === 'map') { if (Ext.isArray(this.mapControls)) { - for(i=0;i