Using Mapper module in Tabs

9 years 11 months ago #1 by geoffc
We recently noticed a small 'opportunity for improvement' in the use of the IP Mapping Mapper module when used within tabbed content.

This specific 'opportunity' is not a bug but is best decribed as a consequence of how Google Maps returns its content.

To expand upon this,we have long used the IP mapping mapper module upon our Joomla 2.5 web site and it has worked flawlessly. We have been using the excellent NoNumber Tabs extension, and it seemed sensible to continue its use on Joomla 3.x.

However in Joomla 3.x the Tabs extension uses Bootstrap coding and we noticed that the tabs that were not 'active' did not conpletely fill the alloted area when clicked. Typically only a small fraction of the map was displayed. If the page was refreshed then the map displayed properly whilst the other tabs did not, so it was obviously a problem with the display and not the actual map generation code.

If a Bootsrap template is being used for the front end of the site, it is likely that the problem would also be seen if another 'tab' extension was implemented

After doing a little searching it was found that this is a well known problem and that there were two possible solutions. The first involved creating the display upon an off screen canvas, whilst the second involved a map 'resize' and centering of the map.

We elected to use the second approach and use a small piece of javascript to run when the tab is selected. This involves a small overhead but resolves the problem. We can safely assume that jQuery is available upon Joomla 3.x so merely check the Joomla version before deciding whether to include the code in the page output or not.

Whilst we only saw this problem on Joomla 3.x it is possible that it might still occur upon Joomla 2.5 sites where a Bootstrap template is being used. We have never had the problem reported to ourselves so suspect that it has never been observed by our users. This is the reason why we believe a Joomla version check should be sufficient.

We did investigate other approaches including trying to determine whether we were being called from within a tab etc. but the complexity of the code required would, unless definitely necessary, could not justify the overhead, hence the simplistic approach.

The change will be in the next release of IP Mapping 1.2.2

Regards
Geoff

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries