Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2010, 08:10 AM
SorentoUltimate's Avatar
SorentoUltimate SorentoUltimate is offline
 
Join Date: Jul 2009
Location: Moschato, Athens, Greece
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default GoogleMaps Profile Tab Strange Problem

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:


Second Image:
Attached Images
File Type: jpg GoogleMapsProfileTabError.jpg (47.1 KB, 0 views)
File Type: jpg GoogleMapsProfileTabAfterZoomInOut.jpg (83.4 KB, 0 views)
Reply With Quote
  #2  
Old 12-01-2010, 10:18 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 12-01-2010, 10:25 AM
SorentoUltimate's Avatar
SorentoUltimate SorentoUltimate is offline
 
Join Date: Jul 2009
Location: Moschato, Athens, Greece
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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 View Post
Is this a mod or did you code this yourself?
Code by me.

Quote:
Originally Posted by kh99 View Post
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 ?
Reply With Quote
  #4  
Old 12-01-2010, 10:46 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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();
Reply With Quote
  #5  
Old 12-01-2010, 11:25 AM
SorentoUltimate's Avatar
SorentoUltimate SorentoUltimate is offline
 
Join Date: Jul 2009
Location: Moschato, Athens, Greece
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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?
Reply With Quote
  #6  
Old 12-01-2010, 11:48 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #7  
Old 12-01-2010, 01:03 PM
SorentoUltimate's Avatar
SorentoUltimate SorentoUltimate is offline
 
Join Date: Jul 2009
Location: Moschato, Athens, Greece
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 12-01-2010, 01:16 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 12-01-2010, 01:39 PM
SorentoUltimate's Avatar
SorentoUltimate SorentoUltimate is offline
 
Join Date: Jul 2009
Location: Moschato, Athens, Greece
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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="">
Reply With Quote
  #10  
Old 12-01-2010, 01:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:52 PM.


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.04949 seconds
  • Memory Usage 2,289KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_html
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete