Get a circle from Openlayers 3

1

Hello, I need to get the radius of a circle created in Openlayers 3. Does anyone know how to do it?

Here has the example of the map with the possibility of creating the circles.

    
asked by anonymous 29.07.2016 / 14:52

1 answer

1

I found the following solution that worked very well:

draw.on('drawend', function(evt){
  var feature = evt.feature;
  var p = feature.getGeometry();
  var radius = p.getRadius();
  console.log(radius);
});
    
29.07.2016 / 20:02