[OpenLayers-Users] OL2 Bounds validation

Max Demars burton449geo at gmail.com
Mon Mar 30 05:38:59 PDT 2015


Hi,

First, is this the correct list for OL2 questions?

I would like to know if there is a way to validate OpenLayers.Bounds on
creation. I have noticed that Bounds would be created even if we pass the
bounds mins and maxs in wrong order or even if mins and maxs have the same
values.

For instances, these wont return error:

bounds = new OpenLayers.Bounds.fromArray([0,0,0,0]);

bounds = new OpenLayers.Bounds.fromArray([1,1,-1,-1]);

I have noticed that these erronous bounds objects will have hazardous
behaviour if we transform them to Features and play with them with
TransformFeatures control or else.

Does OL2 have a method to validate Bounds or should I test values and order
manually?

Thank you,

Maxime Demers



-- 
Stack Overflow: http://stackoverflow.com/users/1914034/burton449
GIS Overflow: http://gis.stackexchange.com/users/14426/burton449
LastFm: http://www.lastfm.fr/user/burton449
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20150330/dfc3d75a/attachment.html>


More information about the Users mailing list