0
votes

I'm using openlayers to display maps. I can display a Bing Road map layer, but when I add an Ordnance Survey layer (by changing road to ordnancesurvey) the layer displays but I get the following error:

Error: TypeError: providers is null
Source File: http://www.cabotscouts.org.uk/scripts/openlayers-2.12/OpenLayers.debug.js Line: 39605

Demo: http://www.cabotscouts.org.uk/scripts/test.html

Any ideas?

1
You seem to get that error when changing to any map style - it's not specific to the OS style... - Alastair Aitchison
But the error goes away if I don't add the OS layer: cabotscouts.org.uk/scripts/test2.html - Paul

1 Answers

0
votes

It looks like Bing doesn't provide imageryProviders (which has the attribution info) for OS, which causes the problem when OL tries to access it.

I've hacked my Openlayers.debug.js file to return if the providers is null (around line 39606)

if (!providers)
{
    return;
}