[MetaCRS] Proj4js works on Firefox but not on IE8

Scott Lewis scott.lewis at nsidc.org
Mon Oct 26 09:58:26 EDT 2009


I've seen something similar with one of the projects I'm working on. 
Sometimes, it seems that it can take a few seconds for the projection 
information to be loaded when creating a Proj object.

You may want to check to see if "projSt70.readyToUse" and 
"projWGS84.readyToUse" are both true - if either is false, the transform 
call returns a clone of the original point.

This seems to be confirmed by the wiki page:
http://trac.osgeo.org/proj4js/wiki/UserGuide

"Dynamic loading occurs asynchronously so you must ensure that the 
Proj4js.Proj.readyToUse flag is set before carrying out any tranformations."

The page does mention one way around this is to manually include the 
projection definitions, either from a <script> include, or by manually 
setting something like:

Proj4js.defs["EPSG:31700"]="...proj string info...";
Proj4js.defs["EPSG:4326"]="...proj string info...";

I hope this helps.

Scott Lewis
NSIDC

sandric ionut wrote:
> -->
> 
> Hello to everybody:
> 
> I want to transform between Stereo70 - Romania to LatLong WGS84 and I am 
> using the code bellow. It is working on Firefox but not on IE8. In IE8 
> it doesn't make the transformation and I get on alert function the same 
> values entered in stX and stY
> 
>  
> 
> I don't know what I do wrong
> 
>  
> 
> Ionut
> 
>  
> 
>  
> 
> var, pctSt70XY, pctLatLong
> 
> var stX = 420000;
> 
> var stY = 350000;
> 
> var projSt70 = new Proj4js.Proj('EPSG:31700');
> 
> var projWGS84 = new Proj4js.Proj('EPSG:4326');
> 
>  
> 
> function init() {
> 
> pctSt70XY = new Proj4js.Point(stX, stY);
> 
> var pctSt70XYIn = pctSt70XY.clone();
> 
> Proj4js.transform(projSt70, projWGS84, pctSt70XYIn);
> 
> alert(pctSt70XYIn.x, pctSt70XYIn.y);
> 
> }
> 
>  
> 
>  
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> MetaCRS mailing list
> MetaCRS at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/metacrs


More information about the MetaCRS mailing list