[ka-Map-users] longitude and latitude

Paul Spencer pagameba at magma.ca
Wed Jun 15 07:22:41 EDT 2005


Hi,

in the head CVS version, there are now some functions to help do this:

kaMap.getGeoExtents()
kaMap.pixToGeo()
kaMap.geoToPix()

In general, the logic is:

lon = (parseInt(theInsideLayer.style.left) + xOrigin) * cellSize
lat = (parseInt(theInsideLayer.style.lat) + yOrigin) * cellSize

(or it might be - xOrigin/yOrigin ... haven't looked at the code)

except that you will only get lon/lat if you are using a geographic projection with 
UNITS DD in your map file.  Otherwise, you will get coordinates in whatever your 
projection is.

MapBuilder has a javascript implementation of the PROJ library (or at least parts of it) 
that could be used in ka-Map to reproject from certain projections like LCC into a 
lon/lat projection (like EPSG:4326)

HTH

Paul


On Jun 15, Nakayama Kotaro <cot at d2.dion.ne.jp> wrote:
> 
> Hi all.
> 
> I have a simple question.
> How to get current longitude and latitude from ka-map?
> I guess it relates to variables such as nCurrentLeft, nCurrentTop,
> xOrigin, yOrigin in JavaScript... But I couldn't understand what means that.
> I saw this question (Derek Munro: "Caching timeout explanation") in the
> archive but I couldn't find the answer.
> 
> Thanks
> 
> ----------
> Kotaro Nakayama
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> <a href='http://lists.maptools.org/mailman/listinfo/ka-map-
users'>http://lists.maptools.org/mailman/listinfo/ka-map-users</a>
> 


More information about the ka-Map-users mailing list