[OpenLayers-Users] Using British OS National Grid-based WMS in openlayers... how?

Christopher Schmidt crschmidt at metacarta.com
Tue Oct 31 16:09:25 EST 2006


On Oct 31, 2006, at 4:55 PM, Nick Whitelegg wrote:

> 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....

Seems like you're looking for the information in:
http://openlayers.org/pipermail/users/2006-October/000067.html

in other words, your map should be constructed with an options array:

{
    maxExtent: new OpenLayers.Bounds(0,0,500000,600000),
    maxResolution: 'auto',
    units: 'meters'
}

maxResolution 'auto' can be changed to any reasonable value:  
reasonable is typically 'width of maximum extent in units of the map  
divided by the width of the div in which it is being displayed'.  
Setting this to a fixed value allows you to cache the results for  
different browser windows, which maxResolution 'auto' does not allow.

Regards,
-- 
Christopher Schmidt
MetaCarta





More information about the Users mailing list