Google Maps: WP embedding guide doesn’t work

  • Unknown's avatar

    I’ve followed the steps outlined on this tutorial to the letter:

    Using Google Maps

    … but the map still fails to appear on the page. If I paste in the code in the visual editor it just appears in the published post as text, and if I paste it in the HTML editor it doesn’t appear at all.

    My blog (http://jamesbrownontheroad.wordpress.com/) uses the Blix theme, if that’s any possible help.

    Thanks!

  • Unknown's avatar

    We need a link to where you’ve used the code, or you need to show us the code that turns up. Is it the shortcode, or the longer one starting wiht “iframe”? Paste it here between backticks, both the code you’re pasting in and the code that shows up.

  • Unknown's avatar

    Give me 5 mins, I’ll knock up a draft post.

  • Unknown's avatar

    Here’s a test, trying to embed it:

    http://jamesbrownontheroad.wordpress.com/2008/09/13/test-post/

    and here’s the code (not done this before, hope this reads ok)

    <iframe width="450" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=G42+8BG+to+PE32+2AR&amp;sll=54.46046,-2.092896&amp;sspn=0.554777,1.785278&amp;ie=UTF8&amp;s=AARTsJotkGPkhUolqd4aDpzKmR7ZQkx1Gw&amp;ll=54.265224,-1.779785&amp;spn=5.77702,9.887695&amp;z=6&amp;output=embed"></iframe><br /><small><a href="http://www.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=G42+8BG+to+PE32+2AR&amp;sll=54.46046,-2.092896&amp;sspn=0.554777,1.785278&amp;ie=UTF8&amp;ll=54.265224,-1.779785&amp;spn=5.77702,9.887695&amp;z=6&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

    Thank you!

  • Unknown's avatar

    Looks like the problem is on WP’s side. Set that post to Draft so that staff can still see it and contact Support via your dashboard. I can’t see anything wrong with that at all.

  • Unknown's avatar

    Thanks for your time, will do as you suggest.

  • Unknown's avatar
  • Unknown's avatar

    Now that works … thanks for the suggestion. My only long term suggestion is that WP develops support for the other country versions of Google, namely because the US (.com) Google will always produce distances for maps in imperial measurements, which is only of use to North Americans and Brits.

    Thanks again!

  • Unknown's avatar

    Addendum… ah, not so perfect. It embeds the map I’ve requested, but not the route. Grrr. Might be a fault exporting the Google code.

    http://maps.google.com/maps?f=q&hl=en&geocode=&q=G42+8BG+to+PE32+2AR&sll=37.0625,-95.677068&sspn=46.226656,114.257812&ie=UTF8&z=7

    <iframe width="450" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=G42+8BG+to+PE32+2AR&amp;sll=37.0625,-95.677068&amp;sspn=46.226656,114.257812&amp;ie=UTF8&amp;s=AARTsJq0sL8xiI-O298mUZhZoEOPQe2scQ&amp;ll=54.265224,-1.516113&amp;spn=5.77702,9.887695&amp;z=6&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=G42+8BG+to+PE32+2AR&amp;sll=37.0625,-95.677068&amp;sspn=46.226656,114.257812&amp;ie=UTF8&amp;ll=54.265224,-1.516113&amp;spn=5.77702,9.887695&amp;z=6&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

  • Unknown's avatar

    As far as I know, wordpress.com doesn’t accept iframe code…

  • Unknown's avatar

    Hi Claude!
    Here’s the announcement from bubel about it.
    https://en.forums.wordpress.com/topic/how-to-show-a-google-map-on-sidebar?replies=18#post-222615

    I tried it at the time and it worked. Haven’t tried since.

  • Unknown's avatar

    @jamesbrownontheroad, yep, it embeds the map, not the route for the step-by-step directions. I’m sorry you’re disappointed! We’ll put your suggestion under consideration. But, as you suggest, it will depend on how our code is setup to work with the Google Maps API.

    For now, maybe you could put a link right below the map that says something like, “Click here to see the route and step-by-step directions.”

    @claudecf, this is an exception to the iframe rule. Embedding a google map doesn’t work just like other shortcodes. When adding Google Maps to your WordPress.com blog, you do NOT manually open the shortcode as you normally do with other services. You put the iframe into the visual editor and it will get converted on save. Check out the FAQ post:

    Using Google Maps

  • Unknown's avatar

    I don’t know if this is useful, but it looks to me like there’s something going wrong with the character encoding.

    For example, trying to embed:
    <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=se1+0sw+to+se1+1sw&amp;sll=53.800651,-4.064941&amp;sspn=19.33322,39.550781&amp;ie=UTF8&amp;ll=51.50114,-0.09752&amp;spn=0.01018,0.00882&amp;output=embed&amp;s=AARTsJr0pK4zTLRJTYdm144sPTykBqKUUg"></iframe><br /><small><a href="http://maps.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=se1+0sw+to+se1+1sw&amp;sll=53.800651,-4.064941&amp;sspn=19.33322,39.550781&amp;ie=UTF8&amp;ll=51.50114,-0.09752&amp;spn=0.01018,0.00882&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

    Gives (in wordpress shortcode form):
    [googlemaps http://maps.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=se1+0sw+to+se1+1sw&amp;sll=53.800651,-4.064941&amp;sspn=19.33322,39.550781&amp;ie=UTF8&amp;ll=51.50114,-0.09752&amp;spn=0.01018,0.00882&amp;output=embed&amp;s=AARTsJr0pK4zTLRJTYdm144sPTykBqKUUg&w=425&h=350]

    But, when you look at the output in firebug, you end up with:
    <iframe height="350" frameborder="0" width="425" scrolling="no" src="http://maps.google.co.uk/maps?f=q&amp;hl=en&amp;geocode=&amp;q=se1 0sw to se1 1sw&amp;sll=53.800651,-4.064941&amp;sspn=19.33322,39.550781&amp;ie=UTF8&amp;ll=51.50114,-0.09752&amp;spn=0.01018,0.00882&amp;output=embed&amp;s=AARTsJr0pK4zTLRJTYdm144sPTykBqKUUg" marginwidth="0" marginheight="0"/>

    Notice that the ‘se1 0sw to se1 1sw’ bit is now missing + marks?

  • The topic ‘Google Maps: WP embedding guide doesn’t work’ is closed to new replies.