[OpenLayers-Users] OpenLayers do not detect Proj4js

Juanma M. R. juanma.mr at gmail.com
Thu Feb 6 06:23:35 PST 2014


Dear list,

I am trying to reproject in client side using OpenLAyers but I have
problems to find how to make OpenLayers detecting Proj4js. The proj

The source code for including OpenLayers and Proj4js is:

<script TYPE="text/javascript" src="proj4js-2.1.0/dist/"></script>
> <script TYPE="text/javascript"
> src="OpenLayers-2.10/OpenLayers.js"></script>


The source code for reprojecting is:

olb = new OpenLayers.Bounds(b.minx,b.miny,b.maxx,b.maxy);

var srcprj = new OpenLayers.Projection("EPSG:23030");
>
var destprj = new OpenLayers.Projection("EPSG:900913"); //A definition of
>

newOlb = olb.transform(srcprj, destprj);


The OpenLayers.Projection method creates a Projection object but the proj
instance, the property of Projection type, is null in both cases. So I
imagine it is not capable of creating it. I have the documentation but
maybe I am missing something so obvious ... the final result is that the
coordinates of the new bounds are a copy of the original ones.

The other question is how to declare the "EPSG:900913". I have included a
file with the Proj4js.defs for each EPSG code to be included but when I add
the line to include this .js content it teels me that Proj4js is not an
object.

So, I am doing something wrong integrating the proj4js and OpenLayers.
Could anyone help me? Just pointing to the right docummentation to
configure OpenLayers with Proj4js (I have already tried copying proj4js in
the same folder as OpenLayers.js but t didn't work).

Cheers,
Juan Manuel Moreno Rivera.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20140206/c4724a9e/attachment.html>


More information about the Users mailing list