When I draw a regular polygon in OpenLayers, it draws from the center out (like a circle). I would like it behave more like Handler.Box does (drawing from the UL corner to LR corner.) Is this possible or do I need to figure out how to get Handler.Box to work?

Whenever I use Handler.Box I get this error:

TypeError: feature.geometry.getBounds is not a function
var bounds = feature.geometry.getBounds();

Which is an error in the OpenLayers.js file.

I have all the code for Regular Polygon (all the after insert code and such) so I would prefer to get it to behave how I want. I couldn't find anything in the docs about it, or maybe I didn't understand it.

1 Answer 1


Adding the option irregular: true seems to solve it.

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.