[OpenLayers-Users] Features Attribute

Arnd Wippermann arnd.wippermann at web.de
Thu Sep 25 16:53:05 EDT 2008


This should work:

var obj = this.features[this.features.length-1];
var geom = obj.geometry;
var L = geom.getLength();
var A = geom.getArea();

alert("Länge:" + L + "\r\nFläche:" + A );

Arnd Wippermann

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Luciano - Uol
Gesendet: Donnerstag, 25. September 2008 17:17
An: OpenLayers
Betreff: [OpenLayers-Users] Features Attribute

Hi All,

What is the features attribute?

I've this code:
  polygonLayer.events.register('featureadded',
                                polygonLayer,
                                function(){
                                  var x =
this.features[this.features.length-1].id;
                                  alert(x);
                                }
                                );

I'd like to get the area from the polygon that i had draw.

Luciano.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list