Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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 " + + "N," + +lonlatclone.lon + "E");


share|improve this question
up vote 3 down vote accepted

Did you import the proj4js definitions for EPSG:27700?

27700 is not included by default.

share|improve this answer

For any projection different than EPSG:4326 and EPSG:900913 you need to attach the proj4js project with projection definitions

share|improve this answer

EPSG:900913 (which is deprecated, you should really be using its modern synonym EPSG:3857) is a projected CRS, not lon/lat. So if you want a spherical mercator result, you'll need to transform from lon/lat to EPSG:3857, skipping EPSG:27700 completely.

Or if your getLonLatFromPixel() results are in EPSG:27700, you'll need to use EPSG:4326 as your destination.

share|improve this answer
thanks for the info. Now using 4326 – geo_james Feb 22 '12 at 13:07

Have you tried this?

var newLonLat = lonlatclone.transform(brit, google);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.