Jump to content

Google Maps Media Code


Ohio Riders

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 comment
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 comment
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 comment
Share on other sites

see above, I just d/l and UK was not in name of xml

"Just" as in after my last post or before? I updated the UK file to change the name to Google Map UK in response to your question.

I just downloaded it to check:

<mediatag_name>Google Map UK</mediatag_name>
Link to comment
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 comment
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 comment
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 comment
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 comment
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 comment
Share on other sites

  • 4 months later...

OK, I figured that part out.

Does anyone know how to get this stuff to work in IP Content? I would like to set up a database where members could load addresses for different stuff, then show it on a content page. Any tips are appreciated.

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...