Archive for January 10th, 2011

January 10, 2011

Ordnance Survey National Grid Bing Maps App

Online web-mapping is a competitive business. There are Bing Maps, Google Maps, Yahoo Maps, Open Street Map, and many other providers. Until recently, Multimap.com was a popular mapping site here in the UK, partly because it presented Ordnance Survey maps and displayed OS grid coordinates under the map.

Like many countries that have their own national grid reference system, OS national grid coordinates are the standard coordinates used for mapping in the UK – they are also the format used for almost all data available from the British Government and other national agencies. When multimap.com was taken over by Bing, there was some concern voiced by users that the OS national grid coordinates were no longer displayed, replaced by the global hegemony of WGS84 latitude/longitude coordinates.

So, I took it upon myself to add back in the ability to display OSGB grid coordinates to Bing Maps, and creating a Bing Maps App seemed an ideal platform to do this.

Bing Maps Apps are Silverlight “plugins” that are published to and hosted on the www.bing.com/maps/explore site. A Bing Maps app typically overlays additional information (pushpins, polylines, or polygons) on the bing.com map representing a particular set of data, but it can also be used to add additional functionality to the map.

Gathering requirements for the app was easy – there were enough users bemoaning the loss of previous multimap features (“Why can’t we do xxx anymore?”) to work out what it had to do, and the calculations required to convert from latitude/longitude to grid reference are contained in a PDF document available from the Ordnance Survey website.

The coding experience itself was…. interesting. Writing Bing Maps Apps requires learning yet another SDK (which you download from the MS Connect site) separate from all the other existing Bing Maps family of products (e.g. the AJAX control, Silverlight, Windows Phone 7, SOAP and REST services). Many of these have similar features, namespaces, and classes, but they all differ slightly, and there were some head-banging moments when I tried to do things the way I was used to, rather than the “Bing Maps App”-way. Also, since Bing Maps Apps are plugins to an existing map (the one displayed at www.bing.com/maps), you don’t have to (and in fact, can’t) edit many of the properties of the underlying base map – only those defined in the layer used by your app itself. Again, I’m used to having full control over the page/app in which my map is displayed.

Some parts of development proved to be pleasantly simple, however. The debugging and testing from within Visual Studio, for example, was brilliant. And the deployment process was equally smooth – compile your app and upload it to http://www.bingmapsportal.com . You get an instant response from an automated test of your code, and then within about a week your app is published on the bing.com site – that’s it!

Here’s my OS National Grid app listed on www.bing.com: image

And here’s the app in action – displaying the OS Grid Square references at various resolutions for the current centre point of the map, together with the OSGB36 Latitude/Longitude:image

Follow

Get every new post delivered to your Inbox.

Join 53 other followers