0

I would like to create Bounds for a layer but I am not sure in what order I have to provide the min_x / max_x and min_y / max_y coordinates.

is it correct to put it in that order: min_y, min_x, max_y, max_x

var bounds = new OpenLayers.Bounds.fromArray([{{ wms.min_y }}, {{ wms.min_x }}, {{ wms.max_y }}, {{ wms.max_x }}, ]);

2 Answers 2

1

The documentation for the Bounds constructor says:

bounds {Array(Number)} [left, bottom, right, top]

So you need to provide these parameters as numbers

var bounds = new OpenLayers.Bounds.fromArray([wms.min_x, wms.min_y, wms.max_x, wms.max_y]);

1

The full documentation for the above answer is at

http://dev.openlayers.org/apidocs/files/OpenLayers/BaseTypes/Bounds-js.html

1
  • Hi! Welcome to GIS StackExchange, thank you for your post. Apr 11, 2014 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.