[OpenLayers-Dev] OL 2.13.1 + latest Proj4js (?)

Andreas Hocevar ahocevar at boundlessgeo.com
Thu Oct 3 12:11:18 PDT 2013


Hey,

You'll have to add the following wrapper before you load projections from
spatialreference.org and before you load OpenLayers.js:

    <script>
        window.Proj4js = {
            Proj: function(code) { return proj4(Proj4js.defs[code]); },
            defs: proj4.defs,
            transform: proj4
        };
    </script>

This is all.

Andreas.


On Thu, Oct 3, 2013 at 7:28 AM, Andrea Battisti <battisti at actgate.com>wrote:

> Hello,
>
> Looks like that the latest version of Proj4js from:
> https://github.com/proj4js/**proj4js <https://github.com/proj4js/proj4js>
>
> has a slightly different API then before, and indeed it does not seem to
> work with the plain OL 2.13.1.
>
> Question: is there a patch available to use OL against the new Proj4js?
> If not, which is the best way to make it compatible?
>
> As far as I see the code to adapt will be the OpenLayers.Projection class
> in Projection.js; is that enough? are there other changes needed from the
> OL perspective?
>
>
> Thanks in advance!
> --
> Ing. Andrea Battisti
> ______________________________**_________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**dev<http://lists.osgeo.org/mailman/listinfo/openlayers-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20131003/78c4cb2a/attachment.html>


More information about the Dev mailing list