Google Maps: WP embedding guide doesn’t work
-
I’ve followed the steps outlined on this tutorial to the letter:
… 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!
-
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.
-
-
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&hl=en&geocode=&q=G42+8BG+to+PE32+2AR&sll=54.46046,-2.092896&sspn=0.554777,1.785278&ie=UTF8&s=AARTsJotkGPkhUolqd4aDpzKmR7ZQkx1Gw&ll=54.265224,-1.779785&spn=5.77702,9.887695&z=6&output=embed"></iframe><br /><small><a href="http://www.google.co.uk/maps?f=q&hl=en&geocode=&q=G42+8BG+to+PE32+2AR&sll=54.46046,-2.092896&sspn=0.554777,1.785278&ie=UTF8&ll=54.265224,-1.779785&spn=5.77702,9.887695&z=6&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>Thank you!
-
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.
-
-
@jamesbrownontheroad, can you try with maps.google.com instead of http://www.google.co.uk?
-
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!
-
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.
<iframe width="450" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="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&s=AARTsJq0sL8xiI-O298mUZhZoEOPQe2scQ&ll=54.265224,-1.516113&spn=5.77702,9.887695&z=6&output=embed"></iframe><br /><small><a href="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&ll=54.265224,-1.516113&spn=5.77702,9.887695&z=6&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small> -
-
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-222615I tried it at the time and it worked. Haven’t tried since.
-
@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:
-
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&hl=en&geocode=&q=se1+0sw+to+se1+1sw&sll=53.800651,-4.064941&sspn=19.33322,39.550781&ie=UTF8&ll=51.50114,-0.09752&spn=0.01018,0.00882&output=embed&s=AARTsJr0pK4zTLRJTYdm144sPTykBqKUUg"></iframe><br /><small><a href="http://maps.google.co.uk/maps?f=q&hl=en&geocode=&q=se1+0sw+to+se1+1sw&sll=53.800651,-4.064941&sspn=19.33322,39.550781&ie=UTF8&ll=51.50114,-0.09752&spn=0.01018,0.00882&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&hl=en&geocode=&q=se1+0sw+to+se1+1sw&sll=53.800651,-4.064941&sspn=19.33322,39.550781&ie=UTF8&ll=51.50114,-0.09752&spn=0.01018,0.00882&output=embed&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&hl=en&geocode=&q=se1 0sw to se1 1sw&sll=53.800651,-4.064941&sspn=19.33322,39.550781&ie=UTF8&ll=51.50114,-0.09752&spn=0.01018,0.00882&output=embed&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.