git.ithinksw.org
/
extjs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git]
/
examples
/
ux
/
GMapPanel.js
diff --git
a/examples/ux/GMapPanel.js
b/examples/ux/GMapPanel.js
index
cc63591
..
8a732a9
100644
(file)
--- a/
examples/ux/GMapPanel.js
+++ b/
examples/ux/GMapPanel.js
@@
-1,15
+1,15
@@
-/*!
- * Ext JS Library 3.2.2
- * 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
*/
/**
* @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 = {
initComponent : function(){
var defConfig = {
@@
-24,15
+24,17
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
Ext.applyIf(this,defConfig);
Ext.applyIf(this,defConfig);
- Ext.ux.GMapPanel.superclass.initComponent.call(this);
-
+ this.callParent();
},
},
+
afterRender : function(){
afterRender : function(){
- var wh = this.ownerCt.getSize();
+ var wh = this.ownerCt.getSize(),
+ point;
+
Ext.applyIf(this, wh);
Ext.applyIf(this, wh);
- Ext.ux.GMapPanel.superclass.afterRender.call(this);
+ this.callParent();
if (this.gmapType === 'map'){
this.gmap = new GMap2(this.body.dom);
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'){
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'){
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();
},
this.addMapControls();
this.addOptions();
},
-
onResize
: function(w, h){
+
afterComponentLayout
: function(w, h){
if (typeof this.getMap() == 'object') {
this.gmap.checkResize();
}
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){
},
setSize : function(width, height, animate){
@@
-88,7
+90,7
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
this.gmap.checkResize();
}
this.gmap.checkResize();
}
-
Ext.ux.GMapPanel.superclass.setSize.call(this, width, height, animate
);
+
this.callParent(arguments
);
},
getMap : function(){
},
getMap : function(){
@@
-118,7
+120,7
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
},
addMarker : function(point, marker, clear, center, listeners){
},
addMarker : function(point, marker, clear, center, listeners){
-
+ var evt;
Ext.applyIf(marker,G_DEFAULT_ICON);
if (clear === true){
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) {
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]);
}
}
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)) {
if (this.gmapType === 'map') {
if (Ext.isArray(this.mapControls)) {
- for(i=0;i<this.mapControls.length;i++){
+ for(
var
i=0;i<this.mapControls.length;i++){
this.addMapControl(this.mapControls[i]);
}
}else if(typeof this.mapControls === 'string'){
this.addMapControl(this.mapControls[i]);
}
}else if(typeof this.mapControls === 'string'){
@@
-163,8
+168,7
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
addOptions : function(){
if (Ext.isArray(this.mapConfOpts)) {
addOptions : function(){
if (Ext.isArray(this.mapConfOpts)) {
- var mc;
- for(i=0;i<this.mapConfOpts.length;i++){
+ for(var i=0;i<this.mapConfOpts.length;i++){
this.addOption(this.mapConfOpts[i]);
}
}else if(typeof this.mapConfOpts === 'string'){
this.addOption(this.mapConfOpts[i]);
}
}else if(typeof this.mapConfOpts === 'string'){
@@
-183,11
+187,11
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
geoCodeLookup : function(addr) {
this.geocoder = new GClientGeocoder();
geoCodeLookup : function(addr) {
this.geocoder = new GClientGeocoder();
- this.geocoder.getLocations(addr,
this.addAddressToMap.createDelegate(
this));
+ this.geocoder.getLocations(addr,
Ext.Function.bind(this.addAddressToMap,
this));
},
addAddressToMap : function(response) {
},
addAddressToMap : function(response) {
-
+ var place, addressinfo, accuracy, point;
if (!response || response.Status.code != 200) {
Ext.MessageBox.alert('Error', 'Code '+response.Status.code+' Error Returned');
}else{
if (!response || response.Status.code != 200) {
Ext.MessageBox.alert('Error', 'Code '+response.Status.code+' Error Returned');
}else{
@@
-211,5
+215,3
@@
Ext.ux.GMapPanel = Ext.extend(Ext.Panel, {
}
});
}
});
-
-Ext.reg('gmappanel', Ext.ux.GMapPanel);
\ No newline at end of file