[OpenLayers-Users] transformations

Chris Jackson webturtles at gmail.com
Sun Dec 8 14:52:42 PST 2013


Hi Jerome

I tried the following, think I might have tried it before.

bbox = layerDetails.bbox.transform(new
OpenLayers.Projection('EPSG:4326'),new OpenLayers.Projection('EPSG:3857'));

Yet alert(bbox[0]); or  alert(bbox); still dies silently, so I guess the
transformation falls over - tried 900913 too. The native bbox returns
"-0.4399999976158142", "53.400001525878906", "0.25", "53.79999923706055".
Odd!
Cheers
Chris




On 8 December 2013 22:30, Jerome A. Wendell <jawendell at suddenlink.net>wrote:

> Chris,
>
>
>
> Try using layerDetails.bbox.transform(new
> OpenLayers.Projection('EPSG:4326'),new OpenLayers.Projection('EPSG:3857'));
>
>
>
> If EPSG:3857 doesn’t work, use EPSG: 900913.
>
>
>
> Jerome Wendell
>
>
>
>
>
> *From:* openlayers-users-bounces at lists.osgeo.org [mailto:
> openlayers-users-bounces at lists.osgeo.org] *On Behalf Of *Chris Jackson
> *Sent:* Sunday, December 08, 2013 5:17 PM
> *To:* openlayers-users at lists.osgeo.org
> *Subject:* [OpenLayers-Users] transformations
>
>
>
> Hi all
>
>
>
> I am trying to transform a bounding box from EPSG:4326 to EPSG:3857 (map
> projection).
>
>
>
> bbox = layerDetails.bbox.transform(new OpenLayers.Projection('EPSG:4326'),
> map.getProjectionObject());
>
>
>
> This seems to just fall into a heap!
>
>
>
> bbox = layerDetails.bbox works ok, just returns co-ordinates in the layer
> projection  EPSG:4326.
>
>
>
> Am I missing a step?
>
>
>
> Thanks
>
> Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131208/45d94c64/attachment.html>


More information about the Users mailing list