Jump to content

Community

Recommended Posts

%7Boption%7D



File Name: Google Maps Media Code

File Submitter: Ohio Riders

File Submitted: 19 Jun 2013

File Category: Integration



Easy peasy. Just copy the URL from Google Maps, and paste into your post.

Example:

https://maps.google.com/maps?q=201+S+Grant+Ave,+Columbus,+OH


Tested on 3.4.4. Should work on most others that support these media codes.


UPDATES:
- Added UK support (google_maps_media_code_uk.zip).


%7Boption%7D



here to download this file

Link to post
Share on other sites

Thanks

Looks like a great tool but after installing I can resolve your address as above.

Our local city URL is more complex:

https://maps.google.co.uk/maps?safe=off&q=Long+Row+West,+Nottingham&ie=UTF-8&hq=&hnear=0x4879c22aa35d7679:0x560bfdf39b9014ce,Long+Row+W,+Nottingham&gl=uk&ei=J53KUZGJHMSZ0AWo_oDwCg&ved=0CC8Q8gEwAA

will not resolve in post,

Google maps test

any advice?

Link to post
Share on other sites

does installing UK one overwrite the other one?

Shouldn't. Should just add a new one. I've changed the name of the new one to Google Map UK so you'll be able to see which is which in the list of media codes in your admin cp. When I have a few minutes, I'll figure out the regex to make one media code work with both .com and .co.uk.

Link to post
Share on other sites

You may be able to have a single tag for both .com and .co.uk (and any other TLDs) this way:

http(?:s)?://(www.)?maps.google.{2}/?{3}
<iframe width="80%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.$2/maps?q=$3&amp;output=embed"></iframe>
Unrelated: Columbus, OH, in the house!
Link to post
Share on other sites

You may be able to have a single tag for both .com and .co.uk (and any other TLDs) this way:

http(?:s)?://(www.)?maps.google.{2}/?{3}
<iframe width="80%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.$2/maps?q=$3&amp;output=embed"></iframe>
Unrelated: Columbus, OH, in the house!

That's damn close to what I tried the first time. I'll have to try it your way and see if that works. If so I'll update the file. Thanks for the advice.

O-H. :smile:

Link to post
Share on other sites
  • 1 month later...
  • 1 month later...

I am trying to insert google map in my database view record template but there is no way I can make it to work.

The problem is that the & turns to &amp;.

And if I use &amp; in the template, it remains &amp; in the output.

 <iframe width="570" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.googleapis.com/maps/api/staticmap?markers={$Endereco},{$Cidade},{$Estado}&amp;size=570x400&amp;key=AzRRthYjHrjHUJ2eB9hLlLzXQ&amp;sensor=false&amp;maptype=hybrid"></iframe>
Link to post
Share on other sites

I am trying to insert google map in my database view record template but there is no way I can make it to work.

The problem is that the & turns to &amp;.

And if I use &amp; in the template, it remains &amp; in the output.

 <iframe width="570" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.googleapis.com/maps/api/staticmap?markers={$Endereco},{$Cidade},{$Estado}&amp;size=570x400&amp;key=AzRRthYjHrjHUJ2eB9hLlLzXQ&amp;sensor=false&amp;maptype=hybrid"></iframe>

Your url looks nothing like a normal Google Maps query url. For instance, you're hitting googleapis.com.

Link to post
Share on other sites

I have changed the code to insert the static map as a image, not as iframe:

<img src="http://maps.googleapis.com/maps/api/staticmap?markers={$Endereco},{$Cidade},{$Estado}&amp;size=570x400&amp;key=AIzaSyBRQuPaeYcirustWWW&amp;sensor=false&amp;maptype=hybrid" alt="Localização de {$data['record']['field_40_value']}" height="400" width="570">

it's working fine in Firefox and Chrome. But in Safari it's not.

Anyone knows why?

Link to post
Share on other sites
  • 4 months later...
  • 9 months later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy