[OpenLayers-Users] drawing rectangles

Puneet Kishor punk.kish at gmail.com
Thu Nov 17 15:35:17 EST 2011


I am trying to implement a control to draw non-rotatable rectangles on the map. The following code draws squares only, and with "snapAngle" at 0, it can be rotated freely, while with "snapAngle" at 360 the square is rotated by 45 deg, for some reason.

	var feature_ctl = new OpenLayers.Control.DrawFeature(
		vectorLayer,
		OpenLayers.Handler.RegularPolygon, {handlerOptions: {sides: 4, snapAngle: 0}}
        );

Would appreciate guidance on how I can make the control draw only non-rotatable rectangles.

--
Puneet Kishor


More information about the Users mailing list