I am trying to incorporate a wms feed in the British national grid projection (EPSG:27700) into a openlayers 3 project. I initially had used this wms layer in an openlayers 2 application using the following syntax:
new OpenLayers.Layer.WMS(
"ukimage",
"http://www.linktowms",
{
"LAYERS": 'ukimage',
"STYLES": '',
format: state.image_format
},
{
buffer: 0,
displayOutsideMaxExtent: true,
isBaseLayer: true
}
);
But I am having trouble converting this over to openlayers 3. I first tried setting the map projection to British national grid (view: new ol.View({ projection: 'EPSG:27700'}) as I had in the openlayers 2 app, but this produced the error
TypeError: h.B is not a function
and a white map.
When I try and use proj4 to convert the projection to EPSG:3857 as described here: http://openlayers.org/en/v3.15.1/doc/tutorials/raster-reprojection.html I get the same error:
TypeError: h.B is not a function
and again a white map.
my wms request is generally a varient of:
new ol.layer.Image({
source: new ol.source.TileWMS({
url: 'http://www.linktowms',
params: {'LAYERS': 'ukimage'},
})
}),
(I tried adding projection but that didn't help)
I am trying to work out if the image is even getting loaded from the WMS feed, but the syntax seems to have changed significantly from openlayers 2, instead of the properties and functions that have rather descriptive names, there are a now lots of short functions with names like Ua and Ig, which leaves me a bit in the dark as to what's actually going on when I try and inspect the layer with firebug.
I don't mind what projection the application is in, as I can re-project my other layers to match the basemap, so basically any way of using this EPSG 27700 WMS layer in openlayers 3 would be great.