Are you using Google Maps to generate the code? If so, they should give you an iframe or embed code. You can switch to HTML while editing a post/page and insert the code where you would like to display the map.
Or, you can use my plugin, and it will add a button for inserting iframes and embed codes for you, if you don’t like HTML. All you’ll have to do is paste the code Google gives you.
I’m not using the iframe or the embed code to make the google map. I need to have a map made from an external file and have a side bar with the map. Like the one that is linked above.
Embedding a map from the iframe or embed code works nice and easy. But getting that sidebar to work with the map seems to be very difficult. It seems that in order to have a sidebar with the map that pulls the info from the map, the map has to be made with the Maps API. Which is fine for a html website. But for some reason every time i try (many different ways) to put that code into wordpress the map breaks in many different ways.Mod
and other code that goes in the <head>
Attach it to the
wp_head()action hook. See this: http://codex.wordpress.org/Function_Reference/wp_headAdminQuote:But for some reason every time i try (many different ways) to put that code into wordpress the map breaks in many different ways.
I may be wrong, but I think WordPress strips out
<iframe>by default, which is why the normal Maps embed code don’t work.Mod
Okay, here’s a really weird idea, but it might be what you are looking for.
Try creating just a plain vanilla html file that contains the code for the map and the sidebar like in the link you provided. (Which is very, very interesting…I have never seen Google maps for this purpose.) Upload that to some safe place on your blog, and then use an
<iframe>to place that file on your blog.
Completely untested, but all my brain can come up with right now.
That is the only way I could get it to work. I didn’t know if a
<iframe>would be the best way of doing it. I was trying to get it to work within wordpress, but everything i’ve tried doesn’t work. (
(Which is very, very interesting…I have never seen Google maps for this purpose.)
Why is this such an odd way of doing it? How else could the data be displayed on the map with a usable sidebar?
I think Ken was commenting on how cool and “fun” this usage of google maps is. Usually, we see it for a business location, or a tourist attraction… never have we seen it used as a “route” with multiple “stops”. I love the idea also!!
I don’t know very much about the google maps api. I’ll try to take a look at it and see how they are reloading that map without having to reload the entire page. I would imagine each link in the sidebar has a script associated with it when you click it… which then loads the corresponding map.
Although I have no idea… but I’ll try to learn a little about it.
You must be logged in to reply to this topic.