Clagnut

Menu

Geotagged blogs on Multimap

§ Blogging · Mapping & Geospatial

A few months ago I explained how you could get your blog into Multimap’s local information facility by linking to an appropriate map. Well now there’s a new method. For the past month Multimap has been populating the database with geotagged blogs and now has nearly 4,000 mapped. You can geotag your blog by adding meta data like this:

<meta name="geo.position" content="latitude;longitude" />

Where latitude is followed by longitude and separated by a semi-colon. Make sure you specify the correct format for your coordinates. The values of lat and lon should both be decimal with latitude and in the range -90 to 90 and longitude in the range -180 to 180. Positive latitudes are north of the equator, positive longitudes are east of the Greenwich meridian. For example:

  • right: <meta name="geo.position" content="50.8183;-0.1106" />
  • wrong: <meta name="geo.position" content="50.8183N;0.1106W" />
  • wrong: <meta name="geo.position" content="50:49:06;-00.06:38" />
  • wrong: <meta name="geo.position" content="5049'06N";0006'38"W" />

Update: Multimap also looks for ICBM tags which are constructed in exactly the same way, but with the coordinates separated by a comma instead of a semi-colon, eg.

<meta name="ICBM" content="50.8183,-0.1106" />

You can find the coordinates of your chosen location (perhaps your house, office or just the centre of your city) using Multimap – the latitude and longitude of any location is displayed in the Map Info box below every map.

Multimap uses weblogs.com as its source of blogs. Every now and then a script grabs the weblogs.com XML feed and visits each blog looking for geo tags and extracts the coordinates where it can. If you want to get into Multimap’s index this way, add your geo tags and then make sure the weblogs.com XML feed is up, as it is down quite a lot, either missing, requiring authentication or not well-formed (alternatives anyone?). Then ping the weblogs feed – I recommend you use Pingomatic.

I’ve created a couple of handy bookmarklets to show maps and nearby blogs. If you click them on a geotagged page they will show a map of the page location. Drag these links to your bookmarks/favourites bar:

By way of explanation, here’s the show map bookmarklet written in long hand:

// grab all the meta tags on the page
var metatags=document.getElementsByTagName('meta');
var geoloc=null;
// loop through all the meta tags
for (var i=0; i<metatags.length; i++) {
  // extract geo.position value if present
  var name=metatags.item(i).getAttribute('name');
  if((name=='geo.position' || name=='ICBM') && metatags.item(i).getAttribute('content')) {
    geoloc=metatags.item(i).getAttribute('content');
    break;
  }
}

// use regex to extract the latitude and longitude
var re=/^([d-.]+)s*[,;]s*([d-.]+)/;
if(geoloc) {
  if(re.test(geoloc)) {
    var lat=RegExp.$1;
    var lon=RegExp.$2;
    var mqURL='http://www.multimap.com/map/browse.cgi?';
    mqURL=mqURL + 'scale=25000&icon=X&lat='+lat+'&lon='+lon;
    document.location=mqURL;
  } else {
    alert('Couldn't parse location: '+geoloc);
  }
} else {
  alert('No location meta-tag found.');
}

The bookmarklets were created via the wonderful Bookmarklet Crunchinator.


Fatal error: Call to a member function getAttribute() on a non-object in /home/clagnutc/public_html/includes/thirdparties.inc.php on line 97