[OpenLayers-Users] Draw a RegularPolygon automatically by defining the coordinates

stash steffen.schwarz85 at googlemail.com
Mon Dec 14 04:04:35 EST 2009


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.



More information about the Users mailing list