My recent posts and dive log entries about my trip to the Socorro Islands have gotten a lot of people asking about how I create the map with post excerpts on this website. I’ve been slow about writing it up because quite frankly the process has been changing over the past week or so. I started doing this as a way of logging my dives, which I have not done since I was a teenager. When people ask how many dives I have, I honestly have to answer that I don’t know because I stopped logging just after dive number 200. Since dive log book had no real value to me, I found no reason to continue using them. Lately, however, I began asking myself how I might log my dives in a way that could be valuable to both me, and others as well.
I had a few requirements.
- First, I wanted to use this blog as my dive log book.
- Secondly, I wanted to record and display the GPS coordinates of the dive site. I also wanted to leverage the Google Maps API to display these sites on a map.
- Finally, I wanted to record and display the information that I believe is important about the dive. For instance, I don’t care to record the water temperature and whether or not I wore a hood, but I did want to record and display information about gas choice, max depth and bottom time. I also wanted to record and present information about deco schedule.
The first phase, and the only one that I have completed thus far is to record and present GPS information about the dive site. When I first implemented this, a total of three WordPress plugins were required. “Geo Mashup” was used to create the map page with the post excerpts, “Geo” was used to enter the GPS coordinates into the “wp_postmeta” table, and “bsuite-geocode” was used to search the post text for links to Google Maps, strip out the GPS coordinates and enter them into “wp_postmets” if they exist. It also created a “Location” link to the post excerpt on the map page.
This was all before the final release of Geo Mashup 1.0, however. This is now the ONLY plugin that is required to create the map with post excerpts. In fact, running either “Geo” or “bsuite-geocode” will prevent “Geo Mashup” from working correctly after version 1.0.
Version 1.0.1 of the Geo Mashup plugin creates a nice little Google Map in your “Edit Post” or “Write Post” window that can easily be used to enter GPS data about the post. The only downside is that there is no way to display a link to the map from your post without adding the following code to the loop in your theme:
< ?php GeoMashup::show_on_map_link('link_text') ?>
Sadly, the “bsuite” plugin I use to create the “Tags” and “Related” stories section at the end of my posts takes over the bottom of the post entirely, meaning that map link would need to go below that. Since I think the “Related” section ends the post nicely, I have not incorporated this code into my theme yet. I have brought this up with Casey, who says he will allow the user to control where the bsuite functions display in the next version, which is soon to come out.
Clearly I still have some work to do with respect to displaying dive information and deco graphs, but that should be coming soon. Hopefully I will be able to release a DiveLog WordPress plugin once I get it all hammered out. Stay tuned.