[GIS] OpenLayers transform EPSG 27700 coordinate to Google 900913

coordinate systemepsgopenlayers-2proj

Community,

I'm currelty capturing my mouse click event and trying to transform the coordinates into Long Lat. I need to get at the Long Lat as strings so I can build a url and throw it at Google Street view. Current transform code only prints the BNG coords.

lonlat = map.getLonLatFromPixel(e.xy);

brit = new OpenLayers.Projection("EPSG:27700");
google = new OpenLayers.Projection("EPSG:900913");

lonlatclone = lonlat.clone()
lonlatclone.transform(brit, google)
//alert("You clicked near " + lonlatclone.lat + "N," + +lonlatclone.lon + "E");

Thanks!

Best Answer

Did you import the proj4js definitions for EPSG:27700? http://spatialreference.org/ref/epsg/27700/proj4js/

27700 is not included by default.