views:

44

answers:

1

I have a Web Application that displays a Map Service that is in NAD 1927 UTM Zone 15N. I have JavaScript code that displays the XY in status bar based on where mouse cursor is on that map. I want to display Latitude/Longitude values instead. Does anyone know how?

A: 

There is a javascript port of the proj.4 projection system called proj4js. proj.4 allows converting from grids to lat/long and vice-versa.

mtrw
This sounds promising mtrw. I don't suppose you have any quick code to show me how to implement this? I see there is some documentation that I will start reading up on.
Josh
@Josh - I'm afraid not. I've used `proj.4` in desktop stuff, but I've never done any web development.
mtrw
mtrw- How did you get this installed? My OS is Windows XP. All the files that came from the zip file are readable in wordpad but I'm confused
Josh
@Josh - I've only ever installed `proj.4`, which is the original C-language version. If you want to try that, it's available at http://trac.osgeo.org/proj/ (look under the "Binaries" section for prebuilt files). You can use `invproj` from the command line for the calculation you're looking for. But getting it into a browser is outside my abilities, I'm afraid.
mtrw
@Josh - Does a c# solution work for you? See http://stackoverflow.com/questions/1867950/is-there-a-free-net-library-to-convert-osgb36-to-wgs84/2129570#2129570
mtrw
Hi mtrw- I really need it in javascript if at all possible. I'll take a look at what you posted to see if this can help. Thanks,
Josh