Development Seed

Blog

Working on a WMS Mapping Module for WordPress

Exciting Geo Capabilities for WordPress

I got to spend some time the past couple weeks digging into Wordpress’s geo capabilities. Many Wordpress sites have been geotagging content for years, and they’ve already been inventing ways to display that existing information on Google and Yahoo maps. The only thing missing was a module that lets users put their content on new, custom maps that can be more attractive and flexibly licensed using something very close to the Nice Map module for Drupal.

A little background regarding Wordpress and geotagging is helpful to see this need in perspective to the other great geo work done already. Much like the state of geo-modules in Drupal, Wordpress has had quite a few approaches to similar problems. It appears that Wordpress 1.2 included functionality for geotagging posts, which was removed from the distribution when 2.0 added stable plugin support. At that point the plugin Geo was developed, but development faded quickly – the plugin hasn’t been updated since 2005. Then a trio of new geotagging plugins was created. Geo-mashup was the first, and has been consistently updated for three years. Next came WP Geo, which also focuses on tagging blog posts and outputting Google Maps API maps. GeoPress is the newest entry and a very interesting pick – instead of interfacing directly with Google Maps, it uses Mapstraction to generate Google, Yahoo, or Microsoft maps with a quick configuration change.

There is a great opening for a WMS client like we did for Drupal, and with some time over the holiday I started coding a Nice Map module for Wordpress. The module is currently a bit different than Nice Map for Drupal and any of the other Wordpress plugins. Instead of providing a backend interface for adding locations to posts, it uses data already saved by WP Geo or Geo-mashup (and soon, GeoPress). It should be a drop-in replacement for people who have been using Google Maps for years and want more control over their maps. The plugin also doesn’t introduce more new code in its WMS client. We’ve made the great WMS client in Nice Map into a module that works anywhere PHP 5 works. If you’d like to create a WMS client for your favorite CMS, it’ll soon be a lot easier when there’s a simple PHP API to hook into.

We have a few more ideas about the future of mapping plugins for Drupal and Wordpress. A solution like Mapstraction seems to be a step in the right direction, making draggable maps vendor-neutral and giving people the option of using the great, Creative-Commons-licensed OpenStreetMap on their site. Ideally the same data in Wordpress or Drupal can be piped into different plugins and seamlessly generate maps from Google Maps, OpenStreetMaps, or free WMS maps, giving users great style and functionality options for their geotagged data.

Back to work on the module – I hope to have something out by the end of the week and another post with details. Excited for feedback.

Integration of GeoPress & Nice map

Great to hear you’ll be integrating into GeoPress. I’m finishing up a number of new features that will be out soon along with updates to Mapstraction.

I wonder if there is potentially a better integration to WMS that makes it appear as another “provider”, similar to the ability to choose Google, Yahoo, OSM or other base tiles using the existing admin interface.

That would be great, and

That would be great, and that’s exactly the purpose I have in mind – just making the specifics of map output easily switchable.

Although I think it would be possible to bolt WMS onto Mapstraction, it makes a lot more sense to do it without all the Javascript (since the maps Nice Map makes are really lightweight, just a few lines of CSS + JS involved), by overriding the geopress_map function. Would it be possible to have that be pluggable in the future?

Also, I’m interested as far as your thoughts on storing geo-data in Wordpress: it looks like all three of the main plugins (and Wordpress Geo, which I’m going to ignore, since it’s three-years-stale) have their own format. The difference between geo-mashup and WP-Geo is very minor, while GeoPress has a pretty cool, more complicated/sophisticated layout. Really my dream solution would have location input, GeoRSS output, and map output as solid interchangeable parts, and a little more homogeneity in data.

—Tom

WP Geo storage

With GeoPress we designed it to be able to link posts to arbitrary geometries: points, lines, polygons, multipolys, bbox, etc. From what I’ve seen that’s one key difference.

In addition, it’s meant to be super-easy for the author to create and embed maps. For example, using stored location names or placenames rather than requiring either lat/lon or clicking on a map as the only input options (though these are supported as well).

I think there could be some breaking out of these components – though you’re definitely showing your Drupal-oriented design principles :) WordPress users don’t really like lots of parts, but simple “install and forget” plugins. Though adding WMS connection is most likely an advanced, small group of users (for now).

We should meetup and chat about this more in-depth since we’re both DC local-ish.