DMXzone Tabs Support Product Page
Solved
DMX Maps doesn't work with google maps.
Reported 02 Mar 2012 11:28:24
1
has this problem
02 Mar 2012 11:28:24 Dave Cheetham posted:
When I use DMX googlemaps inside a DMXtab the map gets corrupted.Apparently it is a common problem and easy to fix but I am no good at jquery. There are lots o f solutions and suggestions online and it seems that simple reinitialising the map after the tab has loaded is one solution but I have no idea where to add any code in the DMX tab script.
HAs anyone else solved this or can anyone help?
Replies
Replied 02 Mar 2012 11:49:21
02 Mar 2012 11:49:21 Vulcho Vulev replied:
Hello Dave.
Can you provide us with link to the page in your question in order for us to inspect your code?
Regards : Vulcho.
Can you provide us with link to the page in your question in order for us to inspect your code?
Regards : Vulcho.
Replied 02 Mar 2012 12:48:04
02 Mar 2012 12:48:04 Dave Cheetham replied:
Replied 02 Mar 2012 15:32:28
02 Mar 2012 15:32:28 Dave Cheetham replied:
Any ideas?
Replied 02 Mar 2012 18:08:07
02 Mar 2012 18:08:07 Vulcho Vulev replied:
Hello here is the workaround :
Seems like there is a bug in the jquery library.
Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via
display: none
so that any elements inside won't report their actual width and height (0 in most browsers).
There's an easy workaround. Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
For Google maps you can also resize the map once the tab is displayed like this:
$('#example').bind('tabsshow', function(event, ui) {
if (ui.panel.id == "map-tab" {
resizeMap();
}
});
resizeMap() will call Google Maps' checkResize() on the particular map.
Seems like there is a bug in the jquery library.
Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via
display: none
so that any elements inside won't report their actual width and height (0 in most browsers).
There's an easy workaround. Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
For Google maps you can also resize the map once the tab is displayed like this:
$('#example').bind('tabsshow', function(event, ui) {
if (ui.panel.id == "map-tab" {
resizeMap();
}
});
resizeMap() will call Google Maps' checkResize() on the particular map.
Replied 03 Mar 2012 11:15:53
03 Mar 2012 11:15:53 Dave Cheetham replied:
Thanks.
I have tried that but I can't make it work. Perhaps I am putting
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
in the wrong place.
I am using the cupertino style so I popped it at the enr of the cupertino.css style sheet.
Is that right?
I have tried that but I can't make it work. Perhaps I am putting
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
in the wrong place.
I am using the cupertino style so I popped it at the enr of the cupertino.css style sheet.
Is that right?
Replied 06 Mar 2012 10:59:48
06 Mar 2012 10:59:48 Dave Cheetham replied:
Thanks.
I have tried that but I can't make it work. Perhaps I am putting
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
in the wrong place.
I am using the cupertino style so I pasted that at the end of the cupertino.css style sheet.
Is that right?
I have tried that but I can't make it work. Perhaps I am putting
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
in the wrong place.
I am using the cupertino style so I pasted that at the end of the cupertino.css style sheet.
Is that right?
Replied 06 Mar 2012 11:00:54
06 Mar 2012 11:00:54 Dave Cheetham replied:
But it doesn't work. The map still doesn't really show properly. Can you tell me if I pasted the code in the right place or not?
Thanks
Thanks
Replied 09 Mar 2012 14:18:51
09 Mar 2012 14:18:51 Vulcho Vulev replied:
Hello Dave.
Sorry for the late reply, you need to replace in curpentino the following line of code :
should become :
Regards: Vulcho.
Sorry for the late reply, you need to replace in curpentino the following line of code :
.ui-tabs .ui-tabs-hide { display: none !important; }
should become :
.ui-tabs .ui-tabs-hide { position: absolute; left: -10000px;}
Regards: Vulcho.
Replied 09 Mar 2012 15:55:25
09 Mar 2012 15:55:25 Dave Cheetham replied:
Perfect!
It works brilliantly now.
Thanks very much for your help
It works brilliantly now.
Thanks very much for your help