tGoogleMap – an inline Google map plugin for WordPress

tGoogleMap is a WordPress plugin that creates inline Google maps in your WordPress posts. There are two main advantages over other existing Google maps plugins and they are:

  1. Ease of use, to create a Google map simply type tGoogleMap(mapdata.xml, 600, 480) in your post on its own line.
  2. tGoogleMap uses XML map data, this allows for maximum configurability, and supports multiple points and lines.

Please note, this is my first attempt at any ‘real’ php coding and my first attempt at creating a WordPress plugin. I am pretty sure I have not coded things optimally, the main thing is it does work. I have tried to minimise the return of errors and the plugin not working. Comments welcome on any suggestions or bugs.

tGoogleMap(example.xml)

Few notes:

  • a markers folder is included with numbered pointers, these are used only when icon=”x” (where x is an integer), if this is excluded or pointers are alphabetical default Googles pointers will be used.
  • if width and height is excluded, the default width and height (460 and 345 respectively), found in the configuration page will be used.
  • tGoogleMap automatically centres and zooms in on the points and lines, this may not always give the best results.
  • tGoogleMap will produce a Google map only if the XML file is found, this was made so that examples i.e. tGoogleMap(mapdata.xml) could be posted without producing a Google map.
  • tGoogleMap searches post text using the_content and replaces valid tGoogleMap with HTML and Javascript to produce a Google map. This might not be the best way to achieve this.
  • Only 1 Google map per post with be converted, however, multiple maps can exist when multiple posts are displayed.
  • tGoogleMap produces valid XHTML.
  • tGoogleMap has only been tested on the default Kubrick theme, WordPress version 2.3.2.

Download tGoogleMap


Posted

in

by

Comments

One response to “tGoogleMap – an inline Google map plugin for WordPress”

  1. Alexdan Avatar
    Alexdan

    I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *