This is my OSM layer in openlayers 3.9.0.
var layer = new ol.layer.Tile({
source: new ol.source.OSM(
{
attributions: [
new ol.Attribution({
html: 'All maps © ' +
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
})
]
}
),
opacity: 0.8,
brightness: 0.8
});
And now I want to get the EPSG code
of the layer to check it so I do like
var a = layer.getProjection().getCode();
alert(a);
and I get the error layer.getProjection is not a function
.
What am I missing?
Please help me