vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   GoogleMaps Profile Tab Strange Problem (https://vborg.vbsupport.ru/showthread.php?t=254499)

SorentoUltimate 12-01-2010 08:10 AM

GoogleMaps Profile Tab Strange Problem
 
1 Attachment(s)
Hi all,

i add a profile tab with User Location on GoogleMaps.
I have a very strange problem, After Profile page koaded , if you go to the User Location GoogleMap the map are not Ok. (See First Image).

If you press Zoom In/Zoom Out from Browser View Menu the Map Fixed automaticaly! (See Second Image).

Another Info may help you understand what happen...

If you switch to User Location GoogleMap Tab when Profile Page Loading(Before finished) then load the map ok.

I need your Help !!!

First Image:
https://vborg.vbsupport.ru/attachmen...1&d=1291198155

Second Image:
https://vborg.vbsupport.ru/attachmen...1&d=1291198155

kh99 12-01-2010 10:18 AM

I don't know anything about google maps, but my guess would be that it's just because it's not visible when the page loads (but maybe that's the obvious part).

Is this a mod or did you code this yourself? I'm thinking if you can somehow change the tab switch js function for that tab you could add some call to refresh it (or maybe not load it at all until the user actually goes to that tab).

SorentoUltimate 12-01-2010 10:25 AM

Quote:

Originally Posted by kh99 (Post 2127865)
but my guess would be that it's just because it's not visible when the page loads (but maybe that's the obvious part).

I agree with that.

Quote:

Originally Posted by kh99 (Post 2127865)
Is this a mod or did you code this yourself?

Code by me.

Quote:

Originally Posted by kh99 (Post 2127865)
I'm thinking if you can somehow change the tab switch js function for that tab you could add some call to refresh it (or maybe not load it at all until the user actually goes to that tab).

Good idea but i don't know how to do that, can u help on that ?

kh99 12-01-2010 10:46 AM

Well, maybe you could use a plugin on member_complete hook and do a str_replace of the javascript call. There may be a better way to handle it but I don't remember offhand how tabs are added to the profile.

I guess I should have let someone else help you...:)

ETA: On my test site there's one custom tab (added by a modification), and it's got it's own template. In that case it would be easy because the javascript "toggle_collapse" call is in the template code. If you know what GMap method would refresh the map, you could try putting it in there after the toggle_collapse();

SorentoUltimate 12-01-2010 11:25 AM

Quote:

Originally Posted by kh99 (Post 2127872)
ETA: On my test site there's one custom tab (added by a modification), and it's got it's own template. In that case it would be easy because the javascript "toggle_collapse" call is in the template code. If you know what GMap method would refresh the map, you could try putting it in there after the toggle_collapse();

Here the code of "toggle_collapse"

Code:

onclick="return toggle_collapse('vbgooglemaps_ul')"
The function i want to call is "Load_Map"

but how?

kh99 12-01-2010 11:48 AM

I haven't tried it, but maybe something like this:

Code:

onclick="var ret = toggle_collapse('vbgooglemaps_ul'); Load_Map(); return ret;"
I don't know how important that return code from toggle_collapse() really is (or what it even means).

SorentoUltimate 12-01-2010 01:03 PM

Here the code i use:

Quote:

require_once(DIR . '/includes/adminfunctions_template.php');

$string_fnd = 'onclick="return toggle_collapse(\'vbgooglemaps_ul\')"';

$string_rpl = 'onclick="var ret = toggle_collapse(\'vbgooglemaps_ul\'); alert(\'Geo\'); Load_Map; return ret;"';

$template_hook['profile_left_last'] = str_replace($string_fnd, $string_rpl, $template_hook['profile_left_last']);

unset($string_fnd, $string_rpl);
I add an alert to check, but never do the alert and also no display the map !!!!!!!

i check the source with mozilla and the replace work !!!

any idea?

kh99 12-01-2010 01:16 PM

No, it looks OK to me. Could you post that section from the mozilla source?

ETA: except that, shouldn't it be Load_Map()? I'm not a js expert, I can't remember if you need the "()" for a function call. And in any case it seems like the alert should show up (unless it all gets ignored if there's an error an it somewhere).

ETA more: I tried it and you do need it to be "Load_Map();" for the function to be called, but using just "Load_Map;" doesn't cause any error.

SorentoUltimate 12-01-2010 01:39 PM

i add the ()

here the code i view with Mozilla sources:
Quote:

<div id="vbgooglemaps_ul" class="tborder content_block">
<h4 class="thead block_title">
<a href="http://www.sorento-ultimateclub.com/...rator.html#top" class="collapse_gadget" onclick="var ret = toggle_collapse('vbgooglemaps_ul'); alert('Geo'); Load_Map(); return ret;"><img id="collapseimg_vbgooglemaps_ul" src="http://...............collapse_generic.gif" alt="" border="0" /></a>
<a name="vbgooglemaps_ul"></a>
<span class="block_name">Location On GoogleMaps</span>
</h4>
<div class="block_content" id="collapseobj_vbgooglemaps_ul" style="">

kh99 12-01-2010 01:58 PM

I created this html file for a test:

HTML Code:

<html>
<head><title></title>
    <script type="text/javascript">
        function Load_Map()
        {
            alert('Load_Map');
        }
        function toggle_collapse(name)
        {
            alert('toggle_collapse');
            return false;
        }
        </script>
</head>
<body>
<div id="vbgooglemaps_ul" class="tborder content_block">
<h4 class="thead block_title">
<a href="http://www.sorento-ultimateclub.com/...rator.html#top" onclick="var ret = toggle_collapse('vbgooglemaps_ul'); alert('Geo'); Load_Map(); return ret;">Test</a>
<a name="vbgooglemaps_ul"></a>
<span class="block_name">Location On GoogleMaps</span>
</h4>
</div>
</body>
</html>


And it works, I get three alerts: toggle_collapse, Geo, Load_Map. But I'm not including the CSS classes or the real toggle_collapse function, so maybe that's the difference.


All times are GMT. The time now is 05:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01158 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete