Version 1.1
It's out, it's live, it's here! Please try to contain yourself....
Download GeoSpatialSimple version 1.1 by clicking here.
Updates/Changes in this version include:
- Compatibility with older versions of MySQL
- IE6 Javascript error fixes
- Compatibility with MovableType 4.2 (currently in beta)
- Clicking on map piks will now popup the little balloon (if you have that option selected)
(I was planning to add support for the new Google Earth browser plugin, but it looks like it's just "too new". There is too much inconsistent behavior to make it worthwhile. We'll save that for the next version...)

Thanks Bryan! Works like a champ now!
Posted by: | June 04, 2008 at 07:17 PM
Thanks! It works with my database now. I'm still doing set up, but it looks good!
Posted by: Jonathan Rawles | June 06, 2008 at 07:34 AM
It does work. Thank you!
Posted by: Jonathan Rawles | June 06, 2008 at 10:48 AM
Great work, Bryan! I'm a MT n00b but got this installed without any hiccups on 4.1.
I'm not confident that I understand how to use the various tags but is there a way to include a track or breadcrumbs between two points on the map? My wife and I are moving across the country and would like our friends and family to be able to see where we are and where we've been during the trip.
Posted by: drawfire | June 18, 2008 at 08:28 AM
@drawfire - Yes, a map like that is definitely possible, although you'd use the Google Maps API (in javascript) to do this. If you follow section C of the instructions to make a map with all of the map points, then it would not be too much work to make lines that go from the first point to the next, and so on.
I really recommend you read the Google Maps API documentation (http://code.google.com/apis/maps/). The tags for the GeoSpatial plugin are fairly simple and give you the locations, but with some extra javascript you can do a lot more.
Posted by: Bryan Tighe | June 18, 2008 at 09:38 AM
Bryan, thanks so much for the prompt reply. I've come to realize that I'm way out of my depth here. Everything appears to be okay except that I can't seem to get a map to appear in any posts... just the title and text of the entry. I'm guessing this is an issue with template modifications (?).
I've got the header modified, and all the right fields show up in the "create post" page. Could you give me a hint on which template to modify so that I can get maps to display on the main page?
TIA
Posted by: drawfire | June 21, 2008 at 10:07 AM
@drawfire - If you want maps to appear for a post, then you can insert the proper tags into the Entry Summary and Entry Detail templates. (Entry Summary is used for displaying posts on the main page, and Entry Detail is used when you're viewing a post by itself.) Or, you could put the map tags in the Metadata template, because this is included by both the Entry Summary and Entry Detail templates.
If you want to make a map with all of the locations on it, then you will need to modify the Main Index template (assuming you want your map on the front page), or you can make another template just for the map and link to it from the front page.
Does that make sense? If you need more help on managing templates, I would suggest the movable type support forums.
-Bryan
Posted by: Bryan Tighe | June 21, 2008 at 07:02 PM
Bryan, thanks again! That got me on the right path and I think I can figure it out now. Thanks very much for your patience.
Posted by: drawfire | June 23, 2008 at 12:54 PM
Hi, Great Plugin
Having problems running in a multi-blog environment. I have several blogs with different urls. The plugin shows up only in the system overview, and only allows one google api key. I also get nuisance alerts when I am creating entries on different blogs that the api key is not correct. Is there a way to install the plug in so that it only applies to one instance of the blog?
Thanks again
Posted by: Vince | July 29, 2008 at 03:31 PM
@Vince,
Sorry, right now it only works for all blogs instead of on an individual blog basis. If you understand perl, you're welcome to hack the plugin to get this to work. I'll look into making this change soon.
(Google's API Key will continue to give you an error if it sees a different URL than the one you registered with.)
Posted by: Bryan Tighe | July 29, 2008 at 03:45 PM
Bryan,
This seems like a very nice plugin. I am running into a problem and I'm wondering if you have any advice on this.
I would like to overlay a non-standard map in all of the map displays in my web-site. I have a .kmz file which includes the map image, and I modified the function initialize_$id
to:
function initialize_$id() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas_$id"));
var geoXml = new GGeoXml("http://knownworld.theennead.com/kmz/map.kmz");
map.addMapType(G_PHYSICAL_MAP);
map.setCenter(new GLatLng($lat, $lon), $zoom);
map.setMapType($display);
map.addOverlay(geoXml);
adding the "var geoXml ..." line and the "map.addOverlay(geoXml);" line. I would expect this to overlay the contents of the kmz file, but it doesn't.
Here is an example test page: http://knownworld.theennead.com/things/archives/test_map.php
Here is the kmz file I am using: http://knownworld.theennead.com/kmz/map.kmz
Any thoughts on whether there is anything about the way that the plugin handles this that I am missing would be greatly appreciated.
thanks,
Charles S
Posted by: Charles S | September 01, 2008 at 02:42 AM
Never mind on the previous comment. The google maps api doesn't support .kmz, just .kml, so that is why my previous attempt failed.
Now that I have things working, I have a different question. The pop-up balloon doesn't seem to resize to match the balloon text. Is there some way to fix this? Also, hypertext links within the bubble text fail to work properly because of the lines:
$bubble =~ s/'/#39;/gi;
$bubble =~ s/"/#34;/gi;
in the subroutine geospatial_showmap.
Commenting out those lines allows hyperlinks to work properly, and I'm not seeing what bugs or security holes those substitutions protect against. Am I missing anything?
Thanks.
Posted by: Charles S | September 01, 2008 at 10:25 PM
Charles S,
You can probably find the ability to resize the balloon text in the google maps documentation. However if the text is large, there is a limit to the size of the balloon, so it may overflow no matter what you do if your text is too long.
And you're right, these lines should be removed:
$bubble =~ s/'/#39;/gi;
$bubble =~ s/"/#34;/gi;
and replaced with:
$bubble =~ s/"/\\"/gi;
$bubble =~ s/'/\\'/gi;
The reason the first lines were there was to make sure that any bubble text that contained an apostrophe or quotes would work in the javascript (because the bubble text is loaded through javascript). The fix will make all html tags work, since many tags use quotes such as the a tag. Sorry about that, I guess I overlooked it.
Posted by: Bryan Tighe | September 02, 2008 at 12:03 PM
I should have posted this here, rather in the other post, since I was using version 1.1. Sorry.
After I install the plugin, enter the Gmap api, and then put the one tag in the header, I get this error.
Smarty error: [in evaluated template line 12]: syntax error: unrecognized tag 'mtgsheader' (Smarty_Compiler.class.php, line 580)
This is using MT4.2. Help?
Posted by: Mike | September 16, 2008 at 11:03 AM
This plugin hasn't been tested in dynamic mode (which is what you're using if you get PHP errors). Can you post a link to your blog so I can check it out?
Posted by: Bryan Tighe | September 16, 2008 at 02:06 PM
Blog isn't public. I'll try with static pages and let you know. (You're right -- I am, in fact, using dynamic pages.)
Posted by: Mike | September 16, 2008 at 03:18 PM
Yep, that was it! Thanks. I just needed to switch to static pages.
Posted by: Mike | September 18, 2008 at 08:56 AM
One last question. Can't figure out how to get the zoom/direction display on a map that has all entries. (It's easy to do for individual entry maps, but don't see code for maps with every entry on it.)
Posted by: Mike | September 19, 2008 at 01:41 PM
Mike - You'll have to do that in javascript, there's no MT plugin code that does it. I highly recommend that anyone attempting to do more than the basic mapping stuff with this plugin read the Google Map API docs: http://code.google.com/apis/maps/ .
You could add the map controls like this, for example:
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
Posted by: Bryan Tighe | September 19, 2008 at 03:57 PM
Hi Bryan,
Great plugin. One minor issue: I noticed I get XHTML transitional validation errors on pages where I choose to include a map pik, but not on pages where the map pik is hidden.
Here's a comparison:
http://www.jasoncook.com/2008/07/rome-da-baffeto-tonino.html
(no pik, validates OK)
http://www.jasoncook.com/2007/04/egg-hunt.html
(includes pik+description, doesn't validate)
Also, I'm not sure if this is just me, but when doing a backup of my site in MT, I always get the following error:
Backing up GeoSpatialSimple::Location records: There were no GeoSpatialSimple::Location records to be backed up.
Any idea why that's happening?
thx
Jason
Posted by: Jason | October 16, 2008 at 03:10 PM
I'm having a very weird problem. Code was working fine. Now it's not, and code didn't change. The map is completely invisible. However, I've made some adjustments to get it to show up partially, which I'll describe below.
http://www.seiu.org/vote2008/index.php
One thing the code did/does was say category="gotv 2008" for mt entries. Again, this was working fine until a few days ago. Now the only way I get the map to appear AT ALL is to say lastn="30." (or lastn="20" lastn="25" etc) However, there are more than 30 entries in the category, so that's not a solution. If I say lastn="31" (or more), then the map is blank... which is same thing that happens if the lastn is taken out completely.
Thoughts?
Posted by: Mike | October 29, 2008 at 02:18 PM
And I've tried deleting the 29th, 30th, and 31st item. So it's not something specific to an entry, I don't think.
Posted by: Mike | October 29, 2008 at 02:53 PM
Figured this out. I used an apostrophe in the title, which messed with the JavaScript.
Posted by: Mike | October 30, 2008 at 06:53 AM
Mike, I'm glad you figured it out. As for the apostrophe thing, if you look up to a comment I wrote to "Charles S" about his similar problems, you'll see a solution. I haven't had a chance to release another version of the plugin with this fix yet, though. Thanks for using the plugin!
Posted by: Bryan Tighe | October 30, 2008 at 09:47 AM
Bryan,
I'm having an interesting issue where I have multiple maps being displayed on newer posts.
On my first post, (I display map in the sidebar), it shows the correct map for the post.
On the second post, map for first point and map for second post are displayed.
On the third post, three maps for three points are being created.
The code I'm using in my template is:
Posted by: ivan | November 02, 2008 at 09:57 PM