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

Ivan Grcic igrcic at gmail.com
Mon Dec 14 04:29:55 EST 2009


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
<steffen.schwarz85 at googlemail.com> 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
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Ivan Grcic



More information about the Users mailing list