Hi check out: http://dev.openlayers.org/docs/files/OpenLayers/Geometry/Polygon-js.html#OpenLayers.Geometry.Polygon.createRegularPolygon
On Mon, Dec 14, 2009 at 10:04 AM, stash <[email protected]> wrote: > > Hello, > in my app I can draw a polygon by setting up a > openlayers.handler.regularpolygon on my map. This is working really fine and > looks like this. > > boxControl = new OpenLayers.Control(); > OpenLayers.Util.extend(boxControl, { > draw: function() { > this.box = new OpenLayers.Handler.RegularPolygon(boxControl, > { "done": this.notice }, { sides: 4, irregular: true, persist: true }); > this.box.activate(); > }, > > notice: function(geom) > { } > > > But now it would be great if the polygon will be drawn by openlayers > automatically. That means that I only want to define the coordinates and > then the polygon will be shown on my map. Is this possible? Because with my > code for the regularpolygon it is only possible to draw a polygon by myself. > > Is it possible to do this automatically by defining the coordinates? > > Thanks for the help. > > Regards > stash > -- > View this message in context: > http://n2.nabble.com/Draw-a-RegularPolygon-automatically-by-defining-the-coordinates-tp4163028p4163028.html > Sent from the OpenLayers Users mailing list archive at Nabble.com. > _______________________________________________ > Users mailing list > [email protected] > http://openlayers.org/mailman/listinfo/users > -- Ivan Grcic _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
