On Nov 16, 2010, at 8:31 PM, ext Roald de Wit wrote:

> Hi Phil,
> 
> I can reproduce your observations below when I load proj4js-compressed.js or 
> proj4js.js (1.0.1 or 1.0.0). Without proj4js fullBounds is OK. Either there 
> is a bug in Proj4JS or in OL's use of it. I hope this helps you find out 
> where things go wrong.
> 
> Regards,
> 
> Roald
> 
> On 17/11/10 09:23, Phil Scadden wrote:
>> With this code:
>> 
>> var p4326 = new OpenLayers.Projection("EPSG:4326");
>> var p900913 = new OpenLayers.Projection("EPSG:900913");
>> fullBounds = new OpenLayers.Bounds(-180.0,-90.0,180,90.0);
>> fullBounds.transform(p4326,p900913);
>> nzArea = new OpenLayers.Bounds(161.0,-50.0,179.99,-31.0);
>> nzArea.transform(p4326,p900913);
>> 
>> fullBounds becomes {-pi,-pi/2,pi,pi/2} after the transform, whereas
>> nzArea transforms turns into "proper" Sphericalmercator coodinates. What 
>> gives here?

What exactly do you expect to happen when you provide completely unreasonable 
values to 
reproject? :p Mercator projections go to infinity when you go to +90/-90, so 
there is no
actual reasonable thing to return in this case; the current behavior is 
certainly not
ideal, but the other option seems to me to be "throw an exception".

(This is why the mercator max bounds are at ~+/-85 degrees in the spherical 
mercator 
tile bounds.)

-- Chris

>> 
>> -- 
>> Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, Private 
>> Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
>> 
>> Notice: This email and any attachments are confidential. If received in 
>> error please destroy and immediately notify us. Do not copy or disclose the 
>> contents.
>> 
>>  
>> 
>> _______________________________________________
>> Users mailing list
>> 
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> <ATT00001..txt>

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to