1 Nov 2011 15:29
Re: Openlayers.Bounds().transform() not doing transform
Did you include the definition for EPSG:26915? Otherwise it will
try to look it up via a proxy.
Proj4js.defs["EPSG:26915"] = "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"; Mike
On 31/10/2011 10:41 PM, Matthew Pettis wrote:
Proj4js.defs["EPSG:26915"] = "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"; Mike
On 31/10/2011 10:41 PM, Matthew Pettis wrote:
I am trying to do a coordinate transform of bounds in Openlayers, and have tried the following, which, for both console.log() statements, gives me the same bounds in both cases (but I expect the second statement to give me bounds in EPGS:4326):<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Bounds Example</title><script src="/OpenLayers-2.10/OpenLayers.js"></script><script type="text/javascript">function init(){var fromProjection = new OpenLayers.Projection("EPSG:26915");var toProjection = new OpenLayers.Projection("EPSG:4326");var extent = new OpenLayers.Bounds(189775.379950,4816289.746171,761662.354535,5472414.143295);console.log(extent);console.log(extent.transform(fromProjection,toProjection));}</script></head><body onload="init()"></body></html>In both console.log() statements, I get the following object (c&p from Chrome javascript debugger):Classbottom: 4816289.746171centerLonLat: nullleft: 189775.37995right: 761662.354535top: 5472414.143295__proto__: ObjectI read the documentation for proj4js with openlayers here, and it tells me:OpenLayers integrates with Proj4js if the library is available. This will make using it a bit easier. Having it in the same folder as OpenLayers.js will make it available.Which I did via a symlink:matt <at> xxxxxxxx:/var/www/xxxxx$ ll /var/www/OpenLayers-2.10/total 1008drwxr-xr-x 13 matt matt 4096 Nov 1 01:49 .drwxrwxrwx 30 root root 4096 Nov 1 01:43 ..-rw-r--r-- 1 matt matt 945828 Sep 9 2010 OpenLayers.js...lrwxrwxrwx 1 matt matt 31 Nov 1 01:49 proj4js.js -> /var/www/proj4js/lib/proj4js.js...Can someone help me diagnose what I'm doing wrong here?Thanks, MattPS -- I've crossposted from stackoverflow, as I don't know which place is getting more activity -- http://stackoverflow.com/questions/7961872/openlayers-bounds-transform-not-doing-transform--
Do not seek to follow in the footsteps of the wise men of old. Seek what they sought.
- Matsuo Munefusa (”Basho”)
_______________________________________________ Users mailing list Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ Users mailing list Users@... http://lists.osgeo.org/mailman/listinfo/openlayers-users
RSS Feed