[OpenLayers-Users] Discovering the Polygon's Type

Pierre GIRAUD bluecarto at gmail.com
Wed Oct 1 17:22:13 EDT 2008


The answer is "you cannot".
Because it's just a Polygon. There is no regular polygon geometry in OpenLayers.
The only thing that is regular is the way the handler draws it. When
drawn, the geometry becomes an irregular one.

Hope this helps.

Regards,
Pierre

On Wed, Oct 1, 2008 at 8:32 PM, Luciano - Uol <l.s.borges at uol.com.br> wrote:
> Hi all,
>
> How Can I find what kind of shape I had draw?
>
> Example:
>
> I  created this control:
>
>                triangulo: new
> OpenLayers.Control.DrawFeature(polygonLayer,
> OpenLayers.Handler.RegularPolygon, {featureAdded: onFeatureAdded,
> handlerOptions: {sides: 3}}),
>
> I have this function:
>
>  function onFeatureAdded(feature){
>    idVetor = feature.id.split("_")[1];
>    alert(idVetor);
> // HERE I'D LIKE TO KNOW HOW MANY SIDES THE FEATURE ADDED HAS
>
> Someone can help me?
>
> Sds, Luciano.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list