MTMaps is a Movable Type plugin that makes it easy to create Google Maps from your Movable Type blog entries. It's perfect for

  • Photo Blogging
  • Travel Blogging
  • Reviews
  • Urban Diaries
  • Collaborative Blogging

...or any other kind of blogging that relates to the physical world!

Using MTMaps

Using MTMaps is simple. All you need to do is:

  • Tag your entries with geographic information
  • Use MTMap template tags to display maps for your readers

MTMaps makes it really easy to tag your entries with a map location. When you edit a blog entry with MTMaps installed, a Google Map will be displayed. Just move that map to point to the right location, save the entry, and you're done!

Then, all you have to do place MTMap tags on your Movable Type templates to produce maps. You can easily produce maps showing:

  • Where all of your blog entries occurred
  • Where a single blog entry occurred
  • Or any other interesting location

Getting MTMaps

You can download the latest release here:

   MTMaps.zip

For installation and usage instructions, please scroll down to the User Guide.

Credits & Legal

MTMaps was written by Patrick Calahan.

MTMaps is available free of charge and is distributed under the Creative Commons License.

MTMaps includes and relies on the BigPAPI extension library written by Kevin Shay.





Version History

v0.6.1 (10/9/06) 
--------------
* Added per-blog enable/disable toggle to plugin settings

* Changed the default of the Mapdata Retrieval template to be
<MTEntryExcerpt no_generate='1'/>.  The default excerpt generation
in MT was causing some problems that would typically be manifest as
an error about " Can't call method 'words_in_excerpt'..."

* Fixed an incompatibility with Internet Explorer that would
typically result in pages failing to display with an (extremely helpful)
"Operation Aborted" message.



v0.6 (6/16/06) 
--------------
* Changed storage methodology to no longer use plugin storage - it's
just going to be a headache.  Instead, we now rely on unused MT fields 
(by default, EntryExcerpt) or other plugins (e.g. RightFields) to provide 
a place to store map tag data.  This is now configurable via two 
new config settings.

* Map tag data now stored in a single query-style string.

* Zoom and map type data now included in tag data.

* Map controls for new or unmapped entries now start at location of 
previously-saved entry.

* Fixed a bug that interfered with comment submissions.

v0.5 (6/10/06)
--------------
* Initial public beta release





MTMaps User Guide

Installation

To install MTMaps, just follow these steps:

  1. Download MTMaps.zip

    You can get it here: http://mtmaps.pcal.net/download

  2. Unzip it into your MovableType plugins directory
  3. Unzip this file into your Movable Type plugins directory. When you're done, it should like this:

    [MovableType Installation]/plugins/MTMaps/

    If you need additional help, please consult SixApart's documentation on installing plugins.

  4. Verify the Installation
  5. Log in to Movable Type and go to the 'Settings' section for your blog. Click on the 'plugins' tab. If you see MTMaps listed as one of the plugins, then it has been installed correctly.

  6. Add your Google Maps API Keys
  7. Click on the 'Show Settings' link for the MTMaps plugin. You will see that MTMaps needs to know the GoogleMaps API keys you will be using for your public site and (optionally) for your Movable Type host.

    If you don't have keys yet, you will need to get them from Google (it's very easy).

  8. All done!
  9. Now, whenever you create or edit blog entries, you should see a Google Map that allows you to easily 'tag' the entry with geographic coordinates (latitude and longitude). You can also use MTMaps' tags to easily display maps on your blog. Read to see how...

Adding Map Data to Blog Entries

To get started with MTMaps, you first need to have some blog entries that have mapping coordinates associated with them. MTMaps allows you to easily select the coordinates for an entry using Google Maps. The coordinates are automatically saved in Movable Type's database when you save the entry.

To add mapping data for an entry:

  1. Edit a blog entry (or create a new one).
  2. Notice that there is now a map displayed in the entry dialog, along with two new fields, latitude and longitude.
  3. Scroll the map to the location you'd like to associate with the entry. You can use all of the standard Google Maps controls for moving, dragging, and zooming in and out.
  4. When you have the precise location, click on the map. A marker will appear, and you'll see that the latitude and longitude fields are updated to reflect the coordinates you've selected.
  5. Click 'Save' to save the changes to your entry.

Displaying Maps using Tags

Once you have some entries with map data associated with them, you need to add MTMaps tags to your Movable Type templates.

NOTE: In the body of a blog entry, you normally can't use MTMap tags (or any other tags, for that matter). If you really need to put MTMaps or other tags in your entry bodies, there are some other plugins, such as ProcessTags that may help.

Here is how to display several different kinds of maps you might typically want to display using MTMaps tags. For more details on how the tags work, please see the tag reference.

Display a single map on your blog showing the locations of your entries

On an index template, simply create a map with MTMap and loop through all of the entries. In the body of the entry loop, place an MTMarker.


<MTMap>
  <MTEntries>
    <MTMarker/>
  </MTEntries>
</MTMap>
  

If you want to customize the HTML which appears in the popup info windows for the markers, you can do something like this:


<MTMap>
  <MTEntries>
    <MTMarker>
    
      <table><tr>
        <td><img src='/images/myimage.png'></td>
        <td><b>Customized content for '<$MTEntryTitle>'</b></td>
      </tr></table>

    </MTMarker>
  </MTEntries>
</MTMap>
  

Display a map of an individual entry

Add an <MTMap> tag within an <MTEntries> tag of any MT template you use to display entries. For example, you could modify the default 'Main Index' as follows to add a map to the bottom of each entry on your main page.

...

<div id="center">
<div class="content">

<MTEntries>

...

<$MTEntryBody$>
...

  <center>
    <MTMap>
      <MTMarker/>
    </MTMap>
  </center>
    

</MTEntries>
...

Display a single map of an arbitrary location


<MTMap lat='37.76053707395286' 
       lng='-122.38726615905762' 
       zoom='10' 
       maptype='G_MAP_HYBRID'
       width='150'
       height='150'>
  <MTMarker/>
</MTMap>

Display a map of an arbitrary location


<MTMap lat='37.76053707395286' 
          lng='-122.38726615905762' 
          zoom='10' 
          maptype='G_MAP_HYBRID' />

Display a map of an arbitrary location with an info marker


<MTMap lat='37.76053707395286' 
          lng='-122.38726615905762' 
          zoom='10' 
          maptype='G_HYBRID_TYPE'>
  This is a street in San Francisco. 
  (<a href='/info.html'>more info</a>)
</MTMap>

Tag Reference




<MTMap>

Displays a google map on your blog.

<MTMap> can be used as either a variable (closed) tag or as a container tag. If the tag is closed, it simply displays a map using the given attributes and with no markers.

If used as a container tag, the body should contain <MTMapMarker> tags to specify markers that should appear on the map. Note that you must not generate any HTML within an <MTMap> tag - the body should contain only <MTMapMarker> tags or looping and conditional tags.

An <MTMap> tag can include any of the following attributes:

AttributeUsageDefault
lat The latitude at which the map will be centered The latitude of the entry in context
lng The longitude at which the map will be centered The longitude of the entry in context
width The width (in pixels) of the map to be displayed 300
height The height (in pixels) of the map to be displayed 300
zoom The zoom level of the map (1 = zoomed in, 15 = zoomed out) 3
type The type of the GMap to be displayed.
Must be G_MAP_TYPE, G_SATELLITE_TYPE or G_HYBRID_TYPE.
G_MAP_TYPE




<MTMapMarker>

Displays a marker on a map.

An MTMapMarker must appear within the body of an MTMap tag.

<MTMapMarker> can be used as either a variable (closed) tag or as a container tag. If used as a container tag, the body should contain HTML that will appear in the info window that pops up when the marker is clicked.

An <MTMapMarker> tag can include any of the following attributes:

AttributeUsageDefault
lat The latitude at which the marker will appear The latitude of the entry in context
lng The longitude at which the marker will appear The longitude of the entry in context
icon A valid javascript reference to a GIcon for the marker G_DEFAULT_ICON




<MTMapHeader>

Includes javascript functions required for MTMaps.

Use this tag only if your page needs to access the GoogleMaps API prior to the first appearance of an MTMap tag.

MTMap tags normally ensure that the Google Maps API is included exactly once on a page. This tag simply includes the API and lets subsequent MTMaps tags know that it has already been included.

MTMapHeader can be used only as a variable tag and takes no attributes.