PDA

View Full Version : Google Maps Very Slow



ispypie
23 Jan 2012, 3:46 AM
Hi
I am trying to display a google map as part of my ui. Basically it is just taking an absolute age (minutes) to render the map. I get a grey box with some google text where the map should be and then go and make myself a coffee and maybe if I am lucky I may have a part of a map when I return. Eventually it does (most of the time) render the map.

I searched around and found the gmap panel for v3 of the maps api. I had same issue so then created my own panel with the following in afterRender taken from GmapPanel and google maps sample.



afterRender: function () {

this.callParent(arguments);

var myOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(this.body.dom, myOptions);

google.maps.event.addListener(map, 'load', function () {
console.log('loaded map');
});

},

Its still the same. Has anyone had similar issue or any idea what may be the issue?

Thanks

Mark

mitchellsimoens
23 Jan 2012, 12:20 PM
Are you using the extension from Ext JS 3 or 4?

ispypie
23 Jan 2012, 12:55 PM
I was using the version below to work with V3 of the maps api but then I copied the code I posted above from this extension into my own panel just to try and get a bare bones map rendered. I got the impression the panel shipped with Extjs4 works with maps api v2.
https://github.com/VinylFox/ExtJS.ux.GMapPanel
(https://github.com/VinylFox/ExtJS.ux.GMapPanel)
Sorry think I misread the question I should have said in original post I am using Extjs 4.

thanks

Mark

mitchellsimoens
23 Jan 2012, 12:58 PM
The version on his blog is for Ext JS 3 which probably won't work well in Ext JS 4.

ispypie
23 Jan 2012, 1:08 PM
I am guessing people are using maps in 4??
Really I am just trying to figure out whether there's an issue there or its something I am doing that's causing an issue. Even when I just try to initialise the app with the map in the viewport (rather than nested further down) it still behaves the same. I am still pretty new to Ext and first time working with maps so wonder whether there is something I am missing.

lorezyra
23 Jan 2012, 4:37 PM
Look here for the latest version of GMapPanel...

http://www.sencha.com/forum/showthread.php?139470-Who-got-Google-Maps-V3-and-Ext-JS-4-running

ispypie
24 Jan 2012, 2:28 AM
Thanks lorezyra not sure why I didn't pick up that thread in my search. I am pretty sure that's the one I am using although those guys seem to have it working.