Simple Google Maps plugin for wordpress

What is it?
This is a demo post for a little plugin I wrote that uses custom fields in Wordpress together with Google’s HTTP geo coding API and Google Maps to produce a map with a marker in the post. The current version (0.5) of the plugin takes the following custom keys and use them to geocode the location (Zip, City, Address, Country) and also display them in the info window popup in the map. Keys marked with a * are required for the plugin to output the map.

  • Zip
  • City*
  • Address
  • Country*
  • Phone
  • Misc

Installation and useage

  • Download the plugin file and upload it to your plugin directory.
  • Activate the plugin.
  • Go to Google Maps API and sign up for an API key.
  • Go to the GMaps plugin configuration page (in Options) and enter your API key (and select default Zoom level).
  • In your header.php template file, change <body> to <body onload="load()" onunload="GUnload()">.
  • Make a new post.
  • Add at least the City and Country custom keys, and add the tag [ GMaps ] (without extra spaces) where you want the map to render.
  • Done!

Download

GMaps plugin v0.5 (downloaded 254 times)

Plugin output

Popularity: 11% [?]

7 Comments Posted in PHP, Wordpress

7 Comments

  1. Hi,
    and very thank you for this very simple plugin.
    Could you tell me how to insert the map from the sidebar or anywhere outside the post ?

    Kind regards,

    uentin

  2. Hi Quentin.

    If you put < ?php echo GMaps_main(); ?> in your template where you want the map to appear it might work, but only in single post view.

    Haven’t tried though.

    /Jesper

  3. thats great. have you any idea how to put a rectangle on the map?

    Thanks a lot,

    Pete

  4. Yu should specify where to add the city and country code.Else how can others understand??

  5. Hey Jasper
    Great simple plugin! Thanks!
    I have it working perfectly right now, but I would like the white bubble to show/have a link to “get directions to” etc

    Do you have any resources I could check out or tips for me?

    Thanks!
    -britt

  6. Hi i installed the plugin, added the custom code to the header.php file but nothing loads on my page… i have specified address like this:

    5 xxxx avenue
    suite xxx
    city, state, zip
    country

    am i doing something wrong?

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>