PDA

View Full Version : [3.1.1] Ux.gMapPanel V2 - load event



DeyV
19 Jan 2011, 5:32 AM
In this version Ext code:


GEvent.bind( this.gmap, 'load', this, function(){
this.onMapReady();
});



not work.

Small fix:


// GEvent.bind( this.gmap, 'load', this, function(){
// this.onMapReady();
// });

Ext.onReady( function(){
this.onMapReady();
}, this );

in lines: 65 - 70 can fix this problem.

VinylFox
19 Jan 2011, 6:14 AM
I'm not sure what you are trying to 'fix', but that is not the way to do it. The 'load' event is one fired by the Google Maps API and has nothing to do with the ready state of the document.

Can you please explain the problem your having?

DeyV
19 Jan 2011, 6:41 AM
It's simple. Google not fire 'load' event in gMapPanel in Ext 3.3.1 (in previous version it worked)

VinylFox
19 Jan 2011, 7:18 AM
Working fine here.

Can you provide more detail, like how you are using the map panel?

DeyV
19 Jan 2011, 7:35 AM
Of course




<script type="text/javascript">

var aMarkers = [
{ 'lat': 49.6174535, 'lng': 20.7153326, marker: {title: ' Some point', clickable: true } }
];

Ext.onReady(function(){
new Ext.Viewport({
layout: 'border',
items: {
xtype: 'gmappanel',
zoomLevel:7,
gmapType: 'map',
region: 'center',
id: 'my_map',
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
setCenter: {
'lat': 52.27488, 'lng': 20.928955,
marker: {title: 'Poland :)'}
},
markers: aMarkers
}
});

});
-->
</script>



btw. Thank's for fast reply :)


ps. I use the gmappanel from official Ext distribution. Maybe it's time for use Your Git Repo...