Get Area size using Dragbox in Openlayers 3

المشرف العام

Administrator
طاقم الإدارة
I need to be able to show the square meters of an area using dragbox. There's a great example using draw polygon, but I need to limit users to a regular rectangle.

The formulas and SHOULD be the same or simular. I've replaced "Draw" with "DragBox" and "drawstart" and "drawend" with "boxstart" and "boxend". I also commented out the "formatLength" function, as I don't need it.

I'd use this script if I knew how to limit draw polygon to a regular rectangle.



أكثر...
 
أعلى