PDA

View Full Version : BB Code Enhancements - Interactive Google Maps In Post


benstillman
02-10-2010, 10:00 PM
No Google Maps API key, no mod install, no template edits, etc. This is based off YBMF's mod for 4.0 (https://vborg.vbsupport.ru/showthread.php?t=234318), but a bit easier for the end user. Instead of the user having to input the full Google Maps link, just the address, name of business, etc is acceptable.

Admin CP --> Custom BB Codes --> Add New BB Code


Title: Map

BB Code Tag Name: map

Replacement: <div align="center" style="margin: 5px 5px 5px 5px;">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td class="thead" style="text-align:center"><iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q={param}&output=embed"></iframe></td>
</tr>
</table>
</div>

Example: 201 S. Grant Avenue, Columbus, Ohio

Description: This will insert a Google map of the location you input

Use {option}: No

Button Image (Optional): whatever 20x20 image you want, attached is the one we use

Remove Tag If Empty: Yes

Disable BB Code Within This BB Code: Yes

Disable Smilies Within This BB Code: Yes

Disable Word Wrapping Within This BB Code: Yes

mastertek2000
02-12-2010, 08:32 PM
installed thanks

alex_vaa
03-25-2010, 06:31 PM
installed thanks

Rideharder
03-26-2010, 02:48 AM
thx UUUUUU!

eng2all
03-26-2010, 06:36 AM
thank you alot for this information

Rideharder
03-26-2010, 12:07 PM
did not show all the time.. removed. sorry

weindians
03-27-2010, 11:02 AM
its nice bbcode for forums using maps n stuff more... thanx by the way

benstillman
06-14-2010, 02:45 PM
did not show all the time.. removed. sorry

What do you mean it didn't show all the time? What didn't show? The map? The location? The button image? :confused:

Morrus
06-15-2010, 05:38 PM
What do you mean it didn't show all the time? What didn't show? The map? The location? The button image? :confused:

Same thing here - sometimes it works, sometimes it doesn't. Sometimes the same instance works once and then not again.

matthewhotdude
06-15-2010, 06:05 PM
Doesnt work, where the map should be displays internet explorer cannot display page

benstillman
07-08-2010, 04:40 PM
It's the same as this one: https://vborg.vbsupport.ru/showthread.php?t=235625

And nobody seems to be having issues with that one. Weird.

I can't replicate any issues. It works every time for me. Can someone having errors post up screenshots?

benstillman
07-08-2010, 04:42 PM
Doesnt work, where the map should be displays internet explorer cannot display page

All it's doing is loading Google Maps within an iframe. If you're getting a cannot display page error, can you access it directly?

Morrus
07-09-2010, 11:14 PM
It's the same as this one: https://vborg.vbsupport.ru/showthread.php?t=235625

And nobody seems to be having issues with that one. Weird.

I can't replicate any issues. It works every time for me. Can someone having errors post up screenshots?

Dunno what to tell you - uninstalled ages ago. But we're telling you the truth.

BirdOPrey5
07-11-2010, 12:03 AM
I have never had any issue with this mod... if google maps isn't showing for you then google maps itself must be having connectivity issues because all it does is display google maps on an iframe (a page inside a page) there's nothing that can be 'broken' in the code.

mandrinvborg
08-31-2010, 06:50 PM
Sooooooo simple this!
Been looking for something like this for a while now and being utterly a non-coder, it's been hellofa frustrating to say the least!

MEGA thanks, benstillman!!!

*installed*

yotsume
09-02-2010, 07:57 AM
Installed and works great!

BirdOPrey5
09-02-2010, 05:18 PM
yes - disable everything

johnban
11-08-2010, 01:03 PM
I install it in our forums and for the moment our moderating team is trying it..

We have the following odd case..

When I post a map.. some members of the team see it and some others see the map of America !!! If they go in with edit and then press cancel they see the map !!!!

At the other hand I can see all the maps that the rest members of the team have posted.. (so far I have 3 on 3).

Can you think of anything?? browser?? cookies??

Thanks,
John B.

BirdOPrey5
11-08-2010, 02:31 PM
On rare occasion I've looked at maps I know have worked for me before and instead of the map of the area I want I just see a zoom out of the whole united states. When I check the map later it is back to normal. I chalk it up to an error on google's part because my code hasn't changed.

benstillman
11-17-2010, 02:48 PM
On rare occasion I've looked at maps I know have worked for me before and instead of the map of the area I want I just see a zoom out of the whole united states. When I check the map later it is back to normal. I chalk it up to an error on google's part because my code hasn't changed.

Yup. That's definitely something on Google's end.

jimsflies
11-17-2010, 04:16 PM
For some reason, at least on this particular post (http://www.captivereefs.com/forum/showthread.php?t=10755), the map pin is not centering...in fact you have to click out or scroll over for it to come into view on the page? Any thoughts?

I tried formatting the address a couple different ways and get the same thing. When I enter it in the brower directly using the googlemaps call, it appears centered as it should be.

It may also be an issue with IE6...just checked it on firefox on my mac and it looks centered. Not sure if there is a way to make the iframe play better with older browsers. Hopefully I am the only one using anything that old though. :)

BirdOPrey5
11-17-2010, 05:02 PM
It's centered for me using Chrome.

benstillman
12-08-2010, 06:35 PM
It's centered for me using Chrome.

Me too, Chrome, Firefox and Opera.

Big Kahuna
01-17-2011, 01:15 AM
Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /home/moparcom/public_html/forums/misc.php(482) : eval()'d code on line 1

When you click the BB Code link at the bottom of the thread you get the above error. If you delete the map BB code -- the BB Code link works. Enter the map code again -- get the error

BirdOPrey5
01-17-2011, 03:51 AM
What specific version of VB are you using? I can't say I've ever clicked that link before but I just tried it on 3.8.6 Pl1 and 4.0.8 on threads with maps and didn't get the error in either. It may be a conflict with another BB Code mod.

Big Kahuna
01-17-2011, 06:03 AM
3.8.4

BirdOPrey5
01-17-2011, 12:53 PM
Weird one... What are you using for your "example" in the BB Code manager?'
Try putting something else in as the example like:
example

I know it won't show the map. this is just to troubleshoot the cause.

QuickQuestion
03-13-2011, 03:41 AM
Hey guys for some reason my map (when displayed) is tall but short width wise. It seems about half as wide as it should be. Is there any way to adjust width here?

BirdOPrey5
03-13-2011, 12:43 PM
Hey guys for some reason my map (when displayed) is tall but short width wise. It seems about half as wide as it should be. Is there any way to adjust width here?

If you're having width issues the solution is to remove the <table> tags from the replacement code.

Use just this as the replacement code:


<iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q={param}&output=embed"></iframe>

QuickQuestion
03-13-2011, 05:21 PM
Thanks a ton BirdOPrey5. I had to delete the BB code & make a new one but it works great now. :) Thanks again.

MagicThemeParks
04-25-2011, 01:39 AM
Works great! :up:

Using them in our 'State Information' threads here: United States History Forum (http://www.unitedstateshistoryforum.com/showthread.php?goto=newpost&t=5)

alldylan
07-30-2011, 08:56 AM
Thanks for this :)

talkhost
09-09-2011, 11:02 AM
Installed. Handy addon.

zilibobo
10-23-2012, 05:20 PM
Great! Work fine but cannot see way-points (From Here - To here). Anybody know WTF? :)
10x

mr1dul
02-21-2013, 04:58 AM
Excellent ... installed this on my forums, we were looking for this feature from a long time to help students in finding the location of the institutes... thanks ... god bless

http://mba.ind.in/
http://management.ind.in/

c0der
02-27-2013, 03:42 AM
nice work

imedic
06-22-2013, 07:58 AM
Thanks, works like a charm :)

keharris53
03-23-2017, 04:56 AM
Just added this and it works without any problems. I know this is an old post, but thanks.

Midohash
04-02-2017, 08:35 PM
Surprisingly, the map shows on (preview post) but didn't when I click (submit reply)! ... Just getting this photo:

https://vborg.vbsupport.ru/external/2017/04/20.png

Any suggestions?

Midohash
04-15-2017, 12:28 PM
uppppppp!

BirdOPrey5
04-15-2017, 05:29 PM
Have you tried a different browser?

Midohash
04-16-2017, 09:19 PM
Have you tried a different browser?

Yes, same error on Chrome and Firefox!

I can see the map without problem when I select "Preview Post" but got the error only after I submit the post!

https://vborg.vbsupport.ru/external/2017/04/4.png

BirdOPrey5
04-17-2017, 08:30 AM
Looks like the URL is not rendering correctly on the preview. Could be an add-on or a server configuration issue. Did you try disabling hooks in config.php and see if you still have issue?

Midohash
04-19-2017, 05:10 PM
Looks like the URL is not rendering correctly on the preview. Could be an add-on or a server configuration issue. Did you try disabling hooks in config.php and see if you still have issue?

Thanks, Joe

Fixed! :cool:

By trial and error this replacement code worked with me! :up:


<div align="center" style="margin: 5px 5px 5px 5px;">
<iframe src="https://maps.google.com/maps?q={param}&output=embed" width="75%" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>
</div>