-
17 Nov 2009 9:40 AM #1
Problems with Google Maps API¨and Tabpanel
Problems with Google Maps API¨and Tabpanel
Hi
I have problems when use TabPanel and Google Maps API, I create two TabPanel, the center panel contains a maps of google, and the left panel I used control for manipulate the info into the google maps, but this panel has hide propierty, when open the site don't have any problems. the problems occurs when hidden the left panel, the center panel don't refresh and see gray zone where stay the left panel. somebody could tell me what I need for the center panel refresh when the left panel is hidden?
-
17 Nov 2009 11:56 AM #2
Its hard to say, since you provided no code.
This example does what your describing, so take a look and see if you spot any differences...
http://code.google.com/p/ext-ux-gmap...les/fullscreen-Shea
My Blog:VinylFox | Twitter:@VinylFox | JavaScript Magazine:JSMag | Curator of the Baltimore/DC JavaScript Meetup | Author: Learning ExtJS 3.x Book
ExtJS Extensions & Plugins: GMapPanel UX | HtmlEditor Buttons Plugin | Selection Enabler Plugin | Grid DataDrop Plugin | Additional Ext.Fx
Sencha Touch Plugins: Swipe Tabs | List Pull Refresh | Accelerometer Tabs
-
17 Nov 2009 12:15 PM #3
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
18 Nov 2009 8:48 AM #4
@MartinJmz - please read that link that tryanDLS provided, and post your code again.
-Shea
My Blog:VinylFox | Twitter:@VinylFox | JavaScript Magazine:JSMag | Curator of the Baltimore/DC JavaScript Meetup | Author: Learning ExtJS 3.x Book
ExtJS Extensions & Plugins: GMapPanel UX | HtmlEditor Buttons Plugin | Selection Enabler Plugin | Grid DataDrop Plugin | Additional Ext.Fx
Sencha Touch Plugins: Swipe Tabs | List Pull Refresh | Accelerometer Tabs
-
18 Nov 2009 1:31 PM #5
@MartinJmz - please read that link that tryanDLS provided, and post your code again.
Nowhere did I ask you to direct message me your code.-Shea
My Blog:VinylFox | Twitter:@VinylFox | JavaScript Magazine:JSMag | Curator of the Baltimore/DC JavaScript Meetup | Author: Learning ExtJS 3.x Book
ExtJS Extensions & Plugins: GMapPanel UX | HtmlEditor Buttons Plugin | Selection Enabler Plugin | Grid DataDrop Plugin | Additional Ext.Fx
Sencha Touch Plugins: Swipe Tabs | List Pull Refresh | Accelerometer Tabs
-
20 Nov 2009 11:37 AM #6
I'm getting the same problem.
I'm getting the same problem.
I am not sure I posted this yesterday. Anyways, I am getting problem implementing not only Google Maps, but Virtual Earth.
Here are the behaviors:
The window shows the toolbars in the correct position, but when it comes time to pan or zoom, the images returned only requests an awkward div size.
Here is the slightly bad workaround:
In the case of Google Maps Panel, I have to move the portlet to another column, switch to another tab panel and switch back, and then the map will refresh with the entire panel.
In the case of a Virtual Earth Panel, I have to double click the map to zoom, and the map will refresh with the entire panel.
Here's my Virtual Earth Class.
Code:Ext.namespace("Ext.ux.maps"); Ext.ux.maps.VirtualEarthPanel = Ext.extend(Ext.Panel, { cls: 'map', initComponent: function () { var defConfig = { layout: 'fit', border: true }; Ext.applyIf(this, defConfig); Ext.ux.maps.VirtualEarthPanel.superclass.initComponent.call(this); this.addEvents('maploaded'); }, constructor: function(config) { config = config || {}; Ext.apply(config, { }); Ext.ux.maps.VirtualEarthPanel.superclass.constructor.call(this); }, afterRender : function(){ var wh = this.ownerCt.getSize(); Ext.applyIf(this, wh); Ext.ux.maps.VirtualEarthPanel.superclass.afterRender.call(this); try{ this.map = new VEMap(this.body.dom['id']); this.map.LoadMap(); } catch (e) { Ext.Msg(e.message); } } }); Ext.reg('virtualearthpanel', Ext.ux.maps.VirtualEarthPanel);Put it into a portal, tabbed panel, window. You will get some problems, and I think it is div/css issue, that I am not quite sure how to fix.Code:var mapConfig = { title: 'Map', xtype: 'panel', animCollapse: false, tools: tools, layout: 'fit', height:400, items: [{xtype: 'virtualearthpanel'}] }
I am also using layout: 'fit', but I am not sure this is correct.
-
20 Nov 2009 11:54 AM #7
Not sure about Virtual Earth, but Maps requires that you let the map class know that it needs to re-size itself to fit in the container...
Also, is there a reason your nesting the map panel in another panel, instead of doing something like this...Code:your_map.checkResize();
Code:var mapConfig = { title: 'Map', xtype: 'virtualearthpanel', animCollapse: false, tools: tools, layout: 'fit', height:400 }-Shea
My Blog:VinylFox | Twitter:@VinylFox | JavaScript Magazine:JSMag | Curator of the Baltimore/DC JavaScript Meetup | Author: Learning ExtJS 3.x Book
ExtJS Extensions & Plugins: GMapPanel UX | HtmlEditor Buttons Plugin | Selection Enabler Plugin | Grid DataDrop Plugin | Additional Ext.Fx
Sencha Touch Plugins: Swipe Tabs | List Pull Refresh | Accelerometer Tabs
-
20 Nov 2009 12:32 PM #8
@VinylFox, I will check to see if need to implement the checkResize.
If I can find the reason why the tab panel is not displaying the title in this case, then I would implement it like this. Any suggestions as to why it is not working out. Also, in the case of portlets, is it not expecting a portlet instead of panel. So in a portlet I'm placing the map inside the items.
-
20 Nov 2009 2:16 PM #9
Ok I put alerts all over onResize and setSize.
I am wondering why the checkResize is before the superclass call.
And it calls onResize and setSize a dozen times:Code:onResize : function(w, h){ if (typeof this.gmap == 'object') { alert(w+", "+h); this.gmap.checkResize(); } Ext.ux.GMapPanel.superclass.onResize.call(this, w, h); },
setSize(304,371) -> onResize(304,371) -> setSize(304,371)
-> setSize(838,371) -> onResize(838,371) -> setSize(838,371)
-> onResize(838,371) -> setSize(838,371)
So I figured there must be a delay or wait to ignore subsequent requests to checkResize()
So I waited, and dismissed the alert field on one of the latter resizes, and sure enough it worked.
So I am trying to do a setInterval or setTimeout on this, but is there a Ext version to do this?!?.
I want to determine whether this.gmap.isLoaded() == true then perform checkResize.
-
20 Nov 2009 3:15 PM #10
put checkResize on load bind with google.
put checkResize on load bind with google.
Maybe someone could tell me where this is better placed.
In GMapPanel.js
It's not pretty, but I figured that because the checkResize had to wait for the load, and Google Maps API needed to load first, that it had to wait for the load event before it could send the checkResize.Code:GEvent.bind(this.gmap, 'load', this, function(){ this.onMapReady(); this.gmap.checkResize(); });


Reply With Quote
