[OpenLayers-Users] Using British OS National Grid-based WMS in
openlayers... how?
Nick Whitelegg
nick at hogweed.org
Tue Oct 31 16:55:29 EST 2006
Hello,
I'm developing a mashup application which combines scanned historical maps
from npemap.org.uk with data from OpenStreetMap. It's projected in British
National Grid (Airy projection I believe). I have developed a WMS server
which accepts a bounding box of British National Grid eastings and northings,
eg
http://nick.dev.openstreetmap.org/openpaths/freemaptest.php?bbox=
489000,128000,490000,129000&width=250&height=250
Valid easting ranges are approximately 0 to 600000 for eastings and 0 to
500000 for northings.
I understand that OpenLayers will take any units for bounding box, not just
latitude and longitude, so I should be able to use OpenLayers to do a slippy
map for this. However I don't know what value to use for the zoom. I've tried
a few values from 13 down to 0 but can't get a sensible bounding box centred
on the area I want to make as the default (easting 489600, northing 128500).
Any ideas how I should tackle this? Code experiment below....
Thanks,
Nick
var map;
var popup = null;
var mode = 0;
function init()
{
map = new OpenLayers.Map('map');
var npe = new OpenLayers.Layer.WMS( "npemap",
"http://nick.dev.openstreetmap.org/openpaths/freemaptest.php",
{ 'layers' : 'areas,srtm,osm', 'datasrc' : 'osm' } );
map.addLayer(npe);
map.setCenter(new OpenLayers.LonLat(489600,128500), 3);
}
More information about the Users
mailing list