![]() |
Google maps BBCode
Hi all
I've made a Custom BBcode to be able to insert any kind of google map into the forum posts, so the Plugins I tried were'nt working as we expected. I post the code, I hope it can be useful for anyone. Security problems, improvements and tunning will be apreciated... I used the tag [gmap], and inside you have to copy the code for the HTML inclusion you can copy when you click the link icon in the map: http://forums.tinet.org/images/usmapes.jpg Code:
<script type="text/javascript"> Use {option}: -> No 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 Please, mark as installed if it worked and you are using it. Hope it helps! :) |
What kind of HTML code can be added? Every?
|
No, it's to insert google maps references.
The javascript checks you're introducing a valid maps.google URL. Into the image,the code you must paste is shown.... |
Super!
|
Dude, this is awsome !!!
Let's see how it goes (intalling right now) and get back for a feedback. Good job. |
Very good. Was looking for this a few weeks ago. This seems to work for all manner of Google Maps, including the "route" type ones which is good for planning weekend cruises!
|
Any demo ? TIA
|
It iframes the entire page as I see. Is there a way to display just a map?
|
As far as I know, it only iframes the map, if you tested and it appeared all the page, please send how you did it to parse this case....
Here is an example (it's in our local language, but the map is the map XD) http://forums.tinet.org/showthread.php?t=103 |
hey guys, I got a problem using this wonderful code..
when I paste the html code (iframe...) I have this message in the post : Error Forbidden Your client does not have permission to get URL /maps?f=q&hl=fr&geocode=&q=tour+eiffel+%20%20paris& ie=UTF8&ll=48.858072,2.294859& sp%20%20n=0.006295,0.006295&output=embed&s=AARTsJr %20%20CvdyoV0AZQw6_BVqD495b8b0 qyA from this server. (Client IP address: 82.238.112.139) |
This is great, thankyou very much for providing this.
I have been looking at doing it myself but could not find a secure solution that would prevent people embedding any link. Looking at the javascript it looks like this solves that problem |
Quote:
As I recall, Google requires an API key on a server to dish out their maps. Any leads on this? I know their licensing levels for businesses is really steep. |
very nice
good thanks |
My first try was with a Google search on my town. It had one pin in the map. That URL got a permissions error from the Google server.
When I tried to paste in a URL with driving directions, it embedded the page, albeit in a small form, and with the driving directions hogging a lot of the IFRAME space. I can alter the scripts' width and height, but are there any pointers for embedding the map alone as showing on the Tinet.org website? |
I'm attaching a "gmap.gif" button which I made for this BB Code, if anyone wishes to use it.
|
Quote:
Quote:
Any idea what could it be ? If this problem can be solved this will be one of the best BBCode ever. Tks |
Quote:
I tried with the USA, it's working, but it doesn't store the zoom on the street. |
I compared my HTML source with yours, and noticed that mine contains some extra space characters. Not sure if that matters or not, but here they are, represented by underline characters for ease of viewing:
The URL source from Google didn't contain any of these extra space characters. On another note, would you mind sharing how you acquired the URL from Google? Did you use the "My Maps" feature? And do just plain driving directions embedd a map, too? Or a whole webpage as it does for me? Thanks! |
Quote:
|
|
on google map, i click on "link", then copy the Second line code "HTML"
and then paste in between the 2 exemple : Quote:
I got the same thing than Saan... |
As a test, it would be good to use the URL source of those who CAN get the map-only to embed, to make sure it isn't something on our servers. The originator presents a grainy photo of the URL, but getting it in copy would be ideal.
I suspect that the parsing within this mod isn't polished enough to account for ALL the types of Google URLs out there. |
This is really interesting. I hope someone can improve this. I was previously using Stonyarc his hack, but that is in the graveyard for a security flaw.
|
From the best of my ability, here's the text of his HTML he got from Google (from his post #9 on page 1, URL = http://forums.tinet.org/showthread.php?t=103). Try to paste this into a posting on your server using the "GMAP" tags to see what you get. All that comes back for me a map of Spain centered on Madrid, and again with the Google headers at the top, not just a map. API key issue perhaps?
Quote:
|
I have been running this mod for a few days and not found any of the issues that other people are describing. So here is some information that may or may not help other mod users:
1) The Google Maps API key is irrelevant to this mod and is a red herring 2) You have to get the code to embed from: http://maps.google.com Looking at the bbcode it seems that other Google domains (i.e. .es may work but I have not try this) 3) For my users I have created an FAQ that details exactly how to use the mod, see here for that: http://www.therevcounter.com/faq/241...ads-posts.html 4) This is how I have the bbcode configured: Title: Google Map BB Code Tag Name: gmap Replacement Code: Code:
<script type="text/javascript"> [gmap]iframe code[/gmap] Description: Embeds Google maps into posts. To use this find the map you want on Google Maps, click the link icon and select all text that is in the "Paste HTML to embed in website" section. Then paste into the post surround by [gmap][/gmap] Use {option}: No Button Image (Optional) I didn't define one, you can if you want Remove Tag If Empty Disable BB Code Within This BB Code Disable Smilies Within This BB Code Disable Word Wrapping Within This BB Code All yes |
Quote:
|
Thanks Mr Eyes,
I forgot to tell how to tune the other settings for the BBCode... I'll update the main entrance. I have'nt any API key or similar, this works using the embed option that google offers. To the users having problems, please set the settings for the BBCode as follows: Use {option}: -> No 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 And then let me know if your problems persist... For those having the Permission problems, test the above solution, and if the problem persists, could you do an "View source" and then paste the code for the tot variable here? You can find : tot=' And then paste here the whole line... Thanks |
I get the error "Wrong Map URL....."
map link code is: Code:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=107862149087073613526.00044b7d4c1dc31d40e5d&t=h&ll=53.384826,-1.69503&spn=5.158155,2.562814&output=embed&s=AARTsJolE0Pef8rEmKk2Gs9h4BwtXXwYlQ"></iframe><br /><small><a href="http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=107862149087073613526.00044b7d4c1dc31d40e5d&t=h&ll=53.384826,-1.69503&spn=5.158155,2.562814&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small> Code:
tot='<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=107862149087073613526.00044b7d4c1dc31d40e5d&t=h&ll=53.384826,-1.69503&spn=5.158155,2.562814&output=embed&s=AARTsJolE0Pef8rEmKk2Gs9h4BwtXXwYlQ"></iframe><br /><small><a href="http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=107862149087073613526.00044b7d4c1dc31d40e5d&t=h&ll=53.384826,-1.69503&spn=5.158155,2.562814&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>'; |
It works for me... :confused:
I'm gone here: http://maps.google.com/maps/ms?hl=en...dc31d40e5d&t=h Clicked on the link button, and copied the content from the field: Paste HTML to embed in website then I've pasted the content inside the Please enter the BBCode definition for gmap and check these values are like here: Use {option}: -> No 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 If public, let me see your test page... |
I've got running OK now. This is so cool !!!
Just one small thing, does someone here knows an instrution to include on the code to remove the hyperlinks from Google Maps before the gmap instruction ? I'll tell you why, on my board I have to use "parse links automaticaly" so when I past the Google Map link it comes with the links and if I use it with the link parsed the BB Code doesn't work, so I have to remove the hyperlink manually. As most my users are hard to teach this sequence I was wondering about this solution to be inside of gmap BBCode it self. Tks |
Quote:
|
And you have edited the BBCode to set the values as I said??
Please, verify it, and tell me, I think that there could be a workaround, but I think the solution is on setting those values right. |
It works great, shame it can't embed a route too. Thanks for the code. :)
|
Who said no routes??
Check it: http://forums.tinet.org/showthread.php?t=103 Create your route and store it, and then click on the Link button and paste as in the examples... |
Whoops, error on my behalf. It does show routes . . . I must have done something wrong. :)
|
Edit, answer found.
|
Quote:
|
Quote:
|
Quote:
The "Automatically parse links in text" option ALWAYS screws up the HTML code on the map page whenever the post edit box is loaded (it's too late even if you turn it off before saving the edit). You can either disable the function in the Vb Admin (not very convenient for users) or re-paste the Google map code into a post during editing. If I use your code exactly as is it returns "Wrong Map URL..." every time. I've placed the code on a this page with the correct Google map code so you can view and debug the source (it doesn't seem to recognise the first search string?). Out of desperation, I modified the code to simplify it and tested it on this other page with exactly the same Google code and it seems to work OK (I've removed a couple of tests and avoided using ") It's probably full of security holes as I'm no programmer :) Another little vBulletin quirk is that any HTML code added to a post stays there even if your turn off "Allow HTML" in the forum properties. Handy if you want to add an HTML content post to a normally non-HTML forum! |
Many Thanks for your additional BB-Code-Info!
It works!!! :) |
All times are GMT. The time now is 12:01 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|